Fix BIO_CTRL_DUP for an SSL BIO
authorMatt Caswell <matt@openssl.org>
Tue, 26 Apr 2016 16:52:21 +0000 (17:52 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 27 Apr 2016 08:20:11 +0000 (09:20 +0100)
The variables in the BIO weren't being duplicated properly.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
ssl/bio_ssl.c

index e3deebc..4cbfb3c 100644 (file)
@@ -424,10 +424,11 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
         dbs = BIO_get_data(dbio);
         SSL_free(dbs->ssl);
         dbs->ssl = SSL_dup(ssl);
-        dbs->renegotiate_count = dbs->renegotiate_count;
-        dbs->byte_count = dbs->byte_count;
-        dbs->renegotiate_timeout = dbs->renegotiate_timeout;
-        dbs->last_time = dbs->last_time;
+        dbs->num_renegotiates = bs->num_renegotiates;
+        dbs->renegotiate_count = bs->renegotiate_count;
+        dbs->byte_count = bs->byte_count;
+        dbs->renegotiate_timeout = bs->renegotiate_timeout;
+        dbs->last_time = bs->last_time;
         ret = (dbs->ssl != NULL);
         break;
     case BIO_C_GET_FD: