Lines Matching refs:data_length

701 static int verify_ext_eliptic_curves(uint8 *data, size_t data_length) {  in verify_ext_eliptic_curves()  argument
707 if (i + sizeof(uint16) != data_length) { in verify_ext_eliptic_curves()
712 for (i = data_length - sizeof(uint16); i > 0; i -= sizeof(uint16)) { in verify_ext_eliptic_curves()
725 static int verify_ext_cert_type(uint8 *data, size_t data_length) { in verify_ext_cert_type() argument
731 if (i + sizeof(uint8) != data_length) { in verify_ext_cert_type()
736 for (i = data_length - sizeof(uint8); i > 0; i -= sizeof(uint8)) { in verify_ext_cert_type()
749 static int verify_ext_ec_point_formats(uint8 *data, size_t data_length) { in verify_ext_ec_point_formats() argument
755 if (i + sizeof(uint8) != data_length) { in verify_ext_ec_point_formats()
760 for (i = data_length - sizeof(uint8); i > 0; i -= sizeof(uint8)) { in verify_ext_ec_point_formats()
778 uint8 *data, size_t data_length, int client_hello) in dtls_check_tls_extension() argument
787 if (data_length < sizeof(uint16)) { in dtls_check_tls_extension()
798 data_length -= sizeof(uint16); in dtls_check_tls_extension()
800 if (data_length < j) in dtls_check_tls_extension()
804 while (data_length) { in dtls_check_tls_extension()
805 if (data_length < sizeof(uint16) * 2) in dtls_check_tls_extension()
811 data_length -= sizeof(uint16); in dtls_check_tls_extension()
816 data_length -= sizeof(uint16); in dtls_check_tls_extension()
818 if (data_length < j) in dtls_check_tls_extension()
863 data_length -= j; in dtls_check_tls_extension()
902 uint8 *data, size_t data_length) { in dtls_update_parameters() argument
909 assert(data_length > DTLS_HS_LENGTH + DTLS_CH_LENGTH); in dtls_update_parameters()
913 data_length -= DTLS_HS_LENGTH + sizeof(uint16); in dtls_update_parameters()
918 data_length -= DTLS_RANDOM_LENGTH; in dtls_update_parameters()
921 SKIP_VAR_FIELD(data, data_length, uint8); /* skip session id */ in dtls_update_parameters()
922 SKIP_VAR_FIELD(data, data_length, uint8); /* skip cookie */ in dtls_update_parameters()
925 if (data_length < i + sizeof(uint16)) { in dtls_update_parameters()
939 data_length -= sizeof(uint16) + i; in dtls_update_parameters()
959 if (data_length < sizeof(uint8)) { in dtls_update_parameters()
969 if (data_length < i + sizeof(uint8)) in dtls_update_parameters()
973 data_length -= sizeof(uint8) + i; in dtls_update_parameters()
991 return dtls_check_tls_extension(peer, data, data_length, 1); in dtls_update_parameters()
1105 uint8 *data, size_t data_length) { in check_finished() argument
1110 if (data_length < DTLS_HS_LENGTH + DTLS_FIN_LENGTH) in check_finished()
1327 uint8 *data, size_t data_length, in dtls_send_handshake_msg_hash() argument
1336 dtls_set_handshake_header(header_type, peer, data_length, 0, in dtls_send_handshake_msg_hash()
1337 data_length, buf); in dtls_send_handshake_msg_hash()
1348 update_hs_hash(peer, data, data_length); in dtls_send_handshake_msg_hash()
1351 data_len_array[i] = data_length; in dtls_send_handshake_msg_hash()
1364 uint8 *data, size_t data_length) in dtls_send_handshake_msg() argument
1367 header_type, data, data_length, 1); in dtls_send_handshake_msg()
1543 uint8 *data, size_t data_length) in dtls_verify_peer() argument
1554 err = dtls_create_cookie(ctx, session, data, data_length, mycookie, &len); in dtls_verify_peer()
1563 len = dtls_get_cookie(data, data_length, &cookie); in dtls_verify_peer()
1611 dtls_check_ecdsa_signature_elem(uint8 *data, size_t data_length, in dtls_check_ecdsa_signature_elem() argument
1623 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1630 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1632 if (data_length < dtls_uint16_to_int(data)) { in dtls_check_ecdsa_signature_elem()
1637 data_length -= sizeof(uint16); in dtls_check_ecdsa_signature_elem()
1644 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1646 if (data_length < dtls_uint8_to_int(data)) { in dtls_check_ecdsa_signature_elem()
1651 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1658 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1662 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1668 data_length -= i; in dtls_check_ecdsa_signature_elem()
1675 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1679 data_length -= sizeof(uint8); in dtls_check_ecdsa_signature_elem()
1685 data_length -= i; in dtls_check_ecdsa_signature_elem()
1693 uint8 *data, size_t data_length) in check_client_certificate_verify() argument
1706 if (data_length < DTLS_HS_LENGTH + DTLS_CV_LENGTH) { in check_client_certificate_verify()
1711 ret = dtls_check_ecdsa_signature_elem(data, data_length, &result_r, &result_s); in check_client_certificate_verify()
1716 data_length -= ret; in check_client_certificate_verify()
2462 uint8 *data, size_t data_length) in check_server_hello() argument
2471 if (data_length < DTLS_HS_LENGTH + DTLS_HS_LENGTH) in check_server_hello()
2474 update_hs_hash(peer, data, data_length); in check_server_hello()
2485 data_length -= DTLS_HS_LENGTH; in check_server_hello()
2493 data_length -= sizeof(uint16); in check_server_hello()
2499 data_length -= DTLS_RANDOM_LENGTH; in check_server_hello()
2501 SKIP_VAR_FIELD(data, data_length, uint8); /* skip session id */ in check_server_hello()
2513 data_length -= sizeof(uint16); in check_server_hello()
2521 data_length -= sizeof(uint8); in check_server_hello()
2523 return dtls_check_tls_extension(peer, data, data_length, 0); in check_server_hello()
2532 uint8 *data, size_t data_length) in check_server_hello_verify_request() argument
2537 if (data_length < DTLS_HS_LENGTH + DTLS_HV_LENGTH) in check_server_hello_verify_request()
2554 uint8 *data, size_t data_length) in check_server_certificate() argument
2559 update_hs_hash(peer, data, data_length); in check_server_certificate()
2606 uint8 *data, size_t data_length) in check_server_key_exchange_ecdsa() argument
2614 update_hs_hash(peer, data, data_length); in check_server_key_exchange_ecdsa()
2620 if (data_length < DTLS_HS_LENGTH + DTLS_SKEXEC_LENGTH) { in check_server_key_exchange_ecdsa()
2631 data_length -= sizeof(uint8); in check_server_key_exchange_ecdsa()
2638 data_length -= sizeof(uint16); in check_server_key_exchange_ecdsa()
2645 data_length -= sizeof(uint8); in check_server_key_exchange_ecdsa()
2652 data_length -= sizeof(uint8); in check_server_key_exchange_ecdsa()
2656 data_length -= sizeof(config->keyx.ecdsa.other_eph_pub_y); in check_server_key_exchange_ecdsa()
2660 data_length -= sizeof(config->keyx.ecdsa.other_eph_pub_y); in check_server_key_exchange_ecdsa()
2662 ret = dtls_check_ecdsa_signature_elem(data, data_length, &result_r, &result_s); in check_server_key_exchange_ecdsa()
2667 data_length -= ret; in check_server_key_exchange_ecdsa()
2689 uint8 *data, size_t data_length) in check_server_key_exchange_psk() argument
2694 update_hs_hash(peer, data, data_length); in check_server_key_exchange_psk()
2700 if (data_length < DTLS_HS_LENGTH + DTLS_SKEXECPSK_LENGTH_MIN) { in check_server_key_exchange_psk()
2708 if (len != data_length - DTLS_HS_LENGTH - sizeof(uint16)) { in check_server_key_exchange_psk()
2728 uint8 *data, size_t data_length) in check_certificate_request() argument
2735 update_hs_hash(peer, data, data_length); in check_certificate_request()
2741 if (data_length < DTLS_HS_LENGTH + 5) { in check_certificate_request()
2748 if (i + 1 > data_length) { in check_certificate_request()
2768 if (i + 1 > data_length) { in check_certificate_request()
2806 uint8 *data, size_t data_length) in check_server_hellodone() argument
2817 update_hs_hash(peer, data, data_length); in check_server_hellodone()
2994 uint8 *data, size_t data_length) { in handle_handshake_msg() argument
3024 err = check_server_hello_verify_request(ctx, peer, data, data_length); in handle_handshake_msg()
3037 err = check_server_hello(ctx, peer, data, data_length); in handle_handshake_msg()
3057 err = check_server_certificate(ctx, peer, data, data_length); in handle_handshake_msg()
3079 err = check_server_key_exchange_ecdsa(ctx, peer, data, data_length); in handle_handshake_msg()
3087 err = check_server_key_exchange_psk(ctx, peer, data, data_length); in handle_handshake_msg()
3106 err = check_server_hellodone(ctx, peer, data, data_length); in handle_handshake_msg()
3122 err = check_certificate_request(ctx, peer, data, data_length); in handle_handshake_msg()
3137 err = check_finished(ctx, peer, data, data_length); in handle_handshake_msg()
3144 update_hs_hash(peer, data, data_length); in handle_handshake_msg()
3181 err = check_client_keyexchange(ctx, peer->handshake_params, data, data_length); in handle_handshake_msg()
3186 update_hs_hash(peer, data, data_length); in handle_handshake_msg()
3202 err = check_client_certificate_verify(ctx, peer, data, data_length); in handle_handshake_msg()
3208 update_hs_hash(peer, data, data_length); in handle_handshake_msg()
3229 err = dtls_verify_peer(ctx, peer, session, data, data_length); in handle_handshake_msg()
3282 err = dtls_update_parameters(ctx, peer, data, data_length); in handle_handshake_msg()
3289 update_hs_hash(peer, data, data_length); in handle_handshake_msg()
3349 uint8 *data, size_t data_length) in handle_handshake() argument
3354 if (data_length < DTLS_HS_LENGTH) { in handle_handshake()
3374 data_length); in handle_handshake()
3390 if (data_length > DTLS_MAX_BUF) { in handle_handshake()
3405 n = netq_node_new(data_length); in handle_handshake()
3412 n->length = data_length; in handle_handshake()
3413 memcpy(n->data, data, data_length); in handle_handshake()
3425 res = handle_handshake_msg(ctx, peer, session, role, state, data, data_length); in handle_handshake()
3458 uint8 *record_header, uint8 *data, size_t data_length) in handle_ccs() argument
3474 if (data_length < 1 || data[0] != 1) in handle_ccs()
3497 uint8 *record_header, uint8 *data, size_t data_length) { in handle_alert() argument
3500 if (data_length < 2) in handle_alert()
3597 int data_length; /* length of decrypted payload in dtls_handle_message() local
3617 data_length = decrypt_verify(peer, msg, rlen, &data); in dtls_handle_message()
3618 if (data_length < 0) { in dtls_handle_message()
3634 data_length = rlen - DTLS_RH_LENGTH; in dtls_handle_message()
3640 dtls_debug_hexdump("receive unencrypted", data, data_length); in dtls_handle_message()
3653 err = handle_ccs(ctx, peer, msg, data, data_length); in dtls_handle_message()
3670 err = handle_alert(ctx, peer, msg, data, data_length); in dtls_handle_message()
3704 err = handle_handshake(ctx, peer, session, role, state, data, data_length); in dtls_handle_message()
3725 CALL(ctx, read, &peer->session, data, data_length); in dtls_handle_message()