Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AS4RequestHandler does not use correct BDEW profile crypto and signing params #166

Closed
problemzebra2 opened this issue Sep 19, 2023 · 7 comments
Assignees
Labels
Profile BDEW BDEW AS4 related

Comments

@problemzebra2
Copy link
Contributor

AS4RequestHandler for handling incoming AS 4 messages seems to construct new instances of AS4SigningParams and AS4CryptParams. The required parameters according to the official BDEW profile are only set in Phase4BDEWSender.AbstractBDEWUserMessageBuilder

// Other crypt parameters are located in the PMode security part
cryptParams ().setKeyIdentifierType (DEFAULT_KEY_IDENTIFIER_TYPE);
cryptParams ().setKeyEncAlgorithm (ECryptoKeyEncryptionAlgorithm.ECDH_ES_KEYWRAP_AES_128);
cryptParams ().setEncryptSymmetricSessionKey (false);

/**
 * Assumption: the BST "ValueType" attribute is set to
 * "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
 * by WSS4J automatically (see WSSecSignature#addBST)
 */

// See BDEW specs 2.2.6.2
// Other signing parameters are located in the PMode security part
signingParams ().setKeyIdentifierType (DEFAULT_KEY_IDENTIFIER_TYPE);
signingParams ().setAlgorithmC14N (ECryptoAlgorithmC14N.C14N_EXCL_OMIT_COMMENTS);
// Use the BST value type "#X509PKIPathv1"
signingParams ().setUseSingleCertificate (false);

Is this a bug or is there a way to specify the required crypto and signing params for the AS4RequestHandler used for incoming AS 4 messages?

@phax phax self-assigned this Sep 19, 2023
@phax phax added the Profile BDEW BDEW AS4 related label Sep 19, 2023
@phax
Copy link
Owner

phax commented Sep 19, 2023

That seems to be very related to #165 isn't it?

@problemzebra2
Copy link
Contributor Author

Yes, this seems to be a more general issue. #165 refers to a specific signing setting.

@phax
Copy link
Owner

phax commented Sep 19, 2023

I am trying to get a hold of this - I totally see the issue here

@problemzebra2
Copy link
Contributor Author

By the way cryptParams ().setKeyIdentifierType (DEFAULT_KEY_IDENTIFIER_TYPE); seems to be wrong. According to the BDEW profile SKI_KEY_IDENTIFIER should be used. I will make a own issue for this.

@problemzebra2
Copy link
Contributor Author

-> #167

@phax
Copy link
Owner

phax commented Sep 19, 2023

The resolution is implemented in a02ebf6
It changes IAS4IncomingSecurityConfiguration to include the full AS4SigningParams and AS4CryptParams objects.

@phax
Copy link
Owner

phax commented Sep 19, 2023

This should be resolved with the 2.3.0 release

@phax phax closed this as completed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Profile BDEW BDEW AS4 related
Projects
None yet
Development

No branches or pull requests

2 participants