diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/main.cpp b/tests/main.cpp index 3f9bbf9..e4438e7 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -205,10 +205,10 @@ int main() if(database.doesStoredUserExist(username)) fail("Expected stored to not exist until it has been added"); - database.storeUserPasswordEncrypted(*databaseNode.getRequestHash(), username, password, *adminUserKey); + database.storeNodeInfoForUserEncrypted(databaseNode, username, password, *adminUserKey); try { - database.storeUserPasswordEncrypted(*databaseNode.getRequestHash(), username, password, localUserKeyPair); + database.storeNodeInfoForUserEncrypted(databaseNode, username, password, localUserKeyPair); fail("Expected store user password to fail since we have already stored an user in the node"); } catch(SqlExecException &e) @@ -219,15 +219,17 @@ int main() if(!database.doesStoredUserExist(username)) fail("Expected stored to exist after it has been added"); - auto nodeUserData = database.getStoredUserNodeDataDecrypted(username, password); + auto nodeUserData = database.getStoredNodeUserInfoDecrypted(username, password); assertEquals((size_t)1, nodeUserData.size()); auto userDataIt = nodeUserData.find(*databaseNode.getRequestHash()); if(userDataIt == nodeUserData.end()) fail("Expected stored node hash to match node hash"); - if(userDataIt->second.getPublicKey() != adminUserKey->getPublicKey()) + if(userDataIt->second.userKeyPair->getPublicKey() != adminUserKey->getPublicKey()) fail("Expected stored public key to match admin user public key"); - if(userDataIt->second.getPrivateKey() != adminUserKey->getPrivateKey()) + if(userDataIt->second.userKeyPair->getPrivateKey() != adminUserKey->getPrivateKey()) fail("Expected stored private key to match admin user private key"); + if(userDataIt->second.nodeEncryptionKey->getView() != databaseCreateResponse->getNodeEncryptionKey()->getView()) + fail("Expected stored node encryption key to match node encryption key"); try { |