PR: 1731 and maybe 2197
[openssl.git] / ssl / ssl_cert.c
index 2f47eaf5109bf15b65b7e39bedb7e3f1d15cfea7..27256eea8145455f5e0ec89bc23c78e8736c49b7 100644 (file)
@@ -518,9 +518,7 @@ int ssl_verify_cert_chain(SSL *s,STACK_OF(X509) *sk)
        /* Anything non-default in "param" should overwrite anything in the
         * ctx.
         */
-       if (s->param)
-               X509_VERIFY_PARAM_set1(X509_STORE_CTX_get0_param(&ctx),
-                                               s->param);
+       X509_VERIFY_PARAM_set1(X509_STORE_CTX_get0_param(&ctx), s->param);
 
        if (s->verify_callback)
                X509_STORE_CTX_set_verify_cb(&ctx, s->verify_callback);
@@ -757,6 +755,8 @@ int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
                        sk_X509_NAME_push(stack,xn);
                }
 
+       ERR_clear_error();
+
        if (0)
                {
 err: