Changeset 97465 in vbox
- Timestamp:
- Nov 8, 2022 9:46:10 PM (2 years ago)
- Location:
- trunk/src/VBox/Runtime/common/crypto
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/iprt-openssl.cpp
r96407 r97465 111 111 X509 *pOsslCertRet = d2i_X509(&pOsslCert, &pabEncoded, cbEncoded); 112 112 RTMemTmpFree(pvFree); 113 if (pOsslCert Ret == pOsslCert)113 if (pOsslCert != NULL && pOsslCertRet == pOsslCert) 114 114 { 115 115 *ppvOsslCert = pOsslCert; … … 181 181 X509_ATTRIBUTE *pOsslAttribRet = d2i_X509_ATTRIBUTE(&pOsslAttrib, &pabEncoded, cbEncoded); 182 182 RTMemTmpFree(pvFree); 183 if (pOsslAttrib Ret == pOsslAttrib)183 if (pOsslAttrib != NULL && pOsslAttribRet == pOsslAttrib) 184 184 { 185 185 *ppvOsslAttrib = pOsslAttrib; -
trunk/src/VBox/Runtime/common/crypto/key-create-rsa-openssl.cpp
r96407 r97465 84 84 unsigned char *pbRsaPrivateKey = NULL; 85 85 int cbRsaPrivateKey = i2d_RSAPrivateKey(pRsa, &pbRsaPrivateKey); 86 if (cbRsaPrivateKey )86 if (cbRsaPrivateKey > 0) 87 87 { 88 88 rc = rtCrKeyCreateRsaPrivate(phKey, pbRsaPrivateKey, cbRsaPrivateKey, NULL, NULL); -
trunk/src/VBox/Runtime/common/crypto/key-openssl.cpp
r96763 r97465 111 111 else 112 112 *ppEvpKey = pRet = d2i_PrivateKey(idKeyType, &pEvpNewKey, &puchPublicKey, hKey->cbEncoded); 113 if (pRet )113 if (pRet != NULL && pRet == pEvpNewKey) 114 114 return VINF_SUCCESS; 115 115 … … 204 204 else 205 205 *ppEvpKey = pRet = d2i_PrivateKey(idKeyType, &pEvpNewKey, &puchPublicKey, hKey->cbEncoded); 206 if (pRet )206 if (pRet != NULL && pRet == pEvpNewKey) 207 207 return VINF_SUCCESS; 208 208 -
trunk/src/VBox/Runtime/common/crypto/pkcs7-verify.cpp
r96959 r97465 79 79 AssertRCReturn(rcOssl, rcOssl); 80 80 81 PKCS7 *pOsslPkcs7 = NULL;81 PKCS7 *pOsslPkcs7 = NULL; 82 82 PKCS7 *pOsslPkcs7Ret = d2i_PKCS7(&pOsslPkcs7, &pbRawContent, cbRawContent); 83 83 84 84 RTMemTmpFree(pvFree); 85 85 86 if (pOsslPkcs7 Ret != NULL)86 if (pOsslPkcs7 != NULL && pOsslPkcs7Ret == pOsslPkcs7) 87 87 { 88 88 STACK_OF(X509) *pAddCerts = NULL; -
trunk/src/VBox/Runtime/common/crypto/store.cpp
r96407 r97465 445 445 && pCertCtx->cbEncoded > 0) 446 446 { 447 X509 *pOsslCert= NULL;447 X509 *pOsslCert = NULL; 448 448 const unsigned char *pabEncoded = (const unsigned char *)pCertCtx->pabEncoded; 449 if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert )449 if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert && pOsslCert != NULL) 450 450 { 451 451 if (!X509_STORE_add_cert(pOsslStore, pOsslCert)) … … 501 501 && pCertCtx->cbEncoded > 0) 502 502 { 503 X509 *pOsslCert= NULL;503 X509 *pOsslCert = NULL; 504 504 const unsigned char *pabEncoded = (const unsigned char *)pCertCtx->pabEncoded; 505 if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert )505 if (d2i_X509(&pOsslCert, &pabEncoded, pCertCtx->cbEncoded) == pOsslCert && pOsslCert != NULL) 506 506 { 507 507 if (!sk_X509_push(pOsslStack, pOsslCert))
Note:
See TracChangeset
for help on using the changeset viewer.