We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a9e048 commit 612e9f7Copy full SHA for 612e9f7
1 file changed
dtls.c
@@ -3436,6 +3436,11 @@ check_server_certificate(dtls_context_t *ctx,
3436
3437
data += DTLS_HS_LENGTH;
3438
3439
+ if (data_length < DTLS_HS_LENGTH + DTLS_EC_SUBJECTPUBLICKEY_SIZE + sizeof(uint24)) {
3440
+ dtls_alert("the packet length does not match the expected\n");
3441
+ return dtls_alert_fatal_create(DTLS_ALERT_DECODE_ERROR);
3442
+ }
3443
+
3444
if (dtls_uint24_to_int(data) != DTLS_EC_SUBJECTPUBLICKEY_SIZE) {
3445
dtls_alert("expect length of %zu bytes for certificate\n",
3446
DTLS_EC_SUBJECTPUBLICKEY_SIZE);
0 commit comments