diff options
Diffstat (limited to 'src/lib/libssl/s23_clnt.c')
-rw-r--r-- | src/lib/libssl/s23_clnt.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/lib/libssl/s23_clnt.c b/src/lib/libssl/s23_clnt.c index 5050a13ef2..b2be8340fb 100644 --- a/src/lib/libssl/s23_clnt.c +++ b/src/lib/libssl/s23_clnt.c | |||
@@ -68,7 +68,7 @@ static int ssl23_client_hello(SSL *s); | |||
68 | static int ssl23_get_server_hello(SSL *s); | 68 | static int ssl23_get_server_hello(SSL *s); |
69 | static SSL_METHOD *ssl23_get_client_method(int ver) | 69 | static SSL_METHOD *ssl23_get_client_method(int ver) |
70 | { | 70 | { |
71 | #ifndef NO_SSL2 | 71 | #ifndef OPENSSL_NO_SSL2 |
72 | if (ver == SSL2_VERSION) | 72 | if (ver == SSL2_VERSION) |
73 | return(SSLv2_client_method()); | 73 | return(SSLv2_client_method()); |
74 | #endif | 74 | #endif |
@@ -100,7 +100,7 @@ int ssl23_connect(SSL *s) | |||
100 | { | 100 | { |
101 | BUF_MEM *buf; | 101 | BUF_MEM *buf; |
102 | unsigned long Time=time(NULL); | 102 | unsigned long Time=time(NULL); |
103 | void (*cb)()=NULL; | 103 | void (*cb)(const SSL *ssl,int type,int val)=NULL; |
104 | int ret= -1; | 104 | int ret= -1; |
105 | int new_state,state; | 105 | int new_state,state; |
106 | 106 | ||
@@ -113,8 +113,8 @@ int ssl23_connect(SSL *s) | |||
113 | else if (s->ctx->info_callback != NULL) | 113 | else if (s->ctx->info_callback != NULL) |
114 | cb=s->ctx->info_callback; | 114 | cb=s->ctx->info_callback; |
115 | 115 | ||
116 | if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s); | ||
117 | s->in_handshake++; | 116 | s->in_handshake++; |
117 | if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s); | ||
118 | 118 | ||
119 | for (;;) | 119 | for (;;) |
120 | { | 120 | { |
@@ -211,6 +211,7 @@ static int ssl23_client_hello(SSL *s) | |||
211 | unsigned char *buf; | 211 | unsigned char *buf; |
212 | unsigned char *p,*d; | 212 | unsigned char *p,*d; |
213 | int i,ch_len; | 213 | int i,ch_len; |
214 | int ret; | ||
214 | 215 | ||
215 | buf=(unsigned char *)s->init_buf->data; | 216 | buf=(unsigned char *)s->init_buf->data; |
216 | if (s->state == SSL23_ST_CW_CLNT_HELLO_A) | 217 | if (s->state == SSL23_ST_CW_CLNT_HELLO_A) |
@@ -302,7 +303,11 @@ static int ssl23_client_hello(SSL *s) | |||
302 | } | 303 | } |
303 | 304 | ||
304 | /* SSL3_ST_CW_CLNT_HELLO_B */ | 305 | /* SSL3_ST_CW_CLNT_HELLO_B */ |
305 | return(ssl23_write_bytes(s)); | 306 | ret = ssl23_write_bytes(s); |
307 | if (ret >= 2) | ||
308 | if (s->msg_callback) | ||
309 | s->msg_callback(1, SSL2_VERSION, 0, s->init_buf->data+2, ret-2, s, s->msg_callback_arg); /* CLIENT-HELLO */ | ||
310 | return ret; | ||
306 | } | 311 | } |
307 | 312 | ||
308 | static int ssl23_get_server_hello(SSL *s) | 313 | static int ssl23_get_server_hello(SSL *s) |
@@ -322,7 +327,7 @@ static int ssl23_get_server_hello(SSL *s) | |||
322 | if ((p[0] & 0x80) && (p[2] == SSL2_MT_SERVER_HELLO) && | 327 | if ((p[0] & 0x80) && (p[2] == SSL2_MT_SERVER_HELLO) && |
323 | (p[5] == 0x00) && (p[6] == 0x02)) | 328 | (p[5] == 0x00) && (p[6] == 0x02)) |
324 | { | 329 | { |
325 | #ifdef NO_SSL2 | 330 | #ifdef OPENSSL_NO_SSL2 |
326 | SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL); | 331 | SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL); |
327 | goto err; | 332 | goto err; |
328 | #else | 333 | #else |
@@ -435,7 +440,7 @@ static int ssl23_get_server_hello(SSL *s) | |||
435 | (p[3] == 0) && | 440 | (p[3] == 0) && |
436 | (p[4] == 2)) | 441 | (p[4] == 2)) |
437 | { | 442 | { |
438 | void (*cb)()=NULL; | 443 | void (*cb)(const SSL *ssl,int type,int val)=NULL; |
439 | int j; | 444 | int j; |
440 | 445 | ||
441 | /* An alert */ | 446 | /* An alert */ |