Changeset 59669 in vbox
- Timestamp:
- Feb 15, 2016 12:36:48 AM (9 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ApplianceImplPrivate.h
r59621 r59669 69 69 , hMemFileTheirManifest(NIL_RTVFSFILE) 70 70 , fSignerCertLoaded(false) 71 , fCertificateValid(false) 71 72 , fSignatureValid(false) 72 73 , pbSignedDigest(NULL) … … 127 128 enmSignedDigestType = RTDIGESTTYPE_INVALID; 128 129 fSignatureValid = false; 130 fCertificateValid = false; 129 131 fDeterminedDigestTypes = false; 130 fDigestTypes = RTMANIFEST_ATTR_SHA1 | RTMANIFEST_ATTR_SHA256 ;132 fDigestTypes = RTMANIFEST_ATTR_SHA1 | RTMANIFEST_ATTR_SHA256 | RTMANIFEST_ATTR_SHA512; 131 133 } 132 134 … … 165 167 /** Set if the SignerCert member contains usable data. */ 166 168 bool fSignerCertLoaded; 167 /** Set by read() if it found a certificate and the signature is fine. */ 169 /** Set by read() when the SignerCert checked out fine. */ 170 bool fCertificateValid; 171 /** Set by read() if pbSignedDigest verified correctly against SignerCert. */ 168 172 bool fSignatureValid; 169 173 /** The signed digest of the manifest. */ -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r59626 r59669 1667 1667 else 1668 1668 hrc = setErrorVrc(vrc, tr("Error reading the signer's certificate from '%s' for '%s' (%Rrc): %s"), 1669 pszSubFileNm, pTask->locInfo.strPath.c_str(), vrc, StaticErrInfo. szMsg);1669 pszSubFileNm, pTask->locInfo.strPath.c_str(), vrc, StaticErrInfo.Core.pszMsg); 1670 1670 1671 1671 RTVfsIoStrmReadAllFree(pvSignature, cbSignature); … … 1723 1723 vrc = RTCrPkixSignatureVerify(hSignature, hDigest, m->pbSignedDigest, m->cbSignedDigest); 1724 1724 if (RT_SUCCESS(vrc)) 1725 { 1726 m->fSignatureValid = true; 1725 1727 hrc = S_OK; 1728 } 1726 1729 else if (vrc == VERR_CR_PKIX_SIGNATURE_MISMATCH) 1727 1730 hrc = setErrorVrc(vrc, tr("The manifest signature does not match")); … … 1741 1744 if (SUCCEEDED(hrc)) 1742 1745 { 1746 if (RTCrX509Certificate_IsSelfSigned(&m->SignerCert)) 1747 { 1748 /* Not entirely sure if we care whether a self issued certificate is 1749 marked as CA. But let's be a little bit picky about it for now. */ 1750 if ( m->SignerCert.TbsCertificate.T3.pBasicConstraints 1751 && m->SignerCert.TbsCertificate.T3.pBasicConstraints->CA.fValue) 1752 { 1753 RTERRINFOSTATIC StaticErrInfo; 1754 vrc = RTCrX509Certificate_VerifySignatureSelfSigned(&m->SignerCert, RTErrInfoInitStatic(&StaticErrInfo)); 1755 if (RT_SUCCESS(vrc)) 1756 hrc = S_OK; 1757 else 1758 hrc = setErrorVrc(vrc, tr("Verification of the self signed certificate used to sign '%s' failed (%Rrc): %s"), 1759 pTask->locInfo.strPath.c_str(), vrc, StaticErrInfo.Core.pszMsg); 1760 } 1761 else 1762 hrc = setError(E_FAIL, 1763 tr("Self signed certificate used to sign '%s' is not marked as certificate authority (CA)"), 1764 pTask->locInfo.strPath.c_str()); 1765 } 1766 else 1767 { 1768 1769 } 1770 1743 1771 /** @todo certificate validation. */ 1744 1772 } 1745 1746 1773 } 1747 1774
Note:
See TracChangeset
for help on using the changeset viewer.