int
check_x509store(X509_STORE *store, X509 *cert, const char **error)
{
- int ret;
- X509_STORE_CTX verify_ctx;
- X509_STORE_CTX_init(&verify_ctx, store, cert, NULL);
- ret = X509_verify_cert(&verify_ctx);
+ X509_STORE_CTX *verify_ctx = X509_STORE_CTX_new();
+ if (verify_ctx == NULL)
+ return 0;
+
+ X509_STORE_CTX_init(verify_ctx, store, cert, NULL);
+ int ret = X509_verify_cert(verify_ctx);
if (error)
- *error = X509_verify_cert_error_string(X509_STORE_CTX_get_error(&verify_ctx));
- X509_STORE_CTX_cleanup(&verify_ctx);
+ *error = X509_verify_cert_error_string(X509_STORE_CTX_get_error(verify_ctx));
+ X509_STORE_CTX_free(verify_ctx);
return ret;
}
return 0;
}
- SSLeay_add_all_ciphers();
+ OpenSSL_add_all_ciphers();
rsa = PEM_read_RSAPrivateKey(kfile, NULL,pass_cb, NULL);
if (!rsa)