Skip to content

Commit

Permalink
Fix #471: Unable to compile after adding support for temporary keys
Browse files Browse the repository at this point in the history
  • Loading branch information
banterCZ committed Sep 3, 2024
1 parent 4caf367 commit 76df446
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,12 @@ protected void addEncryptedRequest(StepContext<M, EciesEncryptedResponse> 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())
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void addEncryptedRequest(StepContext<M, R> 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public StepContext<EncryptStepModel, EciesEncryptedResponse> 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());
Expand All @@ -134,7 +134,7 @@ public StepContext<EncryptStepModel, EciesEncryptedResponse> 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
Expand Down

0 comments on commit 76df446

Please sign in to comment.