Simplify RI+SCSV logic:
authorDr. Stephen Henson <steve@openssl.org>
Thu, 7 Jan 2010 19:09:32 +0000 (19:09 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 7 Jan 2010 19:09:32 +0000 (19:09 +0000)
1. Send SCSV is not renegotiating, never empty RI.
2. Send RI if renegotiating.

ssl/ssl_lib.c
ssl/t1_lib.c

index b0bd720539d2e2e4828a40739c94d94647a3f701..231f87b30740f16cc42e8d38e737b859e70b5ab3 100644 (file)
@@ -1300,10 +1300,9 @@ int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p,
                p+=j;
                }
        /* If p == q, no ciphers and caller indicates an error. Otherwise
-        * add SCSV if no extensions (i.e. SSL3 is client_version)
-        * since spec RECOMMENDS not sending both RI and SCSV.
+        * add SCSV if not renegotiating.
         */
-       if (p != q)
+       if (p != q && !s->new_session)
                {
                static SSL_CIPHER scsv =
                        {
index 8625b57104ed03618e8812137775223b4634d362..ce24f8974682c150b06429ab1a67e239586affc4 100644 (file)
@@ -174,9 +174,10 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned cha
                ret+=size_str;
 
                }
-        
-        /* Add the renegotiation option: TODOEKR switch */
-        {
+        /* Add RI if renegotiating */
+        if (s->new_session)
+          {
           int el;
           
           if(!ssl_add_clienthello_renegotiate_ext(s, 0, &el, 0))