mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 15:16:53 +00:00
Treat blank strings as null pre-keys
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user