Changeset 84670 in vbox for trunk/src/VBox/Runtime/common/crypto
- Timestamp:
- Jun 3, 2020 7:53:34 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138429
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/x509-certpaths.cpp
r84379 r84670 571 571 } 572 572 573 /** 574 * Helper for checking whether a certificate is in the trusted store or not. 575 */ 576 static bool rtCrX509CertPathsIsCertInStore(PRTCRX509CERTPATHNODE pNode, RTCRSTORE hStore) 577 { 578 bool fRc = false; 579 PCRTCRCERTCTX pCertCtx = RTCrStoreCertByIssuerAndSerialNo(hStore, &pNode->pCert->TbsCertificate.Issuer, 580 &pNode->pCert->TbsCertificate.SerialNumber); 581 if (pCertCtx) 582 { 583 if (pCertCtx->pCert) 584 fRc = RTCrX509Certificate_Compare(pCertCtx->pCert, pNode->pCert) == 0; 585 RTCrCertCtxRelease(pCertCtx); 586 } 587 return fRc; 588 } 589 573 590 /** @} */ 574 591 … … 579 596 */ 580 597 581 /**582 *583 * @returns584 * @param pThis .585 */586 598 static PRTCRX509CERTPATHNODE rtCrX509CertPathsNewNode(PRTCRX509CERTPATHSINT pThis) 587 599 { … … 919 931 pCur->uDepth = 0; 920 932 pCur->uSrc = RTCRX509CERTPATHNODE_SRC_TARGET; 933 934 /* Check if the target is trusted and do the upgrade (this is outside the RFC, 935 but this simplifies the path validator usage a lot (less work for the caller)). */ 936 if ( pThis->pTrustedCert 937 && RTCrX509Certificate_Compare(pThis->pTrustedCert, pCur->pCert) == 0) 938 pCur->uSrc = RTCRX509CERTPATHNODE_SRC_TRUSTED_CERT; 939 else if ( pThis->hTrustedStore != NIL_RTCRSTORE 940 && rtCrX509CertPathsIsCertInStore(pCur, pThis->hTrustedStore)) 941 pCur->uSrc = RTCRX509CERTPATHNODE_SRC_TRUSTED_STORE; 921 942 922 943 pThis->pErrInfo = pErrInfo; … … 1195 1216 else if (uVerbosity >= 3) 1196 1217 RTAsn1Dump(&pCurLeaf->pCert->TbsCertificate.T3.Extensions.SeqCore.Asn1Core, 0, iIndent, pfnPrintfV, pvUser); 1218 1219 rtDumpIndent(pfnPrintfV, pvUser, iIndent, "Valid : %s thru %s\n", 1220 RTTimeToString(&pCurLeaf->pCert->TbsCertificate.Validity.NotBefore.Time, 1221 pThis->szTmp, sizeof(pThis->szTmp) / 2), 1222 RTTimeToString(&pCurLeaf->pCert->TbsCertificate.Validity.NotAfter.Time, 1223 &pThis->szTmp[sizeof(pThis->szTmp) / 2], sizeof(pThis->szTmp) / 2) ); 1197 1224 } 1198 1225 else
Note:
See TracChangeset
for help on using the changeset viewer.