I'm currently working on a saml2 login with Django, which uses djangosaml2. When trying to authenticate, I got a "signature failed" error from pysaml2
which I could narrow down to an error produced by xmlsec1
(see below). If I understand the error correct, xmlsec1
can't read the file as base64. However, if I run base64 /tmp/test.xml
it works. Am I missing something here?
$ xmlsec1 --verify /tmp/test_b64.xml
func=xmlSecBase64CtxDecodeByte:file=base64.c:line=403:obj=unknown:subj=unknown:error=12:invalid data:invalid data for 'inByte': actual=92 and expected base64 character
func=xmlSecBase64CtxDecode:file=base64.c:line=554:obj=unknown:subj=xmlSecBase64CtxDecodeByte:error=1:xmlsec library function failed:status=4
func=xmlSecBase64CtxUpdate:file=base64.c:line=261:obj=unknown:subj=xmlSecBase64CtxDecode:error=1:xmlsec library function failed:
func=xmlSecBase64Decode:file=base64.c:line=674:obj=unknown:subj=xmlSecBase64CtxUpdate:error=1:xmlsec library function failed:
func=xmlSecOpenSSLX509CertBase64DerRead:file=x509.c:line=1705:obj=unknown:subj=xmlSecBase64Decode:error=1:xmlsec library function failed:
func=xmlSecOpenSSLX509CertificateNodeRead:file=x509.c:line=956:obj=x509:subj=xmlSecOpenSSLX509CertBase64DerRead:error=1:xmlsec library function failed:
func=xmlSecOpenSSLX509DataNodeRead:file=x509.c:line=886:obj=x509:subj=xmlSecOpenSSLX509CertificateNodeRead:error=1:xmlsec library function failed:node=X509Certificate
func=xmlSecOpenSSLKeyDataX509XmlRead:file=x509.c:line=663:obj=x509:subj=xmlSecOpenSSLX509DataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeRead:file=keyinfo.c:line=121:obj=x509:subj=xmlSecKeyDataXmlRead:error=1:xmlsec library function failed:node=X509Data
func=xmlSecKeysMngrGetKey:file=keys.c:line=1234:obj=unknown:subj=xmlSecKeyInfoNodeRead:error=1:xmlsec library function failed:node=KeyInfo
func=xmlSecDSigCtxProcessKeyInfoNode:file=xmldsig.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=508:obj=unknown:subj=xmlSecDSigCtxProcessKeyInfoNode:error=1:xmlsec library function failed:
func=xmlSecDSigCtxVerify:file=xmldsig.c:line=346:obj=unknown:subj=xmlSecDSigCtxProcessSignatureNode:error=1:xmlsec library function failed:
Error: signature failed
ERROR
SignedInfo References (ok/all): 0/0
Manifests References (ok/all): 0/0
Error: failed to verify file "/tmp/test_b64.xml"
question from:
https://stackoverflow.com/questions/65894242/xmlsec1-invalid-data-for-inbyte 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…