Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/ntp/ntpd/ntp_crypto.c
Show First 20 Lines • Show All 467 Lines • ▼ Show 20 Lines | while ((macbytes = rbufp->recv_length - authlen) > (int)MAX_MAC_LEN) { | ||||
* quietly ignore the packet. | * quietly ignore the packet. | ||||
*/ | */ | ||||
if (((code >> 24) & 0x3f) != CRYPTO_VN || len < 8) { | if (((code >> 24) & 0x3f) != CRYPTO_VN || len < 8) { | ||||
sys_badlength++; | sys_badlength++; | ||||
code |= CRYPTO_ERROR; | code |= CRYPTO_ERROR; | ||||
} | } | ||||
/* Check if the declared size fits into the remaining | /* Check if the declared size fits into the remaining | ||||
* buffer. | * buffer. We *know* 'macbytes' > 0 here! | ||||
*/ | */ | ||||
if (len > macbytes) { | if (len > (u_int)macbytes) { | ||||
DPRINTF(1, ("crypto_recv: possible attack detected, associd %d\n", | DPRINTF(1, ("crypto_recv: possible attack detected, associd %d\n", | ||||
associd)); | associd)); | ||||
return XEVNT_LEN; | return XEVNT_LEN; | ||||
} | } | ||||
/* Check if the paylod of the extension fits into the | /* Check if the paylod of the extension fits into the | ||||
* declared frame. | * declared frame. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 3,599 Lines • Show Last 20 Lines |