Remove abstract_crypto_backend class 05/236505/2
authorDariusz Michaluk <d.michaluk@samsung.com>
Wed, 17 Jun 2020 12:31:38 +0000 (14:31 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Tue, 30 Jun 2020 10:31:13 +0000 (12:31 +0200)
Change-Id: I0ccbf28b4a20ad4ef20f533774973199d5b76d17

15 files changed:
src/abstractcryptobackend.cpp [deleted file]
src/abstractcryptobackend.h [deleted file]
src/abstractcryptobackendcontext.cpp [deleted file]
src/abstractcryptobackendcontext.h [deleted file]
src/dummy-backend/CMakeLists.txt
src/dummy-backend/dcm-backend-api-dummy.cpp
src/dummy-backend/dummycryptobackend.cpp [deleted file]
src/dummy-backend/dummycryptobackend.h [deleted file]
src/dummy-backend/dummycryptobackendcontext.cpp
src/dummy-backend/dummycryptobackendcontext.h
src/kse-backend/CMakeLists.txt
src/kse-backend/dcm-backend-api-kse.cpp
src/kse-backend/ksebackend.h
src/kse-backend/ksebackendcontext.h
src/kse-backend/soresolver.cpp

diff --git a/src/abstractcryptobackend.cpp b/src/abstractcryptobackend.cpp
deleted file mode 100644 (file)
index aa246e7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#include "abstractcryptobackend.h"
-
-abstract_crypto_backend::abstract_crypto_backend() {
-}
-
-abstract_crypto_backend::~abstract_crypto_backend() {
-}
diff --git a/src/abstractcryptobackend.h b/src/abstractcryptobackend.h
deleted file mode 100644 (file)
index 3dbbea1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#ifndef ABSTRACTCRYPTOBACKEND_H_
-#define ABSTRACTCRYPTOBACKEND_H_
-
-#include <boost/noncopyable.hpp>
-#include <memory>
-#include <string>
-
-#include <device-certificate-manager-backend/dcm-backend-api.h>
-
-class abstract_crypto_backend_context;
-
-class abstract_crypto_backend : public std::enable_shared_from_this<abstract_crypto_backend>,
-       public boost::noncopyable
-{
-protected:
-       abstract_crypto_backend();
-
-public:
-       virtual ~abstract_crypto_backend();
-};
-
-#endif /* ABSTRACTCRYPTOBACKEND_H_ */
diff --git a/src/abstractcryptobackendcontext.cpp b/src/abstractcryptobackendcontext.cpp
deleted file mode 100644 (file)
index a0b207e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#include "abstractcryptobackendcontext.h"
-
-abstract_crypto_backend_context::abstract_crypto_backend_context() {
-}
-
-abstract_crypto_backend_context::~abstract_crypto_backend_context() {
-}
diff --git a/src/abstractcryptobackendcontext.h b/src/abstractcryptobackendcontext.h
deleted file mode 100644 (file)
index 36b98aa..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#ifndef ABSTRACTCRYPTOBACKENDCONTEXT_H_
-#define ABSTRACTCRYPTOBACKENDCONTEXT_H_
-
-#include "abstractcryptobackend.h"
-
-class abstract_crypto_backend_context : public std::enable_shared_from_this<abstract_crypto_backend_context> {
-protected:
-       abstract_crypto_backend_context();
-
-public:
-       virtual ~abstract_crypto_backend_context();
-
-       virtual int request_certificate_chain(std::string& mutable_chain) = 0;
-
-       virtual int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
-                       std::string& digestResult) = 0;
-
-       virtual CryptoKeyType key_type() = 0;
-
-       virtual unsigned int key_length() = 0;
-};
-
-#endif /* ABSTRACTCRYPTOBACKENDCONTEXT_H_ */
index 4f3414c1b851495107d0999a2eebff9015a4ddf4..8b1f3c9b1ae5a30b5fb9d3c27e1fea669d2c30b6 100644 (file)
@@ -74,9 +74,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 add_library(${DCM_BACKEND_API}
        SHARED
        dcm-backend-api-dummy.cpp
-       ../abstractcryptobackend.cpp
-       ../abstractcryptobackendcontext.cpp
-       dummycryptobackend.cpp
        dummycryptobackendcontext.cpp
        ../log.cpp
        ${CMAKE_CURRENT_BINARY_DIR}/rootCA_ecdsa_key.c
index 28de132046d310bcdf7cea36f5cd8d371e47170f..2f4c8769cc49546d2c0b9d560f8c1a25f89e5810 100644 (file)
@@ -18,8 +18,9 @@
  *
  ******************************************************************/
 
-#include "dummycryptobackend.h"
 #include "dummycryptobackendcontext.h"
+#include <string>
+#include <device-certificate-manager-backend/dcm-backend-api.h>
 
 void dcm_backend_create_key_context(dcm_backend_context& ctx,
                                     const std::string& keyType) {
diff --git a/src/dummy-backend/dummycryptobackend.cpp b/src/dummy-backend/dummycryptobackend.cpp
deleted file mode 100644 (file)
index 6ba286d..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#include "dummycryptobackend.h"
-#include "dummycryptobackendcontext.h"
-#include "log.h"
-
-dummy_crypto_backend::dummy_crypto_backend() {
-}
-
-dummy_crypto_backend::~dummy_crypto_backend() {
-}
diff --git a/src/dummy-backend/dummycryptobackend.h b/src/dummy-backend/dummycryptobackend.h
deleted file mode 100644 (file)
index c80e566..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#ifndef DUMMY_BACKEND_DUMMYCRYPTOBACKEND_H_
-#define DUMMY_BACKEND_DUMMYCRYPTOBACKEND_H_
-
-#include "abstractcryptobackend.h"
-
-class dummy_crypto_backend final : public abstract_crypto_backend {
-public:
-       dummy_crypto_backend();
-       virtual ~dummy_crypto_backend();
-};
-
-#endif /* DUMMY_BACKEND_DUMMYCRYPTOBACKEND_H_ */
index bdca8d79ff1cdcabc4c92b380e9fe21627fae006..11fa2f5a1c7c4376164ee52fc457490f0fe94f38 100644 (file)
@@ -23,6 +23,7 @@
 #include <mbedtls/ctr_drbg.h>
 #include <iostream>
 #include "log.h"
+#include <string>
 
 extern "C" {
        extern size_t dummy_rootca_rsa_key_size;
index d152348bf78efb7fd7b4d5a19c497ae95e733475..7061b0e0669c4523f94211721ae3622dbb0b00fe 100644 (file)
 #ifndef DUMMY_BACKEND_DUMMYCRYPTOBACKENDCONTEXT_H_
 #define DUMMY_BACKEND_DUMMYCRYPTOBACKENDCONTEXT_H_
 
-#include "abstractcryptobackendcontext.h"
 #include <mbedtls/ctr_drbg.h>
 #include <mbedtls/entropy.h>
+#include <string>
+#include <device-certificate-manager-backend/dcm-backend-api.h>
 
-class dummy_crypto_backend_context final : public abstract_crypto_backend_context {
+class dummy_crypto_backend_context {
 public:
        dummy_crypto_backend_context(const std::string& keyType);
-       virtual ~dummy_crypto_backend_context();
+       ~dummy_crypto_backend_context();
 
-       virtual int request_certificate_chain(std::string& mutable_chain) override;
+       int request_certificate_chain(std::string& mutable_chain);
 
-       virtual int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
-                       std::string& digestResult) override;
+       int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
+                       std::string& digestResult);
 
-       virtual CryptoKeyType key_type() override;
+       CryptoKeyType key_type();
 
-       virtual unsigned int key_length() override;
+       unsigned int key_length();
 
 private:
        CryptoKeyType           fKey;
index 4cde8d48e0e88f33f930c29ef127cc81b8dbdc9e..59a027a2eecb167447199f282bc954dcaf8347cb 100644 (file)
@@ -32,8 +32,6 @@ add_library(${DCM_BACKEND_API}
        SHARED
        dcm-backend-api-kse.cpp
        soresolver.cpp
-       ../abstractcryptobackend.cpp
-       ../abstractcryptobackendcontext.cpp
        ksebackend.cpp
        ksebackendcontext.cpp
        ../log.cpp
index 21d3891fda61854afb1e00f9bfbbde12780dee8c..9f3c3ad2802fdb05112d397cb196db257ffa6b76 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "ksebackend.h"
 #include "ksebackendcontext.h"
+#include <device-certificate-manager-backend/dcm-backend-api.h>
 
 static std::shared_ptr<kse_backend> backend(new kse_backend());
 
index 785999ba8d0ee1e28bfd79e3880e259191b4cf93..bb50c0f00f469f82cc2d9443d04dda3e3ab1e755 100644 (file)
 #ifndef KSE_BACKEND_KSEBACKEND_H_
 #define KSE_BACKEND_KSEBACKEND_H_
 
-#include "abstractcryptobackend.h"
 #include "soresolver.h"
 #include <mutex>
 
 
-class kse_backend: public abstract_crypto_backend
+class kse_backend
 {
 public:
        kse_backend();
-       virtual ~kse_backend();
+       ~kse_backend();
 
        inline so_resolver& get_so_resolver() {
                return fSoResolver;
index 21047ea56ff55730e8bc4bb05fec84a3d375c989..de00c31285084db5d1041affff15cb0f5d5e5587 100644 (file)
 #ifndef KSE_BACKEND_KSEBACKENDCONTEXT_H_
 #define KSE_BACKEND_KSEBACKENDCONTEXT_H_
 
-#include "abstractcryptobackendcontext.h"
 #include "ksebackend.h"
+#include <device-certificate-manager-backend/dcm-backend-api.h>
 
-class kse_backend_context final : public abstract_crypto_backend_context {
+class kse_backend_context
+{
 public:
        kse_backend_context(std::shared_ptr<kse_backend> backend, const std::string& keyType);
-       virtual ~kse_backend_context();
+       ~kse_backend_context();
 
-       virtual int request_certificate_chain(std::string& mutable_chain) override;
+       int request_certificate_chain(std::string& mutable_chain);
 
-       virtual int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
-                       std::string& digestResult) override;
+       int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
+                       std::string& digestResult);
 
-       virtual CryptoKeyType key_type() override;
+       CryptoKeyType key_type();
 
-       virtual unsigned int key_length() override;
+       unsigned int key_length();
 
 private:
        int get_certificate(unsigned int index, std::string& cert);
index c236365f8823f6fb703a96ba4ffb6212b313f6e4..8e60e3be38b1811f6339c1a533d95cf9fadf7e2a 100644 (file)
@@ -21,6 +21,7 @@
 #include "soresolver.h"
 #include "log.h"
 #include <dlfcn.h>
+#include <memory>
 
 so_resolver::so_resolver(const std::string& libraryName) :
        fLibraryName(libraryName),