Skip to content

Commit

Permalink
Fix #994: Coverity: Unlogged security exception
Browse files Browse the repository at this point in the history
  • Loading branch information
banterCZ committed Sep 4, 2023
1 parent 799e961 commit b74d341
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ private void handleInvalidPublicKey(ActivationRecordEntity activation) throws Ge
activation.setActivationStatus(ActivationStatus.REMOVED);
activationHistoryServiceBehavior.saveActivationAndLogChange(activation);
callbackUrlBehavior.notifyCallbackListenersOnActivationChange(activation);
logger.warn("Invalid public key, activation ID: {}", activation.getActivationId());
// Exception must not be rollbacking, otherwise data written to database in this method would be lost
throw localizationProvider.buildExceptionForCode(ServiceError.ACTIVATION_NOT_FOUND);
}
Expand Down Expand Up @@ -938,6 +937,8 @@ public PrepareActivationResponse prepareActivation(String activationCode, String
try {
devicePublicKey = keyConversion.convertBytesToPublicKey(devicePublicKeyBytes);
} catch (InvalidKeySpecException ex) {
logger.warn("Invalid public key, activation ID: {}", activation.getActivationId());
logger.debug("Invalid public key, activation ID: {}", activation.getActivationId(), ex);
handleInvalidPublicKey(activation);
}

Expand Down

0 comments on commit b74d341

Please sign in to comment.