Lines Matching refs:res

243     int res;  in dtls_write()  local
247 res = dtls_connect(ctx, dst); in dtls_write()
249 return (res >= 0) ? 0 : res; in dtls_write()
1186 int res; in dtls_prepare_record() local
1200 res = 0; in dtls_prepare_record()
1203 if (*rlen < res + DTLS_RH_LENGTH + data_len_array[i]) { in dtls_prepare_record()
1210 res += data_len_array[i]; in dtls_prepare_record()
1271 res = 8; in dtls_prepare_record()
1275 if (*rlen < res + DTLS_RH_LENGTH + data_len_array[i]) { in dtls_prepare_record()
1282 res += data_len_array[i]; in dtls_prepare_record()
1301 dtls_int_to_uint16(A_DATA + 11, res - 8); /* length */ in dtls_prepare_record()
1303 res = dtls_encrypt(start + 8, res - 8, start + 8, nonce, in dtls_prepare_record()
1308 if (res < 0) in dtls_prepare_record()
1309 return res; in dtls_prepare_record()
1311 res += 8; /* increment res by size of nonce_explicit */ in dtls_prepare_record()
1312 dtls_debug_dump("message:", start, res); in dtls_prepare_record()
1316 dtls_int_to_uint16(sendbuf + 11, res); in dtls_prepare_record()
1318 *rlen = DTLS_RH_LENGTH + res; in dtls_prepare_record()
1420 int res; in dtls_send_multi() local
1424res = dtls_prepare_record(peer, security, type, buf_array, buf_len_array, buf_array_len, sendbuf, … in dtls_send_multi()
1426 if (res < 0) in dtls_send_multi()
1427 return res; in dtls_send_multi()
1476 res = CALL(ctx, write, session, sendbuf, len); in dtls_send_multi()
1481 return res <= 0 ? res : overall_len - (len - res); in dtls_send_multi()
1495 int res = -1; in dtls_close() local
1501 res = dtls_send_alert(ctx, peer, DTLS_ALERT_LEVEL_FATAL, DTLS_ALERT_CLOSE_NOTIFY); in dtls_close()
1505 return res; in dtls_close()
2075 int res; in dtls_send_server_hello_msgs() local
2077 res = dtls_send_server_hello(ctx, peer); in dtls_send_server_hello_msgs()
2079 if (res < 0) { in dtls_send_server_hello_msgs()
2081 return res; in dtls_send_server_hello_msgs()
2088 res = CALL(ctx, get_ecdsa_key, &peer->session, &ecdsa_key); in dtls_send_server_hello_msgs()
2089 if (res < 0) { in dtls_send_server_hello_msgs()
2091 return res; in dtls_send_server_hello_msgs()
2094 res = dtls_send_certificate_ecdsa(ctx, peer, ecdsa_key); in dtls_send_server_hello_msgs()
2096 if (res < 0) { in dtls_send_server_hello_msgs()
2098 return res; in dtls_send_server_hello_msgs()
2101 res = dtls_send_server_key_exchange_ecdh(ctx, peer, ecdsa_key); in dtls_send_server_hello_msgs()
2103 if (res < 0) { in dtls_send_server_hello_msgs()
2105 return res; in dtls_send_server_hello_msgs()
2110 res = dtls_send_server_certificate_request(ctx, peer); in dtls_send_server_hello_msgs()
2112 if (res < 0) { in dtls_send_server_hello_msgs()
2114 return res; in dtls_send_server_hello_msgs()
2136 res = dtls_send_server_key_exchange_psk(ctx, peer, psk_hint, (size_t)len); in dtls_send_server_hello_msgs()
2138 if (res < 0) { in dtls_send_server_hello_msgs()
2140 return res; in dtls_send_server_hello_msgs()
2146 res = dtls_send_server_hello_done(ctx, peer); in dtls_send_server_hello_msgs()
2148 if (res < 0) { in dtls_send_server_hello_msgs()
2150 return res; in dtls_send_server_hello_msgs()
2535 int res; in check_server_hello_verify_request() local
2542 res = dtls_send_client_hello(ctx, peer, hv->cookie, hv->cookie_length); in check_server_hello_verify_request()
2544 if (res < 0) in check_server_hello_verify_request()
2547 return res; in check_server_hello_verify_request()
2808 int res; in check_server_hellodone() local
2822 res = CALL(ctx, get_ecdsa_key, &peer->session, &ecdsa_key); in check_server_hellodone()
2823 if (res < 0) { in check_server_hellodone()
2825 return res; in check_server_hellodone()
2828 res = dtls_send_certificate_ecdsa(ctx, peer, ecdsa_key); in check_server_hellodone()
2830 if (res < 0) { in check_server_hellodone()
2832 return res; in check_server_hellodone()
2838 res = dtls_send_client_key_exchange(ctx, peer); in check_server_hellodone()
2840 if (res < 0) { in check_server_hellodone()
2842 return res; in check_server_hellodone()
2848 res = dtls_send_certificate_verify_ecdh(ctx, peer, ecdsa_key); in check_server_hellodone()
2850 if (res < 0) { in check_server_hellodone()
2852 return res; in check_server_hellodone()
2857 res = calculate_key_block(ctx, handshake, peer, in check_server_hellodone()
2859 if (res < 0) { in check_server_hellodone()
2860 return res; in check_server_hellodone()
2863 res = dtls_send_ccs(ctx, peer); in check_server_hellodone()
2864 if (res < 0) { in check_server_hellodone()
2866 return res; in check_server_hellodone()
3352 int res; in handle_handshake() local
3425 res = handle_handshake_msg(ctx, peer, session, role, state, data, data_length); in handle_handshake()
3426 if (res < 0) in handle_handshake()
3427 return res; in handle_handshake()
3439res = handle_handshake_msg(ctx, peer, session, role, peer->state, node->data, node->length); in handle_handshake()
3440 if (res < 0) { in handle_handshake()
3441 return res; in handle_handshake()
3450 return res; in handle_handshake()
3827 int res; in dtls_connect_peer() local
3852 res = dtls_send_client_hello(ctx, peer, NULL, 0); in dtls_connect_peer()
3853 if (res < 0) in dtls_connect_peer()
3858 return res; in dtls_connect_peer()
3864 int res; in dtls_connect() local
3876 res = dtls_connect_peer(ctx, peer); in dtls_connect()
3880 if (res > 0) { in dtls_connect()
3882 } else if (res == 0) { in dtls_connect()
3886 return res; in dtls_connect()