mirror of
https://github.com/eclipse/tinydtls.git
synced 2025-05-08 11:27:36 +08:00
dtls.c: remove rudiments of renegotiation.
Renegotiation has been removed. Cleanup some leftovers internal renegotiation errors. Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
This commit is contained in:
parent
c9bbc0340f
commit
3159ca6065
1
alert.h
1
alert.h
@ -56,7 +56,6 @@ typedef enum {
|
||||
#define DTLS_EVENT_CONNECT 0x01DC /**< initiated handshake */
|
||||
#define DTLS_EVENT_CONNECTED 0x01DE /**< handshake or re-negotiation
|
||||
* has finished */
|
||||
#define DTLS_EVENT_RENEGOTIATE 0x01DF /**< re-negotiation has started */
|
||||
|
||||
static inline int
|
||||
dtls_alert_create(dtls_alert_level_t level, dtls_alert_t desc)
|
||||
|
18
dtls.c
18
dtls.c
@ -1234,11 +1234,7 @@ check_forced_extensions:
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (is_client_hello && peer->state == DTLS_STATE_CONNECTED) {
|
||||
return dtls_alert_create(DTLS_ALERT_LEVEL_WARNING, DTLS_ALERT_NO_RENEGOTIATION);
|
||||
} else {
|
||||
return dtls_alert_fatal_create(DTLS_ALERT_HANDSHAKE_FAILURE);
|
||||
}
|
||||
return dtls_alert_fatal_create(DTLS_ALERT_HANDSHAKE_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1368,11 +1364,7 @@ dtls_update_parameters(dtls_context_t *ctx,
|
||||
|
||||
return dtls_check_tls_extension(peer, data, data_length, 1);
|
||||
error:
|
||||
if (peer->state == DTLS_STATE_CONNECTED) {
|
||||
return dtls_alert_create(DTLS_ALERT_LEVEL_WARNING, DTLS_ALERT_NO_RENEGOTIATION);
|
||||
} else {
|
||||
return dtls_alert_fatal_create(DTLS_ALERT_HANDSHAKE_FAILURE);
|
||||
}
|
||||
return dtls_alert_fatal_create(DTLS_ALERT_HANDSHAKE_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4634,7 +4626,9 @@ dtls_handle_message(dtls_context_t *ctx,
|
||||
|
||||
err = handle_handshake(ctx, peer, data, data_length);
|
||||
if (err < 0) {
|
||||
dtls_warn("error while handling handshake packet\n");
|
||||
dtls_warn("error 0x%04x handling handshake packet of type: %s (%i),"
|
||||
" state %d\n", -err, dtls_handshake_type_to_name(data[0]),
|
||||
data[0], peer->state);
|
||||
dtls_alert_send_from_err(ctx, peer, err);
|
||||
|
||||
if (peer && DTLS_ALERT_LEVEL_FATAL == ((-err) & 0xff00) >> 8) {
|
||||
@ -4803,8 +4797,6 @@ dtls_connect(dtls_context_t *ctx, const session_t *dst) {
|
||||
* re-negotiation. */
|
||||
if (res > 0) {
|
||||
CALL(ctx, event, &peer->session, 0, DTLS_EVENT_CONNECT);
|
||||
} else if (res == 0) {
|
||||
CALL(ctx, event, &peer->session, 0, DTLS_EVENT_RENEGOTIATE);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
Loading…
x
Reference in New Issue
Block a user