engine/encryption/ext4-engine.cpp
engine/encryption/dmcrypt-engine.cpp
engine/encryption/ecryptfs-engine.cpp
+ engine/encryption/cryptsetup-engine.cpp
engine/erase/mmc-engine.cpp
key-manager/key-store.cpp
key-manager/key-manager.cpp
cynara-client
cynara-session
openssl
+ libcryptsetup
)
SET(SERVER_NAME ${PROJECT_NAME}d)
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 __CRYPTSETUP_ENGINE_H__
+#define __CRYPTSETUP_ENGINE_H__
+
+#include <string>
+#include <vector>
+
+namespace ode {
+
+class CryptsetupEngine final {
+public:
+ enum class DeviceType {
+ PLAIN,
+ LUKS,
+ };
+
+ CryptsetupEngine(const std::string &devicePath);
+ CryptsetupEngine(const CryptsetupEngine &) = delete;
+ CryptsetupEngine(CryptsetupEngine &&) = delete;
+ ~CryptsetupEngine();
+
+ CryptsetupEngine &operator=(const CryptsetupEngine &) = delete;
+ CryptsetupEngine &operator=(CryptsetupEngine &&) = delete;
+
+ // TODO make it common among engines
+ typedef std::vector<unsigned char> data;
+
+ void format(DeviceType type, const data &key);
+
+ // create new mapping, returns mapping path
+ std::string open(DeviceType type, const std::string &name, const data &key);
+
+ static void close(const std::string &name);
+
+ bool isKeyMetaSet();
+ const data getKeyMeta();
+ void setKeyMeta(const data &data);
+ void clearKeyMeta();
+
+private:
+ std::string devPath;
+};
+
+} // namespace ode
+#endif // __CRYPTSETUP_ENGINE_H__