Skip to content

Commit

Permalink
Fix #766: Failing test testEncryptionAndDecryptionDifferentActivation…
Browse files Browse the repository at this point in the history
…FailServerPrivateKeyConverter
  • Loading branch information
romanstrobl committed Nov 14, 2024
1 parent 1fc61a9 commit 7b47913
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ void testEncryptionAndDecryptionDifferentActivationFailServerPrivateKeyConverter
final ServerPrivateKey serverPrivateKeyEncrypted = serverPrivateKeyConverter.toDBValue(serverPrivateKeyBytes, USER_ID, ACTIVATION_ID);

assertEquals(EncryptionMode.AES_HMAC, serverPrivateKeyEncrypted.encryptionMode());
assertThrows(GenericServiceException.class, () ->
serverPrivateKeyConverter.fromDBValue(serverPrivateKeyEncrypted, USER_ID, "115286e0-e1c5-4ee1-8d1b-c6947cab0a56"));

try {
String decryptedPrivateKeyBase64 = serverPrivateKeyConverter.fromDBValue(serverPrivateKeyEncrypted, USER_ID, "115286e0-e1c5-4ee1-8d1b-c6947cab0a56");
assertNotEquals(decryptedPrivateKeyBase64, SERVER_PRIVATE_KEY_PLAIN);
} catch (GenericServiceException ex) {
assertEquals("Generic cryptography error occurred.", ex.getMessage());
}
}

}

0 comments on commit 7b47913

Please sign in to comment.