Updated indentation in the patch to match style used elsewhere in OpenSSL
This commit is contained in:
parent
efd59c96d7
commit
d13c05cafb
1 changed files with 68 additions and 63 deletions
|
@ -6,11 +6,11 @@ This is based on the patch from Alexey Kobozev <akobozev@cisco.com>
|
|||
|
||||
|
||||
|
||||
Index: openssl-SNAP-20080928/ssl/s3_clnt.c
|
||||
Index: openssl-SNAP-20081111/ssl/s3_clnt.c
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/ssl/s3_clnt.c
|
||||
+++ openssl-SNAP-20080928/ssl/s3_clnt.c
|
||||
@@ -788,6 +788,20 @@ int ssl3_get_server_hello(SSL *s)
|
||||
--- openssl-SNAP-20081111.orig/ssl/s3_clnt.c
|
||||
+++ openssl-SNAP-20081111/ssl/s3_clnt.c
|
||||
@@ -788,6 +788,23 @@ int ssl3_get_server_hello(SSL *s)
|
||||
goto f_err;
|
||||
}
|
||||
|
||||
|
@ -20,10 +20,13 @@ Index: openssl-SNAP-20080928/ssl/s3_clnt.c
|
|||
+ {
|
||||
+ SSL_CIPHER *pref_cipher=NULL;
|
||||
+ s->session->master_key_length=sizeof(s->session->master_key);
|
||||
+ if (s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length,
|
||||
+ NULL, &pref_cipher, s->tls_session_secret_cb_arg))
|
||||
+ if (s->tls_session_secret_cb(s, s->session->master_key,
|
||||
+ &s->session->master_key_length,
|
||||
+ NULL, &pref_cipher,
|
||||
+ s->tls_session_secret_cb_arg))
|
||||
+ {
|
||||
+ s->session->cipher=pref_cipher ? pref_cipher : ssl_get_cipher_by_char(s,p+j);
|
||||
+ s->session->cipher = pref_cipher ?
|
||||
+ pref_cipher : ssl_get_cipher_by_char(s, p+j);
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* OPENSSL_NO_TLSEXT */
|
||||
|
@ -31,7 +34,7 @@ Index: openssl-SNAP-20080928/ssl/s3_clnt.c
|
|||
if (j != 0 && j == s->session->session_id_length
|
||||
&& memcmp(p,s->session->session_id,j) == 0)
|
||||
{
|
||||
@@ -2927,11 +2941,8 @@ static int ssl3_check_finished(SSL *s)
|
||||
@@ -2927,11 +2944,8 @@ static int ssl3_check_finished(SSL *s)
|
||||
{
|
||||
int ok;
|
||||
long n;
|
||||
|
@ -45,10 +48,10 @@ Index: openssl-SNAP-20080928/ssl/s3_clnt.c
|
|||
return 1;
|
||||
/* this function is called when we really expect a Certificate
|
||||
* message, so permit appropriate message length */
|
||||
Index: openssl-SNAP-20080928/ssl/s3_srvr.c
|
||||
Index: openssl-SNAP-20081111/ssl/s3_srvr.c
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/ssl/s3_srvr.c
|
||||
+++ openssl-SNAP-20080928/ssl/s3_srvr.c
|
||||
--- openssl-SNAP-20081111.orig/ssl/s3_srvr.c
|
||||
+++ openssl-SNAP-20081111/ssl/s3_srvr.c
|
||||
@@ -1010,6 +1010,59 @@ int ssl3_get_client_hello(SSL *s)
|
||||
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO,SSL_R_CLIENTHELLO_TLSEXT);
|
||||
goto err;
|
||||
|
@ -133,10 +136,10 @@ Index: openssl-SNAP-20080928/ssl/s3_srvr.c
|
|||
/* Do the message type and length last */
|
||||
d=p= &(buf[4]);
|
||||
|
||||
Index: openssl-SNAP-20080928/ssl/ssl_err.c
|
||||
Index: openssl-SNAP-20081111/ssl/ssl_err.c
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/ssl/ssl_err.c
|
||||
+++ openssl-SNAP-20080928/ssl/ssl_err.c
|
||||
--- openssl-SNAP-20081111.orig/ssl/ssl_err.c
|
||||
+++ openssl-SNAP-20081111/ssl/ssl_err.c
|
||||
@@ -263,6 +263,7 @@ static ERR_STRING_DATA SSL_str_functs[]=
|
||||
{ERR_FUNC(SSL_F_TLS1_PRF), "tls1_prf"},
|
||||
{ERR_FUNC(SSL_F_TLS1_SETUP_KEY_BLOCK), "TLS1_SETUP_KEY_BLOCK"},
|
||||
|
@ -145,10 +148,10 @@ Index: openssl-SNAP-20080928/ssl/ssl_err.c
|
|||
{0,NULL}
|
||||
};
|
||||
|
||||
Index: openssl-SNAP-20080928/ssl/ssl.h
|
||||
Index: openssl-SNAP-20081111/ssl/ssl.h
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/ssl/ssl.h
|
||||
+++ openssl-SNAP-20080928/ssl/ssl.h
|
||||
--- openssl-SNAP-20081111.orig/ssl/ssl.h
|
||||
+++ openssl-SNAP-20081111/ssl/ssl.h
|
||||
@@ -355,6 +355,7 @@ extern "C" {
|
||||
* 'struct ssl_st *' function parameters used to prototype callbacks
|
||||
* in SSL_CTX. */
|
||||
|
@ -201,36 +204,36 @@ Index: openssl-SNAP-20080928/ssl/ssl.h
|
|||
|
||||
/* Reason codes. */
|
||||
#define SSL_R_APP_DATA_IN_HANDSHAKE 100
|
||||
Index: openssl-SNAP-20080928/ssl/ssl_sess.c
|
||||
Index: openssl-SNAP-20081111/ssl/ssl_sess.c
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/ssl/ssl_sess.c
|
||||
+++ openssl-SNAP-20080928/ssl/ssl_sess.c
|
||||
@@ -834,6 +834,52 @@ long SSL_CTX_get_timeout(const SSL_CTX *
|
||||
--- openssl-SNAP-20081111.orig/ssl/ssl_sess.c
|
||||
+++ openssl-SNAP-20081111/ssl/ssl_sess.c
|
||||
@@ -834,6 +834,54 @@ long SSL_CTX_get_timeout(const SSL_CTX *
|
||||
return(s->session_timeout);
|
||||
}
|
||||
|
||||
+#ifndef OPENSSL_NO_TLSEXT
|
||||
+int SSL_set_session_secret_cb(SSL *s, int (*tls_session_secret_cb)(SSL *s, void *secret, int *secret_len,
|
||||
+ STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg), void *arg)
|
||||
+{
|
||||
+ {
|
||||
+ if (s == NULL) return(0);
|
||||
+ s->tls_session_secret_cb = tls_session_secret_cb;
|
||||
+ s->tls_session_secret_cb_arg = arg;
|
||||
+ return(1);
|
||||
+}
|
||||
+ }
|
||||
+
|
||||
+int SSL_set_hello_extension(SSL *s, int ext_type, void *ext_data, int ext_len)
|
||||
+{
|
||||
+ if(s->version >= TLS1_VERSION)
|
||||
+ {
|
||||
+ if(s->tls_extension)
|
||||
+ if (s->version >= TLS1_VERSION)
|
||||
+ {
|
||||
+ if (s->tls_extension)
|
||||
+ {
|
||||
+ OPENSSL_free(s->tls_extension);
|
||||
+ s->tls_extension = NULL;
|
||||
+ }
|
||||
+
|
||||
+ s->tls_extension = OPENSSL_malloc(sizeof(TLS_EXTENSION) + ext_len);
|
||||
+ if(!s->tls_extension)
|
||||
+ if (!s->tls_extension)
|
||||
+ {
|
||||
+ SSLerr(SSL_F_SSL_SET_HELLO_EXTENSION, ERR_R_MALLOC_FAILURE);
|
||||
+ return 0;
|
||||
|
@ -238,12 +241,14 @@ Index: openssl-SNAP-20080928/ssl/ssl_sess.c
|
|||
+
|
||||
+ s->tls_extension->type = ext_type;
|
||||
+
|
||||
+ if(ext_data)
|
||||
+ if (ext_data)
|
||||
+ {
|
||||
+ s->tls_extension->length = ext_len;
|
||||
+ s->tls_extension->data = s->tls_extension + 1;
|
||||
+ memcpy(s->tls_extension->data, ext_data, ext_len);
|
||||
+ } else {
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ s->tls_extension->length = 0;
|
||||
+ s->tls_extension->data = NULL;
|
||||
+ }
|
||||
|
@ -252,26 +257,26 @@ Index: openssl-SNAP-20080928/ssl/ssl_sess.c
|
|||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+ }
|
||||
+#endif /* OPENSSL_NO_TLSEXT */
|
||||
+
|
||||
typedef struct timeout_param_st
|
||||
{
|
||||
SSL_CTX *ctx;
|
||||
Index: openssl-SNAP-20080928/ssl/t1_lib.c
|
||||
Index: openssl-SNAP-20081111/ssl/t1_lib.c
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/ssl/t1_lib.c
|
||||
+++ openssl-SNAP-20080928/ssl/t1_lib.c
|
||||
--- openssl-SNAP-20081111.orig/ssl/t1_lib.c
|
||||
+++ openssl-SNAP-20081111/ssl/t1_lib.c
|
||||
@@ -154,6 +154,12 @@ int tls1_new(SSL *s)
|
||||
|
||||
void tls1_free(SSL *s)
|
||||
{
|
||||
+#ifndef OPENSSL_NO_TLSEXT
|
||||
+ if(s->tls_extension)
|
||||
+ if (s->tls_extension)
|
||||
+ {
|
||||
+ OPENSSL_free(s->tls_extension);
|
||||
+ }
|
||||
+#endif
|
||||
+#endif /* OPENSSL_NO_TLSEXT */
|
||||
ssl3_free(s);
|
||||
}
|
||||
|
||||
|
@ -324,29 +329,29 @@ Index: openssl-SNAP-20080928/ssl/t1_lib.c
|
|||
return tls_decrypt_ticket(s, p, size, session_id, len,
|
||||
ret);
|
||||
}
|
||||
Index: openssl-SNAP-20080928/ssl/tls1.h
|
||||
Index: openssl-SNAP-20081111/ssl/tls1.h
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/ssl/tls1.h
|
||||
+++ openssl-SNAP-20080928/ssl/tls1.h
|
||||
--- openssl-SNAP-20081111.orig/ssl/tls1.h
|
||||
+++ openssl-SNAP-20081111/ssl/tls1.h
|
||||
@@ -512,6 +512,14 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_T
|
||||
#define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" /*master secret*/
|
||||
#endif
|
||||
|
||||
+/* TLS extension struct */
|
||||
+struct tls_extension_st
|
||||
+{
|
||||
+ {
|
||||
+ unsigned short type;
|
||||
+ unsigned short length;
|
||||
+ void *data;
|
||||
+};
|
||||
+ };
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Index: openssl-SNAP-20080928/util/ssleay.num
|
||||
Index: openssl-SNAP-20081111/util/ssleay.num
|
||||
===================================================================
|
||||
--- openssl-SNAP-20080928.orig/util/ssleay.num
|
||||
+++ openssl-SNAP-20080928/util/ssleay.num
|
||||
--- openssl-SNAP-20081111.orig/util/ssleay.num
|
||||
+++ openssl-SNAP-20081111/util/ssleay.num
|
||||
@@ -254,3 +254,5 @@ PEM_read_bio_SSL_SESSION
|
||||
SSL_CTX_set_psk_server_callback 303 EXIST::FUNCTION:PSK
|
||||
SSL_get_psk_identity 304 EXIST::FUNCTION:PSK
|
||||
|
|
Loading…
Reference in a new issue