File tree Expand file tree Collapse file tree
src/main/java/org/apache/xml/security/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,13 +208,9 @@ public static SecretKey aesWrapKeyWithDHGeneratedKey(KeyAgreementParameters para
208208 PublicKey publicKey = parameterSpec .getAgreementPublicKey ();
209209 PrivateKey privateKey = parameterSpec .getAgreementPrivateKey ();
210210
211- String algorithm = publicKey .getAlgorithm ();
212- if ("EC" .equalsIgnoreCase (algorithm )) {
213- LOG .log (Level .WARNING , "EC keys are detected for key agreement algorithm! " +
214- "Cryptographic algorithm may not be secure, consider using a different algorithm (and keys)." );
215- }
216- algorithm = algorithm + (algorithm .equalsIgnoreCase ("EC" ) ? "DH" : "" );
217- KeyAgreement keyAgreement = KeyAgreement .getInstance (algorithm );
211+ String keyAlgorithm = publicKey .getAlgorithm ();
212+ String keyAgreementAlgorithm = keyAlgorithm + ("EC" .equalsIgnoreCase (keyAlgorithm ) ? "DH" : "" );
213+ KeyAgreement keyAgreement = KeyAgreement .getInstance (keyAgreementAlgorithm );
218214 keyAgreement .init (privateKey );
219215 keyAgreement .doPhase (publicKey , true );
220216 byte [] secret = keyAgreement .generateSecret ();
You can’t perform that action at this time.
0 commit comments