Skip to content

Commit

Permalink
Merge pull request #329 from /issues/328-npe
Browse files Browse the repository at this point in the history
Fix #328: Fix possible NPE when obtaining encryption context
  • Loading branch information
petrdvorak authored Jun 14, 2022
2 parents 68f6afe + 4b51f8a commit 0391f24
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ public abstract class PowerAuthEncryptionProviderBase {
throw new PowerAuthEncryptionException();
}

if (eciesRequest == null) {
logger.warn("Deserialization of request body bytes resulted in null value.");
throw new PowerAuthEncryptionException();
}

// Prepare ephemeral public key
final String ephemeralPublicKey = eciesRequest.getEphemeralPublicKey();
final String encryptedData = eciesRequest.getEncryptedData();
Expand Down

0 comments on commit 0391f24

Please sign in to comment.