Treat blank strings as null pre-keys

This commit is contained in:
Jon Chambers committed 2023-06-09 10:39:16 -04:00
1 parent 17aa5d8e74
commit 7f1ee015d1
4 files changed
+115

No files matched your search

@@ -42,6 +42,10 @@ public class ECPublicKeyAdapter {
throw new JsonParseException(parser, "Could not parse EC public key as a base64-encoded value", e);
}
if (ecPublicKeyBytes.length == 0) {
return null;
}
try {
return new ECPublicKey(ecPublicKeyBytes);
} catch (final InvalidKeyException e) {
@@ -42,6 +42,10 @@ public class KEMPublicKeyAdapter {
throw new JsonParseException(parser, "Could not parse KEM public key as a base64-encoded value", e);
}
if (kemPublicKeyBytes.length == 0) {
return null;
}
try {
return new KEMPublicKey(kemPublicKeyBytes);
} catch (final InvalidKeyException e) {