Lines Matching refs:p

53     volatile unsigned char *p = v; while( n-- ) *p++ = 0;  in mbedtls_zeroize()  local
62 unsigned char *p = buf; in ssl_write_hostname_ext() local
76 if( end < p || (size_t)( end - p ) < hostname_len + 9 ) in ssl_write_hostname_ext()
100 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SERVERNAME >> 8 ) & 0xFF ); in ssl_write_hostname_ext()
101 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SERVERNAME ) & 0xFF ); in ssl_write_hostname_ext()
103 *p++ = (unsigned char)( ( (hostname_len + 5) >> 8 ) & 0xFF ); in ssl_write_hostname_ext()
104 *p++ = (unsigned char)( ( (hostname_len + 5) ) & 0xFF ); in ssl_write_hostname_ext()
106 *p++ = (unsigned char)( ( (hostname_len + 3) >> 8 ) & 0xFF ); in ssl_write_hostname_ext()
107 *p++ = (unsigned char)( ( (hostname_len + 3) ) & 0xFF ); in ssl_write_hostname_ext()
109 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME ) & 0xFF ); in ssl_write_hostname_ext()
110 *p++ = (unsigned char)( ( hostname_len >> 8 ) & 0xFF ); in ssl_write_hostname_ext()
111 *p++ = (unsigned char)( ( hostname_len ) & 0xFF ); in ssl_write_hostname_ext()
113 memcpy( p, ssl->hostname, hostname_len ); in ssl_write_hostname_ext()
124 unsigned char *p = buf; in ssl_write_renegotiation_ext() local
134 if( end < p || (size_t)( end - p ) < 5 + ssl->verify_data_len ) in ssl_write_renegotiation_ext()
143 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_RENEGOTIATION_INFO >> 8 ) & 0xFF ); in ssl_write_renegotiation_ext()
144 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_RENEGOTIATION_INFO ) & 0xFF ); in ssl_write_renegotiation_ext()
146 *p++ = 0x00; in ssl_write_renegotiation_ext()
147 *p++ = ( ssl->verify_data_len + 1 ) & 0xFF; in ssl_write_renegotiation_ext()
148 *p++ = ssl->verify_data_len & 0xFF; in ssl_write_renegotiation_ext()
150 memcpy( p, ssl->own_verify_data, ssl->verify_data_len ); in ssl_write_renegotiation_ext()
165 unsigned char *p = buf; in ssl_write_signature_algorithms_ext() local
190 if( end < p || (size_t)( end - p ) < sig_alg_len + 6 ) in ssl_write_signature_algorithms_ext()
230 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SIG_ALG >> 8 ) & 0xFF ); in ssl_write_signature_algorithms_ext()
231 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SIG_ALG ) & 0xFF ); in ssl_write_signature_algorithms_ext()
233 *p++ = (unsigned char)( ( ( sig_alg_len + 2 ) >> 8 ) & 0xFF ); in ssl_write_signature_algorithms_ext()
234 *p++ = (unsigned char)( ( ( sig_alg_len + 2 ) ) & 0xFF ); in ssl_write_signature_algorithms_ext()
236 *p++ = (unsigned char)( ( sig_alg_len >> 8 ) & 0xFF ); in ssl_write_signature_algorithms_ext()
237 *p++ = (unsigned char)( ( sig_alg_len ) & 0xFF ); in ssl_write_signature_algorithms_ext()
250 unsigned char *p = buf; local
252 unsigned char *elliptic_curve_list = p + 6;
282 if( end < p || (size_t)( end - p ) < 6 + elliptic_curve_len )
305 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES >> 8 ) & 0xFF );
306 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES ) & 0xFF );
308 *p++ = (unsigned char)( ( ( elliptic_curve_len + 2 ) >> 8 ) & 0xFF );
309 *p++ = (unsigned char)( ( ( elliptic_curve_len + 2 ) ) & 0xFF );
311 *p++ = (unsigned char)( ( ( elliptic_curve_len ) >> 8 ) & 0xFF );
312 *p++ = (unsigned char)( ( ( elliptic_curve_len ) ) & 0xFF );
321 unsigned char *p = buf; local
328 if( end < p || (size_t)( end - p ) < 6 )
334 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS >> 8 ) & 0xFF );
335 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS ) & 0xFF );
337 *p++ = 0x00;
338 *p++ = 2;
340 *p++ = 1;
341 *p++ = MBEDTLS_ECP_PF_UNCOMPRESSED;
354 unsigned char *p = buf; local
366 if( end - p < 4 )
372 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_ECJPAKE_KKPP >> 8 ) & 0xFF );
373 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_ECJPAKE_KKPP ) & 0xFF );
386 p + 2, end - p - 2, &kkpp_len,
401 memcpy( ssl->handshake->ecjpake_cache, p + 2, kkpp_len );
410 if( (size_t)( end - p - 2 ) < kkpp_len )
416 memcpy( p + 2, ssl->handshake->ecjpake_cache, kkpp_len );
419 *p++ = (unsigned char)( ( kkpp_len >> 8 ) & 0xFF );
420 *p++ = (unsigned char)( ( kkpp_len ) & 0xFF );
431 unsigned char *p = buf; local
442 if( end < p || (size_t)( end - p ) < 5 )
448 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH >> 8 ) & 0xFF );
449 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH ) & 0xFF );
451 *p++ = 0x00;
452 *p++ = 1;
454 *p++ = ssl->conf->mfl_code;
464 unsigned char *p = buf; local
476 if( end < p || (size_t)( end - p ) < 4 )
482 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_TRUNCATED_HMAC >> 8 ) & 0xFF );
483 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_TRUNCATED_HMAC ) & 0xFF );
485 *p++ = 0x00;
486 *p++ = 0x00;
496 unsigned char *p = buf; local
510 if( end < p || (size_t)( end - p ) < 4 )
516 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC >> 8 ) & 0xFF );
517 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC ) & 0xFF );
519 *p++ = 0x00;
520 *p++ = 0x00;
530 unsigned char *p = buf; local
544 if( end < p || (size_t)( end - p ) < 4 )
550 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET >> 8 ) & 0xFF );
551 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET ) & 0xFF );
553 *p++ = 0x00;
554 *p++ = 0x00;
564 unsigned char *p = buf; local
577 if( end < p || (size_t)( end - p ) < 4 + tlen )
583 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SESSION_TICKET >> 8 ) & 0xFF );
584 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SESSION_TICKET ) & 0xFF );
586 *p++ = (unsigned char)( ( tlen >> 8 ) & 0xFF );
587 *p++ = (unsigned char)( ( tlen ) & 0xFF );
598 memcpy( p, ssl->session_negotiate->ticket, tlen );
608 unsigned char *p = buf; local
625 if( end < p || (size_t)( end - p ) < 6 + alpnlen )
631 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN >> 8 ) & 0xFF );
632 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN ) & 0xFF );
643 p += 4;
647 *p = (unsigned char)( strlen( *cur ) & 0xFF );
648 memcpy( p + 1, *cur, *p );
649 p += 1 + *p;
652 *olen = p - buf;
670 unsigned char *p = ssl->handshake->randbytes; local
688 *p++ = (unsigned char)( t >> 24 );
689 *p++ = (unsigned char)( t >> 16 );
690 *p++ = (unsigned char)( t >> 8 );
691 *p++ = (unsigned char)( t );
695 if( ( ret = ssl->conf->f_rng( ssl->conf->p_rng, p, 4 ) ) != 0 )
698 p += 4;
701 if( ( ret = ssl->conf->f_rng( ssl->conf->p_rng, p, 28 ) ) != 0 )
712 unsigned char *p, *q; local
748 p = buf + 4;
751 ssl->conf->transport, p );
752 p += 2;
763 memcpy( p, ssl->handshake->randbytes, 32 );
764 MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, random bytes", p, 32 );
765 p += 32;
812 *p++ = (unsigned char) n;
815 *p++ = ssl->session_negotiate->id[i];
829 *p++ = 0;
837 *p++ = ssl->handshake->verify_cookie_len;
838 memcpy( p, ssl->handshake->verify_cookie,
840 p += ssl->handshake->verify_cookie_len;
852 q = p;
853 p += 2;
888 *p++ = (unsigned char)( ciphersuites[i] >> 8 );
889 *p++ = (unsigned char)( ciphersuites[i] );
899 *p++ = (unsigned char)( MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO >> 8 );
900 *p++ = (unsigned char)( MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO );
909 *p++ = (unsigned char)( MBEDTLS_SSL_FALLBACK_SCSV_VALUE >> 8 );
910 *p++ = (unsigned char)( MBEDTLS_SSL_FALLBACK_SCSV_VALUE );
943 *p++ = 2;
944 *p++ = MBEDTLS_SSL_COMPRESS_DEFLATE;
945 *p++ = MBEDTLS_SSL_COMPRESS_NULL;
953 *p++ = 1;
954 *p++ = MBEDTLS_SSL_COMPRESS_NULL;
960 ssl_write_hostname_ext( ssl, p + 2 + ext_len, &olen );
965 ssl_write_renegotiation_ext( ssl, p + 2 + ext_len, &olen );
971 ssl_write_signature_algorithms_ext( ssl, p + 2 + ext_len, &olen );
977 ssl_write_supported_elliptic_curves_ext( ssl, p + 2 + ext_len, &olen );
980 ssl_write_supported_point_formats_ext( ssl, p + 2 + ext_len, &olen );
985 ssl_write_ecjpake_kkpp_ext( ssl, p + 2 + ext_len, &olen );
990 ssl_write_max_fragment_length_ext( ssl, p + 2 + ext_len, &olen );
995 ssl_write_truncated_hmac_ext( ssl, p + 2 + ext_len, &olen );
1000 ssl_write_encrypt_then_mac_ext( ssl, p + 2 + ext_len, &olen );
1005 ssl_write_extended_ms_ext( ssl, p + 2 + ext_len, &olen );
1010 ssl_write_alpn_ext( ssl, p + 2 + ext_len, &olen );
1015 ssl_write_session_ticket_ext( ssl, p + 2 + ext_len, &olen );
1027 *p++ = (unsigned char)( ( ext_len >> 8 ) & 0xFF );
1028 *p++ = (unsigned char)( ( ext_len ) & 0xFF );
1029 p += ext_len;
1032 ssl->out_msglen = p - buf;
1203 const unsigned char *p; local
1212 p = buf + 1;
1215 if( p[0] == MBEDTLS_ECP_PF_UNCOMPRESSED ||
1216 p[0] == MBEDTLS_ECP_PF_COMPRESSED )
1219 ssl->handshake->ecdh_ctx.point_format = p[0];
1222 ssl->handshake->ecjpake_ctx.point_format = p[0];
1224 MBEDTLS_SSL_DEBUG_MSG( 4, ( "point format selected: %d", p[0] ) );
1229 p++;
1273 const char **p; local
1302 for( p = ssl->conf->alpn_list; *p != NULL; p++ )
1304 if( name_len == strlen( *p ) &&
1305 memcmp( buf + 3, *p, name_len ) == 0 )
1307 ssl->alpn_chosen = *p;
1322 const unsigned char *p = ssl->in_msg + mbedtls_ssl_hs_hdr_len( ssl ); local
1334 MBEDTLS_SSL_DEBUG_BUF( 3, "server version", p, 2 );
1335 mbedtls_ssl_read_version( &major_ver, &minor_ver, ssl->conf->transport, p );
1336 p += 2;
1355 cookie_len = *p++;
1356 MBEDTLS_SSL_DEBUG_BUF( 3, "cookie", p, cookie_len );
1358 if( ( ssl->in_msg + ssl->in_msglen ) - p < cookie_len )
1376 memcpy( ssl->handshake->verify_cookie, p, cookie_len );
1866 static int ssl_parse_server_dh_params( mbedtls_ssl_context *ssl, unsigned char **p, argument
1880 if( ( ret = mbedtls_dhm_read_params( &ssl->handshake->dhm_ctx, p, end ) ) != 0 )
1943 unsigned char **p, argument
1957 (const unsigned char **) p, end ) ) != 0 )
1977 unsigned char **p, argument
1989 len = (*p)[0] << 8 | (*p)[1];
1990 *p += 2;
1992 if( (*p) + len > end )
2003 *p += len;
2021 unsigned char *p = ssl->handshake->premaster + pms_offset; local
2037 ssl->conf->transport, p );
2039 if( ( ret = ssl->conf->f_rng( ssl->conf->p_rng, p + 2, 46 ) ) != 0 )
2064 p, ssl->handshake->pmslen,
2093 unsigned char **p, argument
2108 if( (*p) + 2 > end )
2114 if( ( *md_alg = mbedtls_ssl_md_alg_from_hash( (*p)[0] ) ) == MBEDTLS_MD_NONE )
2117 "HashAlgorithm %d", *(p)[0] ) );
2124 if( ( *pk_alg = mbedtls_ssl_pk_alg_from_sig( (*p)[1] ) ) == MBEDTLS_PK_NONE )
2127 "SignatureAlgorithm %d", (*p)[1] ) );
2141 MBEDTLS_SSL_DEBUG_MSG( 2, ( "Server used SignatureAlgorithm %d", (*p)[1] ) );
2142 MBEDTLS_SSL_DEBUG_MSG( 2, ( "Server used HashAlgorithm %d", (*p)[0] ) );
2143 *p += 2;
2196 unsigned char *p, *end; local
2207 ((void) p);
2226 ((void) p);
2260 p = ssl->in_msg + mbedtls_ssl_hs_hdr_len( ssl );
2262 MBEDTLS_SSL_DEBUG_BUF( 3, "server key exchange", p, end - p );
2270 if( ssl_parse_server_psk_hint( ssl, &p, end ) != 0 )
2291 if( ssl_parse_server_dh_params( ssl, &p, end ) != 0 )
2307 if( ssl_parse_server_ecdh_params( ssl, &p, end ) != 0 )
2321 p, end - p );
2347 size_t params_len = p - params;
2355 if( ssl_parse_signature_algorithm( ssl, &p, end,
2390 sig_len = ( p[0] << 8 ) | p[1];
2391 p += 2;
2393 if( end != p + sig_len )
2399 MBEDTLS_SSL_DEBUG_BUF( 3, "signature", p, sig_len );
2503 md_alg, hash, hashlen, p, sig_len ) ) != 0 )