Help with assertion encryption ?
Brent Putman
putmanb at georgetown.edu
Tue May 20 15:52:57 EDT 2014
On 5/20/14 1:54 PM, Brent Putman wrote:
> On 5/20/14 1:37 PM, Tom Zeller wrote:
>>>> 2014-05-19 23:30:35.483 [ERROR] :
>>>> org.opensaml.xmlsec.encryption.support.Encrypter: Error encrypting
>>>> XMLObject
>>>> java.security.InvalidAlgorithmParameterException: Unsupported
>>>> parameter: javax.crypto.spec.IvParameterSpec at 63f14c5f
>>>> at com.sun.crypto.provider.CipherCore.init(CipherCore.java:509)
>>> That's actually more troubling. I'll need to look into whether there's
>>> more that needs to be done to actually make AES GCM work on Java 8.
>> Another note : after rebuilding idp-dist with the latest code and
>> configs, SSO works fine to my unchanged SP using Java 7, but the same
>> error occurs with Java 8.
>
> Ok, thanks. That's what I was afraid of. In looking at Santuario
> XMLCipher, they seem to be doing the right thing re: generating and
> using an IV. I'll need to confirm, but it may be that in fact AES GCM
> doesn't actually work on vanilla Java 8 like we thought....
Looking at this further and comparing to some AES GCM test code that I
had from a long time ago, I think the problem may be the IV size that
Santuario uses for the GCM variants, as defined in their JCEMapper.
They specify 96 bits (12 bytes). (Non-GCM AES uses 128 bits). My test
code with BC was using 128 bits (16 bytes). I tried 96 bits and it
still worked. So maybe it's really supposed to be 128, but BC pads it
out or something if it's less.
When I get into the office, I'll test where I have a Java 8 environment,
but I suspect it will show that Java 8's AES GCM support requires an IV
of 128 bits. I don't know off-hand what the correct IV size(s) for AES
GCM are, have to go do some reading. Maybe Scott or Ian knows.
But either way, it looks like it's not our bug. Either Santuario is
(slightly) broken here, or Java 8 is. I hoping the former, b/c it's
probably a 30-second fix. If so, I'll bring it up on their list and/or
file a bug with them.
More information about the dev
mailing list