Fold num_renegotiations into total_renegotiations.

The only difference is SSL_clear_num_renegotiations which is never
called.

Change-Id: Id661c71e89d34d834349ad1f1a296e332606e6cc
Reviewed-on: https://boringssl-review.googlesource.com/4564
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index 560cd5c..90443bf 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -1581,7 +1581,6 @@
 #define SSL_CTRL_GET_SESSION_REUSED 8
 #define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9
 #define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10
-#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
 #define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
 #define SSL_CTRL_GET_FLAGS 13
 #define SSL_CTRL_EXTRA_CHAIN_CERT 14
@@ -1652,8 +1651,6 @@
   SSL_ctrl((ssl), SSL_CTRL_GET_SESSION_REUSED, 0, NULL)
 #define SSL_num_renegotiations(ssl) \
   SSL_ctrl((ssl), SSL_CTRL_GET_NUM_RENEGOTIATIONS, 0, NULL)
-#define SSL_clear_num_renegotiations(ssl) \
-  SSL_ctrl((ssl), SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS, 0, NULL)
 #define SSL_total_renegotiations(ssl) \
   SSL_ctrl((ssl), SSL_CTRL_GET_TOTAL_RENEGOTIATIONS, 0, NULL)
 
diff --git a/include/openssl/ssl3.h b/include/openssl/ssl3.h
index 09705e1..96f00cf 100644
--- a/include/openssl/ssl3.h
+++ b/include/openssl/ssl3.h
@@ -409,7 +409,6 @@
    * no more data in the read or write buffers */
   int renegotiate;
   int total_renegotiations;
-  int num_renegotiations;
 
   /* State pertaining to the pending handshake.
    *
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index e481b12..dbd0eb5 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -589,14 +589,6 @@
       break;
 
     case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
-      ret = s->s3->num_renegotiations;
-      break;
-
-    case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
-      ret = s->s3->num_renegotiations;
-      s->s3->num_renegotiations = 0;
-      break;
-
     case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
       ret = s->s3->total_renegotiations;
       break;
@@ -1249,7 +1241,6 @@
      * need to go to SSL_ST_ACCEPT. */
     s->state = SSL_ST_RENEGOTIATE;
     s->s3->renegotiate = 0;
-    s->s3->num_renegotiations++;
     s->s3->total_renegotiations++;
     return 1;
   }