diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/institution/impl/SecurityKeyServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/institution/impl/SecurityKeyServiceImpl.java index ea37640d..1112ccda 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/institution/impl/SecurityKeyServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/institution/impl/SecurityKeyServiceImpl.java @@ -180,10 +180,14 @@ public class SecurityKeyServiceImpl implements SecurityKeyService { return Cryptor .decrypt(appSignatureKey + salt, connectionToken) .onErrorDo(error -> { + log.warn( "Failed to decrypt ASK with added salt value. Try to decrypt without added salt. Error: {}", error.getMessage()); - return Cryptor.decrypt(appSignatureKey, connectionToken).get(); + + return Cryptor + .decrypt(appSignatureKey, connectionToken) + .getOrThrow(); }) .map(signature -> createSignatureHash(signature));