Skip to content

Commit

Permalink
Replace existing certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Nov 23, 2024
1 parent 315ee94 commit ecd25e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/mbedtls/mbedtls_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,14 @@ static int verify_callback(void* param, mbedtls_x509_crt *crt, int depth, uint32
return MBEDTLS_ERR_X509_FATAL_ERROR;
}
PCCERT_CONTEXT primary_context = {0};
if(!CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, crt->raw.p, crt->raw.len, CERT_STORE_ADD_ALWAYS, &primary_context)) {
if(!CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, crt->raw.p, crt->raw.len, CERT_STORE_ADD_REPLACE_EXISTING, &primary_context)) {
CertCloseStore(store, 0);
return MBEDTLS_ERR_X509_FATAL_ERROR;
}
while(crt->next) {
crt = crt->next;
PCCERT_CONTEXT ctx = {0};
if (!CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, crt->raw.p, crt->raw.len, CERT_STORE_ADD_ALWAYS, &ctx))
if (!CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, crt->raw.p, crt->raw.len, CERT_STORE_ADD_REPLACE_EXISTING, &ctx))
{
CertFreeCertificateContext(primary_context);
CertCloseStore(store, 0);
Expand Down

0 comments on commit ecd25e9

Please sign in to comment.