When writing out a PDU with authpriv that's larger than READ_BUF_SIZE
authormartijn <martijn@openbsd.org>
Tue, 20 Dec 2022 20:01:25 +0000 (20:01 +0000)
committermartijn <martijn@openbsd.org>
Tue, 20 Dec 2022 20:01:25 +0000 (20:01 +0000)
commit5d518481432a0e7cc6f870f8015b12d640a28de0
treeea4d8ded33faa304500cbccb83beea3af82cc571
parent7c988be6ed697819e9c275b19ed380892163ce74
When writing out a PDU with authpriv that's larger than READ_BUF_SIZE
we overflow the encbuf. Allocate encbuf on the fly so that we always have
enough room.

Give decryption the same treatment, although this one is not at risk, since
the input is limited to READ_BUF_SIZE.

OK sthen@, kn@
usr.sbin/snmpd/usm.c