net:tinydtls fix denial of service in tinydtls
tinydtls library allows remote attackers to cause a denial of service (DTLS peer crash) by sending
a "Change cipher spec" packet without pre-handshake.
so peer and peer->handparams should be checked.
you can see the detailed at
@@ -3650,6 +3650,9 @@ dtls_handle_message(dtls_context_t *ctx,
if (peer) {
dtls_stop_retransmission(ctx, peer);
}
+ if (!peer || !peer->handshake_params) {
+ break;
+ }
err = handle_ccs(ctx, peer, msg, data, data_length);
if (err < 0) {
dtls_warn("error while handling ChangeCipherSpec message\n");
