Add ctrl and macro so we can determine if peer support secure renegotiation.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 8 Dec 2009 13:42:32 +0000 (13:42 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 8 Dec 2009 13:42:32 +0000 (13:42 +0000)
CHANGES
apps/s_client.c
apps/s_server.c
ssl/ssl.h
ssl/ssl_lib.c

diff --git a/CHANGES b/CHANGES
index ab93ce42482676910c15ad6c838a3f9a8a5ca4b2..427444a9ce71e6d525f6028b168b7f63425ad76f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
  Changes between 0.9.8l (?) and 0.9.8m (?)  [xx XXX xxxx]
 
+  *) Add ctrl macro SSL_get_secure_renegotiation_support() which returns 1 if
+     peer supports secure renegotiation and 0 otherwise. Print out peer
+     renegotiation support in s_client/s_server.
+     [Steve Henson]
+
   *) Replace the highly broken and deprecated SPKAC certification method with
      the updated NID creation version. This should correctly handle UTF8.
      [Steve Henson]
index a4be63a1148186e631ad5f3abc95e446b7247ad3..a3db16dfb0775e87516cb49d6f4a12357ce04126 100644 (file)
@@ -1725,6 +1725,8 @@ static void print_stuff(BIO *bio, SSL *s, int full)
                                                         EVP_PKEY_bits(pktmp));
                EVP_PKEY_free(pktmp);
        }
+       BIO_printf(bio, "Secure Renegotiation IS%s supported\n",
+                       SSL_get_secure_renegotiation_support(s) ? "" : " NOT");
 #ifndef OPENSSL_NO_COMP
        comp=SSL_get_current_compression(s);
        expansion=SSL_get_current_expansion(s);
index 8a08a306959ac478b1c4520272b43e8f6ef947d3..1a06d19bb14be9ddf1af9d777012317d149dd06b 100644 (file)
@@ -2209,6 +2209,8 @@ static int init_ssl_connection(SSL *con)
                        con->kssl_ctx->client_princ);
                }
 #endif /* OPENSSL_NO_KRB5 */
+       BIO_printf(bio_s_out, "Secure Renegotiation IS%s supported\n",
+                     SSL_get_secure_renegotiation_support(con) ? "" : " NOT");
        return(1);
        }
 
index 1d82a6df62410a18e875621080bb9abd68dd4624..260403885cd96b4501d9a7f0d1e8677c0b0a79fb 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -623,6 +623,8 @@ typedef struct ssl_session_st
 #define SSL_set_mtu(ssl, mtu) \
         SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL)
 
+#define SSL_get_secure_renegotiation_support(ssl) \
+       SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL)
 
 void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
 void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
@@ -1372,6 +1374,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
 
 #define SSL_CTRL_SET_MAX_SEND_FRAGMENT         52
 
+#define SSL_CTRL_GET_RI_SUPPORT                        53
+
 /* see tls1.h for macros based on these */
 #ifndef OPENSSL_NO_TLSEXT
 #define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB      53
index f46e302f57292dc854c4b214357efa9d059c38cd..8c26e8f2205cf5873cf7347591094fa456253b8c 100644 (file)
@@ -1062,6 +1062,10 @@ long SSL_ctrl(SSL *s,int cmd,long larg,void *parg)
                        return 0;
                s->max_send_fragment = larg;
                return 1;
+       case SSL_CTRL_GET_RI_SUPPORT:
+               if (s->s3)
+                       return s->s3->send_connection_binding;
+               else return 0;
        default:
                return(s->method->ssl_ctrl(s,cmd,larg,parg));
                }