summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-07-29 15:14:43 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-07-29 22:55:07 +0200
commitbee22fd4333408f341ee377fe52f0b1b6dbf76a0 (patch)
tree1753f28eb734222fae50684bac11b453de68bcbb /xmlsecurity
parentd6c6fee69c1457e029095ef93779d971bc89c39d (diff)
Verify signing certificate cryptographically before use in tests
Documents signed using an invalid (e.g., not having a trusted root) certificate give signatures that obviously can't pass validity tests. Change-Id: Id4b097516e06c548ea42cad65d76bbd8a6853cc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137620 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/qa/unit/signing/signing.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index c3c5d254b335..48fc42091e02 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -159,7 +159,8 @@ SigningTest::getCertificate(DocumentSignatureManager& rSignatureManager,
{
auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCertificate.get());
CPPUNIT_ASSERT(pCertificate);
- if (pCertificate->getSignatureMethodAlgorithm() == eAlgo && IsValid(xCertificate))
+ if (pCertificate->getSignatureMethodAlgorithm() == eAlgo
+ && IsValid(xCertificate, xSecurityEnvironment))
return xCertificate;
}
return uno::Reference<security::XCertificate>();