119 static const SSL_METHOD *ssl23_get_client_method(
int ver);
120 static int ssl23_client_hello(
SSL *s);
121 static int ssl23_get_server_hello(
SSL *s);
122 static const SSL_METHOD *ssl23_get_client_method(
int ver)
124 #ifndef OPENSSL_NO_SSL2
143 ssl23_get_client_method)
148 unsigned long Time=(
unsigned long)time(NULL);
157 if (s->info_callback != NULL)
159 else if (s->ctx->info_callback != NULL)
160 cb=s->ctx->info_callback;
176 if (s->session != NULL)
188 if (s->init_buf == NULL)
209 s->ctx->stats.sess_connect++;
217 ret=ssl23_client_hello(s);
218 if (ret <= 0)
goto end;
226 ret=ssl23_get_server_hello(s);
227 if (ret >= 0)
cb=NULL;
240 if ((
cb != NULL) && (s->state != state))
257 static int ssl23_no_ssl2_ciphers(
SSL *s)
262 ciphers = SSL_get_ciphers(s);
272 static int ssl23_client_hello(
SSL *s)
277 unsigned long Time,l;
279 int version = 0, version_major, version_minor;
280 #ifndef OPENSSL_NO_COMP
285 unsigned long mask, options = s->
options;
289 if (ssl2_compat && ssl23_no_ssl2_ciphers(s))
301 #if !defined(OPENSSL_NO_SSL3)
304 #if !defined(OPENSSL_NO_SSL2)
308 #if !defined(OPENSSL_NO_TLS1_2_CLIENT)
320 #if !defined(OPENSSL_NO_SSL3)
325 #if !defined(OPENSSL_NO_SSL2)
330 #ifndef OPENSSL_NO_TLSEXT
339 #ifdef TLSEXT_TYPE_opaque_prf_input
358 Time=(
unsigned long)time(NULL);
413 *(d++) = version_major;
414 *(d++) = version_minor;
456 buf[0]=((i>>8)&0xff)|0x80;
472 *(p++) = version_major;
473 *(p++) = version_minor;
489 #ifdef OPENSSL_MAX_TLS1_2_CIPHER_LENGTH
495 && i > OPENSSL_MAX_TLS1_2_CIPHER_LENGTH)
496 i = OPENSSL_MAX_TLS1_2_CIPHER_LENGTH & ~1;
502 #ifdef OPENSSL_NO_COMP
506 || !s->
ctx->comp_methods)
519 #ifndef OPENSSL_NO_TLSEXT
551 *(d++) = version_major;
558 *(d++) = version_minor;
588 static int ssl23_get_server_hello(
SSL *s)
597 if (n != 7)
return(n);
603 (p[5] == 0x00) && (p[6] == 0x02))
605 #ifdef OPENSSL_NO_SSL2
681 !(s->
options & SSL_OP_NO_SSLv3))
695 !(s->
options & SSL_OP_NO_TLSv1))
701 !(s->
options & SSL_OP_NO_TLSv1_1))
707 !(s->
options & SSL_OP_NO_TLSv1_2))