Added registration.

Currently doesn't return any valid result, hence host believes device
failed to register, however, insecure storage of keys does occur.
This commit is contained in:
2018-07-31 00:09:25 +00:00
parent 03e105bbcf
commit 86af080ba6
39 changed files with 1136 additions and 339 deletions

25
Storage.hpp Normal file
View File

@@ -0,0 +1,25 @@
#include <map>
#include <array>
#include <string>
#include <fstream>
class Storage
{
public:
using KeyHandle = uint32_t;
using AppParam = std::array<uint8_t, 32>;
using PrivKey = std::array<uint8_t, 32>;
using PubKey = std::array<uint8_t, 65>;
protected:
Storage() = default;
static std::string filename;
public:
static void init(const std::string &dirPrefix = "");
static void save();
static std::map<KeyHandle, AppParam> appParams;
static std::map<KeyHandle, PrivKey> privKeys;
static std::map<KeyHandle, PubKey> pubKeys;
};