0c7e3c
From a9102a384893fd084011e8451867071452031ece Mon Sep 17 00:00:00 2001
0c7e3c
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
0c7e3c
Date: Mon, 8 Feb 2021 17:05:28 +0000
0c7e3c
Subject: [PATCH 2/6] CVE-2021-25635
0c7e3c
0c7e3c
default to CertificateValidity::INVALID
0c7e3c
0c7e3c
so if CertGetCertificateChain fails we don't want validity to be
0c7e3c
css::security::CertificateValidity::VALID which is what the old default
0c7e3c
of 0 equates to
0c7e3c
0c7e3c
notably
0c7e3c
0c7e3c
commit 1e0bc66d16aee28ce8bd9582ea32178c63841902
0c7e3c
Date:   Thu Nov 5 16:55:26 2009 +0100
0c7e3c
0c7e3c
    jl137:  #103420# better logging
0c7e3c
0c7e3c
turned the nss equivalent of SecurityEnvironment_NssImpl::verifyCertificate
0c7e3c
from 0 to CertificateValidity::INVALID like this change does
0c7e3c
0c7e3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110561
0c7e3c
Tested-by: Jenkins
0c7e3c
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
0c7e3c
(cherry picked from commit edeb164c1d8ab64116afee4e2140403a362a1358)
0c7e3c
0c7e3c
Change-Id: I5350dbc22d1b9b378da2976d3b0abd728f1f4c27
0c7e3c
---
0c7e3c
 .../source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 4 ++--
0c7e3c
 1 file changed, 2 insertions(+), 2 deletions(-)
0c7e3c
0c7e3c
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
0c7e3c
index d9b657891b96..4031df289f44 100644
0c7e3c
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
0c7e3c
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
0c7e3c
@@ -755,7 +755,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
0c7e3c
     const uno::Reference< css::security::XCertificate >& aCert,
0c7e3c
     const uno::Sequence< uno::Reference< css::security::XCertificate > >& seqCerts)
0c7e3c
 {
0c7e3c
-    sal_Int32 validity = 0;
0c7e3c
+    sal_Int32 validity = css::security::CertificateValidity::INVALID;
0c7e3c
     PCCERT_CHAIN_CONTEXT pChainContext = nullptr;
0c7e3c
     PCCERT_CONTEXT pCertContext = nullptr;
0c7e3c
 
0c7e3c
@@ -899,7 +899,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
0c7e3c
         }
0c7e3c
         else
0c7e3c
         {
0c7e3c
-            SAL_INFO("xmlsecurity.xmlsec", "CertGetCertificateChaine failed.");
0c7e3c
+            SAL_INFO("xmlsecurity.xmlsec", "CertGetCertificateChain failed.");
0c7e3c
         }
0c7e3c
     }
0c7e3c
 
0c7e3c
-- 
0c7e3c
2.32.0
0c7e3c