Lines Matching refs:msg

261 dtls_get_cookie(uint8 *msg, size_t msglen, uint8 **cookie) {  in dtls_get_cookie()  argument
267 if (dtls_uint16_to_int(msg + DTLS_HS_LENGTH) != DTLS_VERSION) in dtls_get_cookie()
271 msg += DTLS_HS_LENGTH + DTLS_CH_LENGTH; in dtls_get_cookie()
273 SKIP_VAR_FIELD(msg, msglen, uint8); /* skip session id */ in dtls_get_cookie()
275 if (msglen < (*msg & 0xff) + sizeof(uint8)) in dtls_get_cookie()
278 *cookie = msg + sizeof(uint8); in dtls_get_cookie()
279 return dtls_uint8_to_int(msg); in dtls_get_cookie()
288 uint8 *msg, size_t msglen, in dtls_create_cookie() argument
318 e += (*(msg + DTLS_HS_LENGTH + e) & 0xff) + sizeof(uint8); in dtls_create_cookie()
322 dtls_hmac_update(&hmac_context, msg + DTLS_HS_LENGTH, e); in dtls_create_cookie()
325 e += *(uint8 *)(msg + DTLS_HS_LENGTH + e) & 0xff; in dtls_create_cookie()
331 msg + DTLS_HS_LENGTH + e, in dtls_create_cookie()
332 dtls_get_fragment_length(DTLS_HANDSHAKE_HEADER(msg)) - e); in dtls_create_cookie()
361 is_record(uint8 *msg, size_t msglen) { in is_record() argument
366 && strchr(content_types, msg[0]) in is_record()
368 && msg[1] == HIGH(DTLS_VERSION) in is_record()
369 && msg[2] == LOW(DTLS_VERSION)) in is_record()
372 dtls_uint16_to_int(DTLS_RECORD_HEADER(msg)->length); in is_record()
1487 uint8_t msg[] = { level, description }; in dtls_send_alert() local
1489 dtls_send(ctx, peer, DTLS_CT_ALERT, msg, sizeof(msg)); in dtls_send_alert()
3593 uint8 *msg, int msglen) { in dtls_handle_message() argument
3611 while ((rlen = is_record(msg,msglen))) { in dtls_handle_message()
3615 dtls_debug("got packet %d (%d bytes)\n", msg[0], rlen); in dtls_handle_message()
3617 data_length = decrypt_verify(peer, msg, rlen, &data); in dtls_handle_message()
3633 data = msg + DTLS_RH_LENGTH; in dtls_handle_message()
3639 dtls_debug_hexdump("receive header", msg, sizeof(dtls_record_header_t)); in dtls_handle_message()
3647 switch (msg[0]) { 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()
3686 dtls_uint16_to_int(DTLS_RECORD_HEADER(msg)->epoch); in dtls_handle_message()
3728 dtls_info("dropped unknown message of type %d\n",msg[0]); in dtls_handle_message()
3732 msg += rlen; in dtls_handle_message()