Skip to content

Commit

Permalink
Merge pull request #1772 from /issues/766-failing-test-private-key
Browse files Browse the repository at this point in the history
Fix #766: Failing test testEncryptionAndDecryptionDifferentActivationFailServerPrivateKeyConverter
  • Loading branch information
romanstrobl authored Nov 14, 2024
2 parents 1fc61a9 + 7b47913 commit a76aae5
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 a76aae5

Please sign in to comment.