28 #if defined(POLARSSL_SSL_CLI_C)
33 #if defined(POLARSSL_MEMORY_C)
36 #define polarssl_malloc malloc
37 #define polarssl_free free
45 typedef UINT32 uint32_t;
50 #if defined(POLARSSL_HAVE_TIME)
54 #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
55 static void ssl_write_hostname_ext(
ssl_context *ssl,
59 unsigned char *p = buf;
66 SSL_DEBUG_MSG( 3, (
"client hello, adding server name extension: %s",
90 *p++ = (
unsigned char)( ( (ssl->
hostname_len + 5) >> 8 ) & 0xFF );
91 *p++ = (
unsigned char)( ( (ssl->
hostname_len + 5) ) & 0xFF );
93 *p++ = (
unsigned char)( ( (ssl->
hostname_len + 3) >> 8 ) & 0xFF );
94 *p++ = (
unsigned char)( ( (ssl->
hostname_len + 3) ) & 0xFF );
97 *p++ = (
unsigned char)( ( ssl->
hostname_len >> 8 ) & 0xFF );
106 static void ssl_write_renegotiation_ext(
ssl_context *ssl,
110 unsigned char *p = buf;
117 SSL_DEBUG_MSG( 3, (
"client hello, adding renegotiation extension" ) );
134 #if defined(POLARSSL_SSL_PROTO_TLS1_2)
135 static void ssl_write_signature_algorithms_ext(
ssl_context *ssl,
139 unsigned char *p = buf;
140 unsigned char *sig_alg_list = buf + 6;
141 size_t sig_alg_len = 0;
148 SSL_DEBUG_MSG( 3, (
"client hello, adding signature_algorithms extension" ) );
153 #if defined(POLARSSL_RSA_C)
154 #if defined(POLARSSL_SHA512_C)
160 #if defined(POLARSSL_SHA256_C)
166 #if defined(POLARSSL_SHA1_C)
170 #if defined(POLARSSL_MD5_C)
175 #if defined(POLARSSL_ECDSA_C)
176 #if defined(POLARSSL_SHA512_C)
182 #if defined(POLARSSL_SHA256_C)
188 #if defined(POLARSSL_SHA1_C)
192 #if defined(POLARSSL_MD5_C)
218 *p++ = (
unsigned char)( ( ( sig_alg_len + 2 ) >> 8 ) & 0xFF );
219 *p++ = (
unsigned char)( ( ( sig_alg_len + 2 ) ) & 0xFF );
221 *p++ = (
unsigned char)( ( sig_alg_len >> 8 ) & 0xFF );
222 *p++ = (
unsigned char)( ( sig_alg_len ) & 0xFF );
224 *olen = 6 + sig_alg_len;
228 #if defined(POLARSSL_ECDH_C) || defined(POLARSSL_ECDSA_C)
229 static void ssl_write_supported_elliptic_curves_ext(
ssl_context *ssl,
233 unsigned char *p = buf;
234 unsigned char elliptic_curve_list[20];
235 size_t elliptic_curve_len = 0;
241 SSL_DEBUG_MSG( 3, (
"client hello, adding supported_elliptic_curves extension" ) );
247 elliptic_curve_list[elliptic_curve_len++] = curve->
tls_id >> 8;
248 elliptic_curve_list[elliptic_curve_len++] = curve->
tls_id & 0xFF;
251 if( elliptic_curve_len == 0 )
257 *p++ = (
unsigned char)( ( ( elliptic_curve_len + 2 ) >> 8 ) & 0xFF );
258 *p++ = (
unsigned char)( ( ( elliptic_curve_len + 2 ) ) & 0xFF );
260 *p++ = (
unsigned char)( ( ( elliptic_curve_len ) >> 8 ) & 0xFF );
261 *p++ = (
unsigned char)( ( ( elliptic_curve_len ) ) & 0xFF );
263 memcpy( p, elliptic_curve_list, elliptic_curve_len );
265 *olen = 6 + elliptic_curve_len;
268 static void ssl_write_supported_point_formats_ext(
ssl_context *ssl,
272 unsigned char *p = buf;
277 SSL_DEBUG_MSG( 3, (
"client hello, adding supported_point_formats extension" ) );
292 #if defined(POLARSSL_SSL_MAX_FRAGMENT_LENGTH)
293 static void ssl_write_max_fragment_length_ext(
ssl_context *ssl,
297 unsigned char *p = buf;
304 SSL_DEBUG_MSG( 3, (
"client hello, adding max_fragment_length extension" ) );
318 #if defined(POLARSSL_SSL_TRUNCATED_HMAC)
319 static void ssl_write_truncated_hmac_ext(
ssl_context *ssl,
320 unsigned char *buf,
size_t *olen )
322 unsigned char *p = buf;
330 SSL_DEBUG_MSG( 3, (
"client hello, adding truncated_hmac extension" ) );
342 #if defined(POLARSSL_SSL_SESSION_TICKETS)
343 static void ssl_write_session_ticket_ext(
ssl_context *ssl,
344 unsigned char *buf,
size_t *olen )
346 unsigned char *p = buf;
355 SSL_DEBUG_MSG( 3, (
"client hello, adding session ticket extension" ) );
360 *p++ = (
unsigned char)( ( tlen >> 8 ) & 0xFF );
361 *p++ = (
unsigned char)( ( tlen ) & 0xFF );
371 SSL_DEBUG_MSG( 3, (
"sending session ticket of length %d", tlen ) );
379 static int ssl_write_client_hello(
ssl_context *ssl )
382 size_t i, n, olen, ext_len = 0;
384 unsigned char *p, *q;
385 #if defined(POLARSSL_HAVE_TIME)
388 const int *ciphersuites;
421 #if defined(POLARSSL_HAVE_TIME)
423 *p++ = (
unsigned char)( t >> 24 );
424 *p++ = (
unsigned char)( t >> 16 );
425 *p++ = (
unsigned char)( t >> 8 );
426 *p++ = (
unsigned char)( t );
428 SSL_DEBUG_MSG( 3, (
"client hello, current time: %lu", t ) );
430 if( ( ret = ssl->
f_rng( ssl->
p_rng, p, 4 ) ) != 0 )
436 if( ( ret = ssl->
f_rng( ssl->
p_rng, p, 28 ) ) != 0 )
443 SSL_DEBUG_BUF( 3,
"client hello, random bytes", buf + 6, 32 );
463 #if defined(POLARSSL_SSL_SESSION_TICKETS)
481 *p++ = (
unsigned char) n;
483 for( i = 0; i < n; i++ )
486 SSL_DEBUG_MSG( 3, (
"client hello, session id len.: %d", n ) );
506 for( i = 0; ciphersuites[i] != 0; i++ )
510 if( ciphersuite_info == NULL )
521 *p++ = (
unsigned char)( ciphersuites[i] >> 8 );
522 *p++ = (
unsigned char)( ciphersuites[i] );
525 *q++ = (
unsigned char)( n >> 7 );
526 *q++ = (
unsigned char)( n << 1 );
528 SSL_DEBUG_MSG( 3, (
"client hello, got %d ciphersuites", n ) );
531 #if defined(POLARSSL_ZLIB_SUPPORT)
532 SSL_DEBUG_MSG( 3, (
"client hello, compress len.: %d", 2 ) );
540 SSL_DEBUG_MSG( 3, (
"client hello, compress len.: %d", 1 ) );
549 #if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
550 ssl_write_hostname_ext( ssl, p + 2 + ext_len, &olen );
554 ssl_write_renegotiation_ext( ssl, p + 2 + ext_len, &olen );
557 #if defined(POLARSSL_SSL_PROTO_TLS1_2)
558 ssl_write_signature_algorithms_ext( ssl, p + 2 + ext_len, &olen );
562 #if defined(POLARSSL_ECDH_C) || defined(POLARSSL_ECDSA_C)
563 ssl_write_supported_elliptic_curves_ext( ssl, p + 2 + ext_len, &olen );
566 ssl_write_supported_point_formats_ext( ssl, p + 2 + ext_len, &olen );
570 #if defined(POLARSSL_SSL_MAX_FRAGMENT_LENGTH)
571 ssl_write_max_fragment_length_ext( ssl, p + 2 + ext_len, &olen );
575 #if defined(POLARSSL_SSL_TRUNCATED_HMAC)
576 ssl_write_truncated_hmac_ext( ssl, p + 2 + ext_len, &olen );
580 #if defined(POLARSSL_SSL_SESSION_TICKETS)
581 ssl_write_session_ticket_ext( ssl, p + 2 + ext_len, &olen );
585 SSL_DEBUG_MSG( 3, (
"client hello, total extension length: %d",
588 *p++ = (
unsigned char)( ( ext_len >> 8 ) & 0xFF );
589 *p++ = (
unsigned char)( ( ext_len ) & 0xFF );
609 static int ssl_parse_renegotiation_info(
ssl_context *ssl,
610 const unsigned char *buf,
617 if( len != 1 || buf[0] != 0x0 )
619 SSL_DEBUG_MSG( 1, (
"non-zero length renegotiated connection field" ) );
637 SSL_DEBUG_MSG( 1, (
"non-matching renegotiated connection field" ) );
649 #if defined(POLARSSL_SSL_MAX_FRAGMENT_LENGTH)
650 static int ssl_parse_max_fragment_length_ext(
ssl_context *ssl,
651 const unsigned char *buf,
669 #if defined(POLARSSL_SSL_TRUNCATED_HMAC)
670 static int ssl_parse_truncated_hmac_ext(
ssl_context *ssl,
671 const unsigned char *buf,
688 #if defined(POLARSSL_SSL_SESSION_TICKETS)
689 static int ssl_parse_session_ticket_ext(
ssl_context *ssl,
690 const unsigned char *buf,
707 #if defined(POLARSSL_ECDH_C) || defined(POLARSSL_ECDSA_C)
708 static int ssl_parse_supported_point_formats_ext(
ssl_context *ssl,
709 const unsigned char *buf,
713 const unsigned char *p;
716 if( list_size + 1 != len )
723 while( list_size > 0 )
741 static int ssl_parse_server_hello(
ssl_context *ssl )
746 unsigned char *buf, *ext;
747 int renegotiation_info_seen = 0;
748 int handshake_failure = 0;
749 #if defined(POLARSSL_DEBUG_C)
797 SSL_DEBUG_MSG( 1, (
"server only supports ssl smaller than minimum"
807 #if defined(POLARSSL_DEBUG_C)
808 t = ( (uint32_t) buf[6] << 24 )
809 | ( (uint32_t) buf[7] << 16 )
810 | ( (uint32_t) buf[8] << 8 )
811 | ( (uint32_t) buf[9] );
812 SSL_DEBUG_MSG( 3, (
"server hello, current time: %lu", t ) );
819 SSL_DEBUG_BUF( 3,
"server hello, random bytes", buf + 6, 32 );
837 ext_len = ( ( buf[42 + n] << 8 )
840 if( ( ext_len > 0 && ext_len < 4 ) ||
848 i = ( buf[39 + n] << 8 ) | buf[40 + n];
864 SSL_DEBUG_MSG( 3, (
"server hello, session id len.: %d", n ) );
879 #if defined(POLARSSL_HAVE_TIME)
901 SSL_DEBUG_MSG( 3, (
"server hello, chosen ciphersuite: %d", i ) );
902 SSL_DEBUG_MSG( 3, (
"server hello, compress alg.: %d", buf[41 + n] ) );
921 #
if defined(POLARSSL_ZLIB_SUPPORT)
933 SSL_DEBUG_MSG( 2, (
"server hello, total extension length: %d", ext_len ) );
937 unsigned int ext_id = ( ( ext[0] << 8 )
939 unsigned int ext_size = ( ( ext[2] << 8 )
942 if( ext_size + 4 > ext_len )
952 renegotiation_info_seen = 1;
954 if( ( ret = ssl_parse_renegotiation_info( ssl, ext + 4, ext_size ) ) != 0 )
959 #if defined(POLARSSL_SSL_MAX_FRAGMENT_LENGTH)
961 SSL_DEBUG_MSG( 3, (
"found max_fragment_length extension" ) );
963 if( ( ret = ssl_parse_max_fragment_length_ext( ssl,
964 ext + 4, ext_size ) ) != 0 )
972 #if defined(POLARSSL_SSL_TRUNCATED_HMAC)
976 if( ( ret = ssl_parse_truncated_hmac_ext( ssl,
977 ext + 4, ext_size ) ) != 0 )
985 #if defined(POLARSSL_SSL_SESSION_TICKETS)
989 if( ( ret = ssl_parse_session_ticket_ext( ssl,
990 ext + 4, ext_size ) ) != 0 )
998 #if defined(POLARSSL_ECDH_C) || defined(POLARSSL_ECDSA_C)
1000 SSL_DEBUG_MSG( 3, (
"found supported_point_formats extension" ) );
1002 if( ( ret = ssl_parse_supported_point_formats_ext( ssl,
1003 ext + 4, ext_size ) ) != 0 )
1012 SSL_DEBUG_MSG( 3, (
"unknown extension found: %d (ignoring)",
1016 ext_len -= 4 + ext_size;
1017 ext += 4 + ext_size;
1019 if( ext_len > 0 && ext_len < 4 )
1032 SSL_DEBUG_MSG( 1, (
"legacy renegotiation, breaking off handshake" ) );
1033 handshake_failure = 1;
1037 renegotiation_info_seen == 0 )
1039 SSL_DEBUG_MSG( 1, (
"renegotiation_info extension missing (secure)" ) );
1040 handshake_failure = 1;
1047 handshake_failure = 1;
1051 renegotiation_info_seen == 1 )
1053 SSL_DEBUG_MSG( 1, (
"renegotiation_info extension present (legacy)" ) );
1054 handshake_failure = 1;
1057 if( handshake_failure == 1 )
1070 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
1071 defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED)
1072 static int ssl_parse_server_dh_params(
ssl_context *ssl,
unsigned char **p,
1073 unsigned char *end )
1095 SSL_DEBUG_MSG( 1, (
"bad server key exchange message (DHM length)" ) );
1108 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
1109 defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \
1110 defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
1111 static int ssl_parse_server_ecdh_params(
ssl_context *ssl,
1113 unsigned char *end )
1126 (
const unsigned char **) p, end ) ) != 0 )
1138 SSL_DEBUG_MSG( 1, (
"bad server key exchange message (ECDH length)" ) );
1150 #if defined(POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED)
1151 static int ssl_parse_server_psk_hint(
ssl_context *ssl,
1153 unsigned char *end )
1164 len = (*p)[0] << 8 | (*p)[1];
1167 if( (*p) + len > end )
1169 SSL_DEBUG_MSG( 1, (
"bad server key exchange message (psk_identity_hint length)" ) );
1182 #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) || \
1183 defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED)
1187 static int ssl_write_encrypted_pms(
ssl_context *ssl,
1188 size_t offset,
size_t *olen,
1205 if( ( ret = ssl->
f_rng( ssl->
p_rng, p + 2, 46 ) ) != 0 )
1225 ssl->
out_msg + offset + len_bytes, olen,
1233 #if defined(POLARSSL_SSL_PROTO_TLS1) || defined(POLARSSL_SSL_PROTO_TLS1_1) || \
1234 defined(POLARSSL_SSL_PROTO_TLS1_2)
1235 if( len_bytes == 2 )
1237 ssl->
out_msg[offset+0] = (
unsigned char)( *olen >> 8 );
1238 ssl->
out_msg[offset+1] = (
unsigned char)( *olen );
1248 #if defined(POLARSSL_SSL_PROTO_TLS1_2)
1249 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
1250 defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
1251 defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
1252 static int ssl_parse_signature_algorithm(
ssl_context *ssl,
1268 if( (*p) + 2 > end )
1277 "HashAlgorithm %d", *(p)[0] ) );
1287 "SignatureAlgorithm %d", (*p)[1] ) );
1291 SSL_DEBUG_MSG( 2, (
"Server used SignatureAlgorithm %d", (*p)[1] ) );
1292 SSL_DEBUG_MSG( 2, (
"Server used HashAlgorithm %d", (*p)[0] ) );
1302 static int ssl_parse_server_key_exchange(
ssl_context *ssl )
1306 unsigned char *p, *end;
1307 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
1308 defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
1309 defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
1310 size_t sig_len, params_len;
1311 unsigned char hash[64];
1319 #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED)
1322 SSL_DEBUG_MSG( 2, (
"<= skip parse server key exchange" ) );
1363 #if defined(POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED)
1369 if( ssl_parse_server_psk_hint( ssl, &p, end ) != 0 )
1377 #if defined(POLARSSL_KEY_EXCHANGE_PSK_ENABLED) || \
1378 defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED)
1385 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
1386 defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED)
1390 if( ssl_parse_server_dh_params( ssl, &p, end ) != 0 )
1399 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
1400 defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \
1401 defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
1406 if( ssl_parse_server_ecdh_params( ssl, &p, end ) != 0 )
1421 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) || \
1422 defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
1423 defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
1428 params_len = p - ( ssl->
in_msg + 4 );
1433 #if defined(POLARSSL_SSL_PROTO_TLS1_2)
1436 if( ssl_parse_signature_algorithm( ssl, &p, end,
1437 &md_alg, &pk_alg ) != 0 )
1451 #if defined(POLARSSL_SSL_PROTO_SSL3) || defined(POLARSSL_SSL_PROTO_TLS1) || \
1452 defined(POLARSSL_SSL_PROTO_TLS1_1)
1471 sig_len = ( p[0] << 8 ) | p[1];
1474 if( end != p + sig_len )
1485 #if defined(POLARSSL_SSL_PROTO_SSL3) || defined(POLARSSL_SSL_PROTO_TLS1) || \
1486 defined(POLARSSL_SSL_PROTO_TLS1_1)
1520 #if defined(POLARSSL_SSL_PROTO_TLS1) || defined(POLARSSL_SSL_PROTO_TLS1_1) || \
1521 defined(POLARSSL_SSL_PROTO_TLS1_2)
1556 SSL_DEBUG_BUF( 3,
"parameters hash", hash, hashlen != 0 ? hashlen :
1569 md_alg, hash, hashlen, p, sig_len ) ) != 0 )
1587 static int ssl_parse_certificate_request(
ssl_context *ssl )
1590 unsigned char *buf, *p;
1591 size_t n = 0, m = 0;
1592 size_t cert_type_len = 0, dn_len = 0;
1646 cert_type_len = buf[4];
1656 while( cert_type_len > 0 )
1658 #if defined(POLARSSL_RSA_C)
1667 #if defined(POLARSSL_ECDSA_C)
1684 #if defined(POLARSSL_SSL_PROTO_TLS1_2)
1689 size_t sig_alg_len = ( ( buf[5 + n] << 8 )
1706 dn_len = ( ( buf[5 + m + n] << 8 )
1707 | ( buf[6 + m + n] ) );
1722 static int ssl_parse_server_hello_done(
ssl_context *ssl )
1758 static int ssl_write_client_key_exchange(
ssl_context *ssl )
1766 #if defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED)
1774 ssl->
out_msg[4] = (
unsigned char)( n >> 8 );
1775 ssl->
out_msg[5] = (
unsigned char)( n );
1806 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \
1807 defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
1843 #if defined(POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED)
1857 ssl->
out_msg[i++] = (
unsigned char)( n >> 8 );
1858 ssl->
out_msg[i++] = (
unsigned char)( n );
1863 #if defined(POLARSSL_KEY_EXCHANGE_PSK_ENABLED)
1870 #if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED)
1873 if( ( ret = ssl_write_encrypted_pms( ssl, i, &n, 2 ) ) != 0 )
1878 #if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED)
1885 ssl->
out_msg[i++] = (
unsigned char)( n >> 8 );
1886 ssl->
out_msg[i++] = (
unsigned char)( n );
1900 #if defined(POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
1933 #if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED)
1937 if( ( ret = ssl_write_encrypted_pms( ssl, i, &n, 0 ) ) != 0 )
1943 ((void) ciphersuite_info);
1971 #if !defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
1972 !defined(POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED) && \
1973 !defined(POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \
1974 !defined(POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
1975 static int ssl_write_certificate_verify(
ssl_context *ssl )
1995 static int ssl_write_certificate_verify(
ssl_context *ssl )
1999 size_t n = 0, offset = 0;
2000 unsigned char hash[48];
2001 unsigned char *hash_start = hash;
2003 unsigned int hashlen;
2034 #if defined(POLARSSL_SSL_PROTO_SSL3) || defined(POLARSSL_SSL_PROTO_TLS1) || \
2035 defined(POLARSSL_SSL_PROTO_TLS1_1)
2066 #if defined(POLARSSL_SSL_PROTO_TLS1_2)
2109 ssl->
out_msg + 6 + offset, &n,
2116 ssl->
out_msg[4 + offset] = (
unsigned char)( n >> 8 );
2117 ssl->
out_msg[5 + offset] = (
unsigned char)( n );
2139 #if defined(POLARSSL_SSL_SESSION_TICKETS)
2140 static int ssl_parse_new_session_ticket(
ssl_context *ssl )
2145 unsigned char *ticket;
2180 lifetime = ( ssl->
in_msg[4] << 24 ) | ( ssl->
in_msg[5] << 16 ) |
2183 ticket_len = ( ssl->
in_msg[8] << 8 ) | ( ssl->
in_msg[9] );
2185 if( ticket_len + 10 != ssl->
in_hslen )
2200 if( ticket_len == 0)
2213 memcpy( ticket, ssl->
in_msg + 10, ticket_len );
2224 SSL_DEBUG_MSG( 3, (
"ticket in use, discarding session id" ) );
2248 switch( ssl->
state )
2258 ret = ssl_write_client_hello( ssl );
2269 ret = ssl_parse_server_hello( ssl );
2277 ret = ssl_parse_server_key_exchange( ssl );
2281 ret = ssl_parse_certificate_request( ssl );
2285 ret = ssl_parse_server_hello_done( ssl );
2300 ret = ssl_write_client_key_exchange( ssl );
2304 ret = ssl_write_certificate_verify( ssl );
2321 #if defined(POLARSSL_SSL_SESSION_TICKETS)
2323 ret = ssl_parse_new_session_ticket( ssl );