diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-21 14:47:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-01-05 12:24:03 +0100 |
commit | 9fb45044d93ffcaa63cfe3275c8fb5feb8c00504 (patch) | |
tree | 56261d7db5d499c9e03907a73a7feb6b28fe3032 /xmlsecurity/source/xmlsec/nss | |
parent | 1cb5b519a06709e22b99bec75d7bf95020442205 (diff) |
xmlsecurity nss: log what XML DOM node is given to libxmlsec
We have two environments where the signature and the stream bytes are
the same, still in one case the signature verification succeeds and in
the other case the hash doesn't match.
Log the signature as parsed into a DOM node (recursively), just case
something goes wrong during extracting a single signature from the
signatures list XML.
Change-Id: I54af71fdeb63d8ef44342f106746f938fa51f29a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127991
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx index e637785fe613..9257771f2767 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -243,6 +243,13 @@ SAL_CALL XMLSignature_NssImpl::validate( if (xmlSecPtrListAdd(&(pDsigCtx->keyInfoReadCtx.enabledKeyData), BAD_CAST xmlSecNssKeyDataX509GetKlass()) < 0) throw RuntimeException("failed to limit allowed key data"); + xmlBufferPtr pBuf = xmlBufferCreate(); + xmlNodeDump(pBuf, nullptr, pNode, 0, 0); + SAL_INFO("xmlsecurity.xmlsec", "xmlSecDSigCtxVerify input XML node is '" + << reinterpret_cast<const char*>(xmlBufferContent(pBuf)) + << "'"); + xmlBufferFree(pBuf); + //Verify signature int rs = xmlSecDSigCtxVerify( pDsigCtx.get() , pNode ); |