Skip to content

RAMPART-462: Use AlgorithmSuite encryption algorithm for symmetric key generation - #28

Open
andreas-ibm wants to merge 2 commits into
apache:masterfrom
andreas-ibm:RAMPART-462
Open

andreas-ibm wants to merge 2 commits into
apache:masterfrom
andreas-ibm:RAMPART-462

Conversation

@andreas-ibm

Copy link
Copy Markdown
Contributor

SymmetricBindingBuilder.setupEncryptedKey() always generated an AES-128 session key
(KeyUtils.getKeyGenerator(WSConstants.AES_128)), regardless of the encryption
algorithm in the policy's sp:AlgorithmSuite.

It now asks the policy's AlgorithmSuite for its encryption algorithm
(getEncryption()), and falls back to AES-128 if that is null.

Fixes https://issues.apache.org/jira/browse/RAMPART-462

  • Only the key generator selection in setupEncryptedKey() changes. Error handling is
    unchanged (the existing printStackTrace() / return null on WSSecurityException
    is left as-is to keep this PR minimal).
  • For suites that already use AES-128 (e.g. Basic128) behaviour is identical.
  • For other suites (e.g. Basic256, Basic192, TripleDes) the generated key now
    matches the policy instead of being 128-bit AES.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant