Commit eafae45
Florent
Modify signature reference URI only when use inner signature certificate
When Response should be verifiy with the IdP certificate and the signature
reference URI is empty we can not modify the Response content or it will be
considered as invalid, ex.:
$ xmlsec1 --sign \
--id-attr:ID urn:oasis:names:tc:SAML:2.0:protocol:Response \
--privkey-pem python-saml/metadata.key \
--output python-saml/signed_assertion.xml \
python-saml/unsigned_assertion.xml
$ xmlsec1 --verify \
--id-attr:ID urn:oasis:names:tc:SAML:2.0:protocol:Response \
--pubkey-cert python-saml/metadata.crt \
python-saml/signed_assertion.xml
OK
$ python -c "
from onelogin.saml2.utils import OneLogin_Saml2_Utils
with open('python-saml/signed_assertion.xml') as assertion:
with open('python-saml/metadata.crt') as cert:
print OneLogin_Saml2_Utils.validate_sign(assertion.read(), cert.read(), debug=True)
"
signatures.c:346(xmlSecOpenSSLEvpSignatureVerify) obj=rsa-sha1 subject=EVP_VerifyFinal msg=signature do not match errno=18
False
On another hand we should continue to do that if we validate the xml
with an internal certificate.1 parent 6b6c2fa commit eafae45
2 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1051 | 1051 | | |
1052 | 1052 | | |
1053 | 1053 | | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1054 | 1060 | | |
1055 | 1061 | | |
1056 | 1062 | | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
1221 | 1227 | | |
1222 | 1228 | | |
1223 | 1229 | | |
| |||
0 commit comments