From 99891c578e4a10186e56d06a3646b4812e99ccf5 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Tue, 28 May 2024 09:53:40 +0100 Subject: [PATCH] Fix addressed pull request review comments --- .../encrypiton/api/types/encryption/KeyCreationConfig.java | 2 +- .../impl/cmsencryption/CMSEncryptionServiceImpl.java | 2 +- .../impl/cmsencryption/decryptors/KeyAgreeDecryptor.java | 4 ++-- .../config-test/null-test/expectation/mutable-null-keys.yaml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/datasafe-encryption/datasafe-encryption-api/src/main/java/de/adorsys/datasafe/encrypiton/api/types/encryption/KeyCreationConfig.java b/datasafe-encryption/datasafe-encryption-api/src/main/java/de/adorsys/datasafe/encrypiton/api/types/encryption/KeyCreationConfig.java index 97955e4c1..17633aa9b 100644 --- a/datasafe-encryption/datasafe-encryption-api/src/main/java/de/adorsys/datasafe/encrypiton/api/types/encryption/KeyCreationConfig.java +++ b/datasafe-encryption/datasafe-encryption-api/src/main/java/de/adorsys/datasafe/encrypiton/api/types/encryption/KeyCreationConfig.java @@ -54,7 +54,7 @@ public static class EncryptingKeyCreationCfg { private final String sigAlgo = "SHA256withECDSA"; @Builder.Default - private final String curve = "Curve25519"; + private final String curve = "secp256r1"; } @Getter diff --git a/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/CMSEncryptionServiceImpl.java b/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/CMSEncryptionServiceImpl.java index a350ee418..6833b667f 100644 --- a/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/CMSEncryptionServiceImpl.java +++ b/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/CMSEncryptionServiceImpl.java @@ -85,7 +85,7 @@ public JceKeyAgreeRecipientInfoGenerator getJceKeyAgreeRecipientInfoGenerator(Ke CMSAlgorithm.ECDH_SHA256KDF, senderKeyPair.getPrivate(), senderKeyPair.getPublic(), - CMSAlgorithm.AES128_WRAP); + CMSAlgorithm.AES256_WRAP); jceKeyAgreeRecipientInfoGenerator.addRecipient(publicKeyWithId.getKeyID().getValue().getBytes(), publicKeyWithId.getPublicKey()); return jceKeyAgreeRecipientInfoGenerator; } diff --git a/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/decryptors/KeyAgreeDecryptor.java b/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/decryptors/KeyAgreeDecryptor.java index 61ed4a32b..6dd6013aa 100644 --- a/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/decryptors/KeyAgreeDecryptor.java +++ b/datasafe-encryption/datasafe-encryption-impl/src/main/java/de/adorsys/datasafe/encrypiton/impl/cmsencryption/decryptors/KeyAgreeDecryptor.java @@ -24,9 +24,9 @@ public class KeyAgreeDecryptor extends Decryptor { @Override @SneakyThrows - public InputStream decryptionStream(Key key) { + public InputStream decryptionStream(Key privateKey) { return recipientInfo - .getContentStream(new JceKeyAgreeEnvelopedRecipient((PrivateKey) key)) + .getContentStream(new JceKeyAgreeEnvelopedRecipient((PrivateKey) privateKey)) .getContentStream(); } } \ No newline at end of file diff --git a/datasafe-encryption/datasafe-encryption-impl/src/test/resources/config-test/null-test/expectation/mutable-null-keys.yaml b/datasafe-encryption/datasafe-encryption-impl/src/test/resources/config-test/null-test/expectation/mutable-null-keys.yaml index c6a8d0e00..ab620df15 100644 --- a/datasafe-encryption/datasafe-encryption-impl/src/test/resources/config-test/null-test/expectation/mutable-null-keys.yaml +++ b/datasafe-encryption/datasafe-encryption-impl/src/test/resources/config-test/null-test/expectation/mutable-null-keys.yaml @@ -20,11 +20,11 @@ keys: algo: ECDH size: 256 sigAlgo: SHA256withECDSA - curve: Curve25519 + curve: secp256r1 signing: algo: ECDH size: 256 sigAlgo: SHA256withECDSA - curve: Curve25519 + curve: secp256r1 cms: algo: cms-algo1