Store verify_result with sessions to avoid potential security hole.
authorLutz Jänicke <jaenicke@openssl.org>
Wed, 29 Nov 2000 16:04:38 +0000 (16:04 +0000)
committerLutz Jänicke <jaenicke@openssl.org>
Wed, 29 Nov 2000 16:04:38 +0000 (16:04 +0000)
For the server side this was already done one year ago :-(

ssl/s2_clnt.c
ssl/s3_clnt.c
ssl/ssl_sess.c

index 47dd09c..28d6d65 100644 (file)
@@ -921,6 +921,7 @@ int ssl2_set_certificate(SSL *s, int type, int len, unsigned char *data)
                goto err;
                }
        ERR_clear_error(); /* but we keep s->verify_result */
+       s->session->verify_result = s->verify_result;
 
        /* server's cert for this session */
        sc=ssl_sess_cert_new();
index 62040f9..eec45cf 100644 (file)
@@ -815,6 +815,7 @@ static int ssl3_get_server_certificate(SSL *s)
                X509_free(s->session->peer);
        CRYPTO_add(&x->references,1,CRYPTO_LOCK_X509);
        s->session->peer=x;
+       s->session->verify_result = s->verify_result;
 
        x=NULL;
        ret=1;
index 416def8..7064262 100644 (file)
@@ -508,6 +508,7 @@ int SSL_set_session(SSL *s, SSL_SESSION *session)
                if (s->session != NULL)
                        SSL_SESSION_free(s->session);
                s->session=session;
+               s->verify_result = s->session->verify_result;
                /* CRYPTO_w_unlock(CRYPTO_LOCK_SSL);*/
                ret=1;
                }