[JIRA] (OSJ-355) ConcatKDF parameter requirements too restrictive in ECDH

Brent Putman (Jira) jira at shibboleth.atlassian.net
Thu Jun 30 22:52:59 UTC 2022


Brent Putman ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A97de0981-adc3-4044-95ed-131622fad81e ) *commented* on OSJ-355 ( https://shibboleth.atlassian.net/browse/OSJ-355?atlOrigin=eyJpIjoiNjljM2Y1ZjIzOWNkNGM0M2E0OGVmNGNmNWIwYjIwNDgiLCJwIjoiaiJ9 )

Re: ConcatKDF parameter requirements too restrictive in ECDH ( https://shibboleth.atlassian.net/browse/OSJ-355?atlOrigin=eyJpIjoiNjljM2Y1ZjIzOWNkNGM0M2E0OGVmNGNmNWIwYjIwNDgiLCJwIjoiaiJ9 )

Yes, I confirm that’s what OpenSAML does now - “00” and ““ are treated the same, meaning an empty byte array. ““ was already treated that way, so the change just treats “00” as a legal value also. Now both mean empty byte array.

Yes, I largely agree on the arbitrary length bitstring issue. Most or all libraries and hash functions aren’t going to support that. We use Bouncy Castle for their ConcatKDF implementation, and it does not, so OpenSAML also does not, and supports only whole byte values.

That’s documented in the Javadoc, in case you did not see. On decryption, OpenSAML will reject any of those 5 fields in XML if it starts with anything other than “00”. And it only generates the same when encrypting.

That makes the unpadding and decoding very easy, since we just strip off the leading “00” and then hex decode. Encoding and padding is similarly easy - just prepend “00” the hex encoded string.

Strictly speaking, in BC the only thing that has to be a whole byte[] is the OtherInfo (concat of the 5 bitstring fields). So I guess one could theoretically support arbitrary length values for the individual 5 fields, as long as the concat of the 5 was a whole byte[] (multiple of 8 bits). But the effort required to do that and the complications to the interface for tracking and processing the bitstrings didn’t seem worth the (extremely small) benefit, so I did not bother to implement that.

XML Encryption does have guidance in the spec as a green Note at the very bottom of 5.4.1:

“While any bit string can be used with ConcatKDF, it is RECOMMENDED to keep byte aligned for greatest interoperability.”

So I took that to heart and only supported whole byte values, for both generating and consuming cases.

( https://shibboleth.atlassian.net/browse/OSJ-355#add-comment?atlOrigin=eyJpIjoiNjljM2Y1ZjIzOWNkNGM0M2E0OGVmNGNmNWIwYjIwNDgiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/OSJ-355#add-comment?atlOrigin=eyJpIjoiNjljM2Y1ZjIzOWNkNGM0M2E0OGVmNGNmNWIwYjIwNDgiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100201- sha1:c6c9d1f )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220630/897d5249/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-79d2fbb6-e1c7-4be7-9833-e72eefa8c56d
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220630/897d5249/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-2e82d070-32f8-4acf-a14a-04fcb7897f6e
Type: image/png
Size: 425 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220630/897d5249/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-88c243d7-3dda-4790-a3bf-acb5d646f29c
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220630/897d5249/attachment-0005.png>


More information about the commits mailing list