Changes crypto/evp/ and ssl/ code from directly incrementing reference
[openssl.git] / ssl / ssl_cert.c
index 605e97e966d845375845d0b11b8c3cd67a2b5625..ab2e00969afeefb1d530d34d83eb89ae7a5b05d6 100644 (file)
@@ -190,8 +190,8 @@ CERT *ssl_cert_dup(CERT *cert)
 #ifndef OPENSSL_NO_RSA
        if (cert->rsa_tmp != NULL)
                {
+               RSA_up(cert->rsa_tmp);
                ret->rsa_tmp = cert->rsa_tmp;
-               CRYPTO_add(&ret->rsa_tmp->references, 1, CRYPTO_LOCK_RSA);
                }
        ret->rsa_tmp_cb = cert->rsa_tmp_cb;
 #endif
@@ -471,6 +471,9 @@ int ssl_verify_cert_chain(SSL *s,STACK_OF(X509) *sk)
 
        X509_STORE_CTX_purpose_inherit(&ctx, i, s->purpose, s->trust);
 
+       if (s->verify_callback)
+               X509_STORE_CTX_set_verify_cb(&ctx, s->verify_callback);
+
        if (s->ctx->app_verify_callback != NULL)
                i=s->ctx->app_verify_callback(&ctx); /* should pass app_verify_arg */
        else