Lines Matching refs:err
1549 int err; in dtls_verify_peer() local
1554 err = dtls_create_cookie(ctx, session, data, data_length, mycookie, &len); in dtls_verify_peer()
1555 if (err < 0) in dtls_verify_peer()
1556 return err; in dtls_verify_peer()
1565 dtls_warn("error while fetching the cookie, err: %i\n", err); in dtls_verify_peer()
1566 return err; in dtls_verify_peer()
1598 err = dtls_send_handshake_msg_hash(ctx, peer, session, in dtls_verify_peer()
1601 if (err < 0) { in dtls_verify_peer()
1604 return err; /* HelloVerify is sent, now we cannot do anything but wait */ in dtls_verify_peer()
2556 int err; in check_server_certificate() local
2591 err = CALL(ctx, verify_ecdsa_key, &peer->session, in check_server_certificate()
2595 if (err < 0) { in check_server_certificate()
2597 return err; in check_server_certificate()
2959 int err; in dtls_renegotiate() local
2978 err = dtls_send_client_hello(ctx, peer, NULL, 0); in dtls_renegotiate()
2979 if (err < 0) in dtls_renegotiate()
2983 return err; in dtls_renegotiate()
2996 int err = 0; in handle_handshake_msg() local
3024 err = check_server_hello_verify_request(ctx, peer, data, data_length); in handle_handshake_msg()
3025 if (err < 0) { in handle_handshake_msg()
3026 dtls_warn("error in check_server_hello_verify_request err: %i\n", err); in handle_handshake_msg()
3027 return err; in handle_handshake_msg()
3037 err = check_server_hello(ctx, peer, data, data_length); in handle_handshake_msg()
3038 if (err < 0) { in handle_handshake_msg()
3039 dtls_warn("error in check_server_hello err: %i\n", err); in handle_handshake_msg()
3040 return err; in handle_handshake_msg()
3057 err = check_server_certificate(ctx, peer, data, data_length); in handle_handshake_msg()
3058 if (err < 0) { in handle_handshake_msg()
3059 dtls_warn("error in check_server_certificate err: %i\n", err); in handle_handshake_msg()
3060 return err; 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()
3091 if (err < 0) { in handle_handshake_msg()
3092 dtls_warn("error in check_server_key_exchange err: %i\n", err); in handle_handshake_msg()
3093 return err; in handle_handshake_msg()
3106 err = check_server_hellodone(ctx, peer, data, data_length); in handle_handshake_msg()
3107 if (err < 0) { in handle_handshake_msg()
3108 dtls_warn("error in check_server_hellodone err: %i\n", err); in handle_handshake_msg()
3109 return err; in handle_handshake_msg()
3122 err = check_certificate_request(ctx, peer, data, data_length); in handle_handshake_msg()
3123 if (err < 0) { in handle_handshake_msg()
3124 dtls_warn("error in check_certificate_request err: %i\n", err); in handle_handshake_msg()
3125 return err; in handle_handshake_msg()
3137 err = check_finished(ctx, peer, data, data_length); in handle_handshake_msg()
3138 if (err < 0) { in handle_handshake_msg()
3139 dtls_warn("error in check_finished err: %i\n", err); in handle_handshake_msg()
3140 return err; in handle_handshake_msg()
3147 err = dtls_send_ccs(ctx, peer); in handle_handshake_msg()
3148 if (err < 0) { in handle_handshake_msg()
3150 return err; in handle_handshake_msg()
3155 err = dtls_send_finished(ctx, peer, PRF_LABEL(server), PRF_LABEL_SIZE(server)); in handle_handshake_msg()
3156 if (err < 0) { in handle_handshake_msg()
3158 return err; in handle_handshake_msg()
3168 return err; in handle_handshake_msg()
3181 err = check_client_keyexchange(ctx, peer->handshake_params, data, data_length); in handle_handshake_msg()
3182 if (err < 0) { in handle_handshake_msg()
3183 dtls_warn("error in check_client_keyexchange err: %i\n", err); in handle_handshake_msg()
3184 return err; in handle_handshake_msg()
3202 err = check_client_certificate_verify(ctx, peer, data, data_length); in handle_handshake_msg()
3203 if (err < 0) { in handle_handshake_msg()
3204 dtls_warn("error in check_client_certificate_verify err: %i\n", err); in handle_handshake_msg()
3205 return err; in handle_handshake_msg()
3229 err = dtls_verify_peer(ctx, peer, session, data, data_length); in handle_handshake_msg()
3230 if (err < 0) { in handle_handshake_msg()
3231 dtls_warn("error in dtls_verify_peer err: %i\n", err); in handle_handshake_msg()
3232 return err; in handle_handshake_msg()
3235 if (err > 0) { in handle_handshake_msg()
3282 err = dtls_update_parameters(ctx, peer, data, data_length); in handle_handshake_msg()
3283 if (err < 0) { in handle_handshake_msg()
3285 return err; in handle_handshake_msg()
3291 err = dtls_send_server_hello_msgs(ctx, peer); in handle_handshake_msg()
3292 if (err < 0) { in handle_handshake_msg()
3293 return err; in handle_handshake_msg()
3326 err = dtls_send_client_hello(ctx, peer, NULL, 0); in handle_handshake_msg()
3327 if (err < 0) { in handle_handshake_msg()
3329 return err; in handle_handshake_msg()
3339 if (peer && peer->handshake_params && err >= 0) { in handle_handshake_msg()
3343 return err; in handle_handshake_msg()
3460 int err; in handle_ccs() local
3479 err = calculate_key_block(ctx, handshake, peer, in handle_ccs()
3481 if (err < 0) { in handle_ccs()
3482 return err; in handle_ccs()
3560 session_t *session, int err) in dtls_alert_send_from_err() argument
3565 if (err < -(1 << 8) && err > -(3 << 8)) { in dtls_alert_send_from_err()
3566 level = ((-err) & 0xff00) >> 8; in dtls_alert_send_from_err()
3567 desc = (-err) & 0xff; in dtls_alert_send_from_err()
3575 } else if (err == -1) { in dtls_alert_send_from_err()
3599 int err; in dtls_handle_message() local
3619 int err = dtls_alert_fatal_create(DTLS_ALERT_DECRYPT_ERROR); in dtls_handle_message() local
3622 dtls_alert_send_from_err(ctx, peer, &peer->session, err); in dtls_handle_message()
3627 return err; in dtls_handle_message()
3653 err = handle_ccs(ctx, peer, msg, data, data_length); in dtls_handle_message()
3654 if (err < 0) { in dtls_handle_message()
3656 dtls_alert_send_from_err(ctx, peer, session, err); in dtls_handle_message()
3662 return err; in dtls_handle_message()
3670 err = handle_alert(ctx, peer, msg, data, data_length); in dtls_handle_message()
3671 if (err < 0 || err == 1) { in dtls_handle_message()
3675 return err < 0 ?err:-1; in dtls_handle_message()
3704 err = handle_handshake(ctx, peer, session, role, state, data, data_length); in dtls_handle_message()
3705 if (err < 0) { in dtls_handle_message()
3707 dtls_alert_send_from_err(ctx, peer, session, err); in dtls_handle_message()
3708 return err; in dtls_handle_message()
3898 int err; in dtls_retransmit() local
3918 err = dtls_prepare_record(node->peer, security, node->type, &data, &length, in dtls_retransmit()
3920 if (err < 0) { in dtls_retransmit()
3921 dtls_warn("can not retransmit packet, err: %i\n", err); in dtls_retransmit()