@@ -177,7 +177,7 @@ func (testSuite *DecryptTest) TestInvalid(c *C) {
|
||||
</X>
|
||||
`)
|
||||
_, err = Decrypt(testSuite.Key, docStr)
|
||||
c.Assert(err, ErrorMatches, "func=xmlSecBase64CtxDecodeByte:file=base64.c:line=441:obj=:subj=:error=12:inByte=0x3f; func=xmlSecBase64CtxDecode:file=base64.c:line=612:obj=:subj=xmlSecBase64CtxDecodeByte:error=1:status=4; func=xmlSecBase64CtxUpdate:file=base64.c:line=268:obj=:subj=xmlSecBase64CtxDecode:error=1: ; func=xmlSecBase64Decode:file=base64.c:line=754:obj=:subj=xmlSecBase64CtxUpdate:error=1: ; func=xmlSecOpenSSLX509CertBase64DerRead:file=x509.c:line=1867:obj=:subj=xmlSecBase64Decode:error=1: ; func=xmlSecOpenSSLX509CertificateNodeRead:file=x509.c:line=981:obj=x509:subj=xmlSecOpenSSLX509CertBase64DerRead:error=1: ; func=xmlSecOpenSSLX509DataNodeRead:file=x509.c:line=942:obj=x509:subj=X509Certificate:error=1:read node failed; func=xmlSecOpenSSLKeyDataX509XmlRead:file=x509.c:line=674:obj=x509:subj=xmlSecOpenSSLX509DataNodeRead:error=1: ; func=xmlSecKeyInfoNodeRead:file=keyinfo.c:line=114:obj=x509:subj=xmlSecKeyDataXmlRead:error=1:node=X509Data; func=xmlSecKeysMngrGetKey:file=keys.c:line=1349:obj=:subj=xmlSecKeyInfoNodeRead:error=1:node=KeyInfo; func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=957:obj=:subj=:error=45: ; func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=715:obj=:subj=xmlSecEncCtxEncDataNodeRead:error=1: ; func=xmlSecKeysMngrGetKey:file=keys.c:line=1370:obj=:subj=xmlSecKeysMngrFindKey:error=1: ; func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=957:obj=:subj=:error=45: ; func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=715:obj=:subj=xmlSecEncCtxEncDataNodeRead:error=1: ; func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=623:obj=:subj=xmlSecEncCtxDecryptToBuffer:error=1: ")
|
||||
c.Assert(err, ErrorMatches, "func=xmlSecBase64CtxDecodeByte:file=base64.c:line=441:obj=:subj=:error=12:inByte=0x3f; func=xmlSecBase64CtxDecode:file=base64.c:line=612:obj=:subj=xmlSecBase64CtxDecodeByte:error=1:status=4; func=xmlSecBase64CtxUpdate:file=base64.c:line=268:obj=:subj=xmlSecBase64CtxDecode:error=1: ; func=xmlSecBase64Decode:file=base64.c:line=754:obj=:subj=xmlSecBase64CtxUpdate:error=1: ; func=xmlSecOpenSSLX509CertBase64DerRead:file=x509.c:line=\\d+:obj=:subj=xmlSecBase64Decode:error=1: ; func=xmlSecOpenSSLX509CertificateNodeRead:file=x509.c:line=\\d+:obj=x509:subj=xmlSecOpenSSLX509CertBase64DerRead:error=1: ; func=xmlSecOpenSSLX509DataNodeRead:file=x509.c:line=\\d+:obj=x509:subj=X509Certificate:error=1:read node failed; func=xmlSecOpenSSLKeyDataX509XmlRead:file=x509.c:line=\\d+:obj=x509:subj=xmlSecOpenSSLX509DataNodeRead:error=1: ; func=xmlSecKeyInfoNodeRead:file=keyinfo.c:line=114:obj=x509:subj=xmlSecKeyDataXmlRead:error=1:node=X509Data; func=xmlSecKeysMngrGetKey:file=keys.c:line=1349:obj=:subj=xmlSecKeyInfoNodeRead:error=1:node=KeyInfo; func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=957:obj=:subj=:error=45: ; func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=715:obj=:subj=xmlSecEncCtxEncDataNodeRead:error=1: ; func=xmlSecKeysMngrGetKey:file=keys.c:line=1370:obj=:subj=xmlSecKeysMngrFindKey:error=1: ; func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=957:obj=:subj=:error=45: ; func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=715:obj=:subj=xmlSecEncCtxEncDataNodeRead:error=1: ; func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=623:obj=:subj=xmlSecEncCtxDecryptToBuffer:error=1: ")
|
||||
|
||||
docStr = []byte(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<X>
|
||||
|
||||
@@ -6,6 +6,8 @@ import "unsafe"
|
||||
// brew install libxmlsec1 libxml2
|
||||
// brew link libxml2 --force
|
||||
|
||||
// #cgo CFLAGS: -DXMLSEC_CRYPTO_OPENSSL -UXMLSEC_CRYPTO_DYNAMIC_LOADING
|
||||
// #cgo LDFLAGS: -lxmlsec1-openssl
|
||||
// #include <xmlsec/xmlsec.h>
|
||||
// #include <xmlsec/xmltree.h>
|
||||
// #include <xmlsec/xmlenc.h>
|
||||
|
||||
Reference in New Issue
Block a user