]> git.ipfire.org Git - thirdparty/bind9.git/commit
Remove a redundant variable-length array
authorTony Finch <fanf@isc.org>
Thu, 10 Mar 2022 13:04:08 +0000 (13:04 +0000)
committerTony Finch <fanf@isc.org>
Fri, 18 Mar 2022 17:21:57 +0000 (17:21 +0000)
commitafb5f59a6fe86c3b63e42bec8097b44e91d0b6e9
tree4bb3bdec8266d6be79e28d319ba01d22e4d69f8b
parent865808939b2b455dad4512764d55817ac8c9605d
Remove a redundant variable-length array

In the GSS-TSIG verification code there was an alarming
variable-length array whose size came off the network, from the
signature in the request. It turned out to be safe, because the caller
had previously checked that the signature had a reasonable size.
However, the safety checks are in the generic TSIG implementation, and
the risky VLA usage was in the GSS-specific code, and they are
separated by the DST indirection layer, so it wasn't immediately
obvious that the risky VLA was in fact safe.

In fact this risky VLA was completely unnecessary, because the GSS
signature can be verified in place without being copied to the stack,
like the message covered by the signature. The `REGION_TO_GBUFFER()`
macro backwardly assigns the region in its left argument to the GSS
buffer in its right argument; this is just a pointer and length
conversion, without copying any data. The `gss_verify_mic()` call uses
both message and signature GSS buffers in a read-only manner.
CHANGES
lib/dns/gssapi_link.c