Changeset 84310 in vbox for trunk/src/VBox/Runtime/common/crypto/x509-verify.cpp
- Timestamp:
- May 14, 2020 5:40:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/x509-verify.cpp
r82968 r84310 89 89 * encoded bits are missing. 90 90 */ 91 if ( pThis->TbsCertificate.SeqCore.Asn1Core.uData.pu8 92 && pThis->TbsCertificate.SeqCore.Asn1Core.cb > 0) 91 const uint8_t *pbRaw; 92 uint32_t cbRaw; 93 void *pvFree = NULL; 94 rc = RTAsn1EncodeQueryRawBits(RTCrX509TbsCertificate_GetAsn1Core(&pThis->TbsCertificate), &pbRaw, &cbRaw, &pvFree, pErrInfo); 95 if (RT_SUCCESS(rc)) 96 { 93 97 rc = RTCrPkixPubKeyVerifySignature(&pThis->SignatureAlgorithm.Algorithm, hPubKey, pParameters, &pThis->SignatureValue, 94 RTASN1CORE_GET_RAW_ASN1_PTR(&pThis->TbsCertificate.SeqCore.Asn1Core), 95 RTASN1CORE_GET_RAW_ASN1_SIZE(&pThis->TbsCertificate.SeqCore.Asn1Core), 96 pErrInfo); 97 else 98 { 99 uint32_t cbEncoded; 100 rc = RTAsn1EncodePrepare((PRTASN1CORE)&pThis->TbsCertificate.SeqCore.Asn1Core, RTASN1ENCODE_F_DER, &cbEncoded, pErrInfo); 101 if (RT_SUCCESS(rc)) 102 { 103 void *pvTbsBits = RTMemTmpAlloc(cbEncoded); 104 if (pvTbsBits) 105 { 106 rc = RTAsn1EncodeToBuffer(&pThis->TbsCertificate.SeqCore.Asn1Core, RTASN1ENCODE_F_DER, 107 pvTbsBits, cbEncoded, pErrInfo); 108 if (RT_SUCCESS(rc)) 109 rc = RTCrPkixPubKeyVerifySignature(&pThis->SignatureAlgorithm.Algorithm, hPubKey, pParameters, 110 &pThis->SignatureValue, pvTbsBits, cbEncoded, pErrInfo); 111 else 112 AssertRC(rc); 113 RTMemTmpFree(pvTbsBits); 114 } 115 else 116 rc = VERR_NO_TMP_MEMORY; 117 } 98 pbRaw, cbRaw, pErrInfo); 99 RTMemTmpFree(pvFree); 118 100 } 119 101
Note:
See TracChangeset
for help on using the changeset viewer.