pysaml2 icon indicating copy to clipboard operation
pysaml2 copied to clipboard

Using AES instead of DES-192 for Encryption

Open JHoelting opened this issue 4 years ago • 6 comments

When encrypting the SAML message, the configuration passed top xmlsec seem to use DES-192 This is the command thats ran

/usr/local/bin/xmlsec1 --encrypt --pubkey-cert-pem /var/folders/pg/cghxqls97rdb6dltkcy3v_2h0000gn/T/tmpwihgq3id --session-key des-192 --xml-data /var/folders/pg/cghxqls97rdb6dltkcy3v_2h0000gn/T/tmpvs7obw71 --node-xpath /*[local-name()='Response']/*[local-name()='EncryptedAssertion']/*[local-name()='Assertion'] --output /var/folders/pg/cghxqls97rdb6dltkcy3v_2h0000gn/T/tmp8epggsyb.xml /var/folders/pg/cghxqls97rdb6dltkcy3v_2h0000gn/T/tmp6oe7y7_2

Is it possible to use AES instead of DES-192, it seems like DES is hardcoded into the code and I cant find where to change it from the requirements.

Code Version

pysaml2==7.0.1

Expected Behavior

Have some way of configuring which algorithm is used for encryption

JHoelting avatar Aug 23 '21 12:08 JHoelting

It's a default paramenter in the code, here:

  • https://github.com/IdentityPython/pysaml2/blob/a9a4fe9601cac56917e38197c177772084dc5ce0/src/saml2/sigver.py#L1243
  • https://github.com/IdentityPython/pysaml2/blob/a9a4fe9601cac56917e38197c177772084dc5ce0/src/saml2/sigver.py#L757

I think that we could use an option in the general configuration to handle this behaviour.

consider also the enc template https://github.com/IdentityPython/pysaml2/blob/master/src/saml2/data/templates/template_enc.xml

peppelinux avatar Aug 24 '21 09:08 peppelinux

So does the code even support AES ? will changing key_type from des-192 to say AES-128 work? @peppelinux

JHoelting avatar Aug 24 '21 14:08 JHoelting

Try It, go ahead and share results, we can work on a pull request for that

peppelinux avatar Aug 24 '21 15:08 peppelinux

I agree that we should review this and change it (or make it configurable)

c00kiemon5ter avatar Sep 21 '21 12:09 c00kiemon5ter

@c00kiemon5ter / @peppelinux do you have any plans considering this issue?

melanger avatar Feb 23 '23 11:02 melanger

I don't have any updates, formerly we should assign this issue to a developer and this should present a PR. Is there any candidates?

Hope to talk about this during the next idpy call, thank you melanger for having pointed out this

peppelinux avatar Feb 23 '23 20:02 peppelinux