diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-05-14 03:07:43 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-05-14 03:07:46 +0200 |
commit | 1fe14e8fcfbec25cb6b70df194a82ede4cc0a3e5 (patch) | |
tree | 06e5fee96df9f9205e729bb2a3a9976f7de15ab1 /src/LocalUserEncrypted.cpp | |
parent | 87a425d8461b084407cfe5aa11ca2832033b4453 (diff) |
Remove user/group classes, user public key/group id directly to database instead
Diffstat (limited to 'src/LocalUserEncrypted.cpp')
-rw-r--r-- | src/LocalUserEncrypted.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/LocalUserEncrypted.cpp b/src/LocalUserEncrypted.cpp deleted file mode 100644 index a414c89..0000000 --- a/src/LocalUserEncrypted.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "../include/odhtdb/LocalUserEncrypted.hpp" -#include "../include/odhtdb/PasswordHash.hpp" -#include <cstring> - -namespace odhtdb -{ - EncryptedPrivateKey::EncryptedPrivateKey() - { - memset(nonce, 0, ENCRYPTION_NONCE_BYTE_SIZE); - memset(encryptedPrivateKey, 0, ENCRYPTION_CHECKSUM_BYTE_SIZE + PRIVATE_KEY_NUM_BYTES); - } - - EncryptedPrivateKey::EncryptedPrivateKey(const EncryptedPrivateKey &other) - { - memcpy(nonce, other.nonce, ENCRYPTION_NONCE_BYTE_SIZE); - memcpy(encryptedPrivateKey, other.encryptedPrivateKey, ENCRYPTION_CHECKSUM_BYTE_SIZE + PRIVATE_KEY_NUM_BYTES); - } - - Signature::PrivateKey EncryptedPrivateKey::decrypt(const DataView &plainPassword, const DataView &salt) const - { - OwnedMemory hashedPassword = hashPassword(plainPassword, salt); - Decryption decryptedPrivateKey(DataView((void*)encryptedPrivateKey, ENCRYPTION_CHECKSUM_BYTE_SIZE + PRIVATE_KEY_NUM_BYTES), - DataView((void*)nonce, ENCRYPTION_NONCE_BYTE_SIZE), - DataView(hashedPassword.data, hashedPassword.size)); - return { (const char*)decryptedPrivateKey.getDecryptedText().data, decryptedPrivateKey.getDecryptedText().size }; - } -} |