From 76df446309fa70bdc1945245d24ca060a0fbc1ee Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Tue, 3 Sep 2024 07:35:14 +0200 Subject: [PATCH] Fix #471: Unable to compile after adding support for temporary keys --- .../powerauth/lib/cmd/steps/AbstractActivationStep.java | 4 ++-- .../security/powerauth/lib/cmd/steps/AbstractBaseStep.java | 2 +- .../security/powerauth/lib/cmd/steps/v3/EncryptStep.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractActivationStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractActivationStep.java index 47dfe79e..f1fc5cdd 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractActivationStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractActivationStep.java @@ -256,12 +256,12 @@ protected void addEncryptedRequest(StepContext stepCo // Get activation key and secret ClientEncryptor clientEncryptorL1 = ENCRYPTOR_FACTORY.getClientEncryptor( EncryptorId.APPLICATION_SCOPE_GENERIC, - new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), null), + new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), null, null), new ClientEncryptorSecrets(model.getMasterPublicKey(), model.getApplicationSecret()) ); ClientEncryptor clientEncryptorL2 = ENCRYPTOR_FACTORY.getClientEncryptor( EncryptorId.ACTIVATION_LAYER_2, - new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), null), + new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), null, null), new ClientEncryptorSecrets(model.getMasterPublicKey(), model.getApplicationSecret()) ); diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java index 02b5c662..5962b0f7 100644 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/AbstractBaseStep.java @@ -194,7 +194,7 @@ public void addEncryptedRequest(StepContext stepContext, String applicatio final ClientEncryptor encryptor; if (securityContext == null) { final byte[] transportMasterKeyBytes = Base64.getDecoder().decode(resultStatusObject.getTransportMasterKey()); - final EncryptorParameters encryptorParameters = new EncryptorParameters(model.getVersion().value(), applicationKey, resultStatusObject.getActivationId()); + final EncryptorParameters encryptorParameters = new EncryptorParameters(model.getVersion().value(), applicationKey, resultStatusObject.getActivationId(), null); final ClientEncryptorSecrets encryptorSecrets = new ClientEncryptorSecrets(resultStatusObject.getServerPublicKeyObject(), applicationSecret, transportMasterKeyBytes); encryptor = ENCRYPTOR_FACTORY.getClientEncryptor(encryptorId, encryptorParameters, encryptorSecrets); stepContext.setSecurityContext(SimpleSecurityContext.builder() diff --git a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/EncryptStep.java b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/EncryptStep.java index 22d81f1b..5741885f 100755 --- a/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/EncryptStep.java +++ b/powerauth-java-cmd-lib/src/main/java/io/getlime/security/powerauth/lib/cmd/steps/v3/EncryptStep.java @@ -124,7 +124,7 @@ public StepContext prepareStepContext( case "application" -> { // Prepare ECIES encryptor with sharedInfo1 = /pa/generic/application encryptorId = EncryptorId.APPLICATION_SCOPE_GENERIC; - final EncryptorParameters encryptorParameters = new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), null); + final EncryptorParameters encryptorParameters = new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), null, null); final ClientEncryptorSecrets encryptorSecrets = new ClientEncryptorSecrets(model.getMasterPublicKey(), model.getApplicationSecret()); encryptor = ENCRYPTOR_FACTORY.getClientEncryptor(encryptorId, encryptorParameters, encryptorSecrets); header = new PowerAuthEncryptionHttpHeader(model.getApplicationKey(), model.getVersion().value()); @@ -134,7 +134,7 @@ public StepContext prepareStepContext( encryptorId = EncryptorId.ACTIVATION_SCOPE_GENERIC; encryptor = ENCRYPTOR_FACTORY.getClientEncryptor( encryptorId, - new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), resultStatusObject.getActivationId()), + new EncryptorParameters(model.getVersion().value(), model.getApplicationKey(), resultStatusObject.getActivationId(), null), new ClientEncryptorSecrets(resultStatusObject.getServerPublicKeyObject(), model.getApplicationSecret(), Base64.decode(resultStatusObject.getTransportMasterKey())) ); // Prepare ECIES encryptor with sharedInfo1 = /pa/generic/activation