}
if(ca_info_blob) {
- if(!share->CAinfo_blob_digest) {
- return NULL;
- }
if(share->CAinfo_blob_size != ca_info_blob->len) {
return NULL;
}
ca_info_blob->len,
info_blob_digest,
CURL_SHA256_DIGEST_LENGTH);
- if(memcmp(share->CAinfo_blob_digest,
- info_blob_digest,
+ if(memcmp(share->CAinfo_blob_digest, info_blob_digest,
CURL_SHA256_DIGEST_LENGTH)) {
- return NULL;
+ return NULL;
}
}
else {
if(share->cert_store) {
CertCloseStore(share->cert_store, 0);
}
- free(share->CAinfo_blob_digest);
free(share->CAfile);
free(share);
}
struct Curl_multi *multi = data->multi;
const struct curl_blob *ca_info_blob = conn_config->ca_info_blob;
struct schannel_cert_share *share;
- unsigned char *CAinfo_blob_digest = NULL;
size_t CAinfo_blob_size = 0;
char *CAfile = NULL;
}
if(ca_info_blob) {
- CAinfo_blob_digest = malloc(CURL_SHA256_DIGEST_LENGTH);
- if(!CAinfo_blob_digest) {
- return false;
- }
schannel_sha256sum((const unsigned char *)ca_info_blob->data,
ca_info_blob->len,
- CAinfo_blob_digest,
+ share->CAinfo_blob_digest,
CURL_SHA256_DIGEST_LENGTH);
CAinfo_blob_size = ca_info_blob->len;
}
if(share->cert_store) {
CertCloseStore(share->cert_store, 0);
}
- free(share->CAinfo_blob_digest);
free(share->CAfile);
share->time = Curl_now();
share->cert_store = cert_store;
- share->CAinfo_blob_digest = CAinfo_blob_digest;
share->CAinfo_blob_size = CAinfo_blob_size;
share->CAfile = CAfile;
return true;
#ifdef USE_SCHANNEL
+#include "vtls.h"
+
#if (defined(__MINGW32__) || defined(CERT_CHAIN_REVOCATION_CHECK_CHAIN)) \
&& !defined(CURL_WINDOWS_APP)
#define HAS_MANUAL_VERIFY_API
#define MPROTO_SCHANNEL_CERT_SHARE_KEY "tls:schannel:cert:share"
struct schannel_cert_share {
- unsigned char *CAinfo_blob_digest; /* CA info blob digest */
+ unsigned char CAinfo_blob_digest[CURL_SHA256_DIGEST_LENGTH];
size_t CAinfo_blob_size; /* CA info blob size */
char *CAfile; /* CAfile path used to generate
certificate store */