Add support for newer signing and/or encryption algorithms

Description

There are apparently some newer algorithms that deployers need and for which we do not have AlgorithmDescriptors and related code. In particular some European specifications are starting to require use of RSASSA-PSS signing.

For algo URIs etc, see: https://www.rfc-editor.org/rfc/rfc9231

Environment

None

Activity

Brent PutmanAugust 9, 2023 at 12:15 AM

There were a couple of threads about it on the users list. One for the SP from May 2022 and for the IdP in Jan 2023 (the latter is why i opened the ticket). Not sure if they are members, but it seems driven by some new-ish European requirements, particularly in Germany:

 

This is very unfortunate, as RSA-PSS is one of the signature algorithms the BSI approved for governmental software in Germany. Furthermore the MUK identity provider, which is to become the central login for business related eGovernment services in Germany as per OZG, decided to require this signature algorithm.
This does not seem to be a fringe use case so I am surprised that there are no plans for Shibboleth to support RSA-PSS.

and

The German cybersecurity agency (BSI) demands the use of either ECDSA or RSASSA-PSS for signing SAML messages in federal applications.

 

They can use BC for now, I guess. The poster on the IdP created his own AlgorithmDescriptor and it was working, so he must have installed BC.

Scott CantorAugust 9, 2023 at 12:05 AM

I guess somebody asked about it on list, but I don’t think they were members, and this is never going to interop with anybody, so I don’t think it’s a priority for us. Even if it were a member, I suspect they could just use BC for now.

Brent PutmanAugust 9, 2023 at 12:02 AM

According to Sean Mullan @ Oracle on the Santuario dev list, these algorithm names are actually not supported and the docs are in error.

There are apparently questions/ambiguity about what these should mean vs “regular” RSA. He opened an OpenJDK ticket to remove them from docs:

https://bugs.openjdk.org/browse/JDK-8313797

The fix version there is noted as 21, so possibly the docs error will persist until the next LTS. Not clear. Oh joy.

His practical answer for doing these algorithms is to use the JCA algorithm name “RSASSA-PSS” + a PSSParameterSpec. Santuario will have to be updated to this new methodology, which should work seamlessly with BC. Not yet clear if or when they will do a release with that update.

I suppose I/we could volunteer to do a patch, but I don’t currently know the JSR 105 part of the codebase - which we do not use - so might be more time-consuming than it appears. Don’t know how much we care, since the current versions of Santuario will work, albeit only with BC installed.

Brent PutmanAugust 4, 2023 at 3:00 AM

There seems to be a possible bug in Oracle Java 17, either the docs or the JDK. The docs for the SunRsaSign provider:

https://docs.oracle.com/en/java/javase/17/security/oracle-providers.html#GUID-17E3589E-E4BA-4881-9B12-9880DD2D128D

clearly indicate support for the 5 RSASSA-PSS SHA-2 variants that have implicit parameters:

SHA1withRSAandMGF1 SHA224withRSAandMGF1 SHA256withRSAandMGF1 SHA384withRSAandMGF1 SHA512withRSAandMGF1

 

But they don’t work in practice, throwing NoSuchAlgorithm. My local program that iterates the providers from java.security.Security confirms that they are indeed not there. They are supported by BC, so for now the runtime algorithm and signature test are conditional on loading BC.

I’m going to send mail to the Santuario mailing list to ask about this. The docs are clearly at odds with the behavior.

There are also 4 SHA-3 variants supported by Santuario, and those are not documented as supported by vanilla Java 17, only by BC.

Brent PutmanAugust 4, 2023 at 2:49 AM
Edited

Implemented support for:

Digests:

http://www.w3.org/2007/05/xmldsig-more#sha3-224 http://www.w3.org/2007/05/xmldsig-more#sha3-256 http://www.w3.org/2007/05/xmldsig-more#sha3-384 http://www.w3.org/2007/05/xmldsig-more#sha3-512

 

Signature:

http://www.w3.org/2007/05/xmldsig-more#sha1-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha224-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha256-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha384-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha512-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha3-224-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha3-256-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha3-384-rsa-MGF1 http://www.w3.org/2007/05/xmldsig-more#sha3-512-rsa-MGF1

 

These are the ones in RFC 9231 that we didn’t yet have and that are currently supported by Santuario 2.3.2.

Completed

Details

Assignee

Reporter

Components

Fix versions

Created February 2, 2023 at 2:21 AM
Updated September 15, 2023 at 3:23 PM
Resolved August 4, 2023 at 3:03 AM

Flag notifications