]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ipsec: Use the same keysize values for HMAC as prior to r324017
authorConrad Meyer <cem@FreeBSD.org>
Wed, 15 Nov 2017 22:42:20 +0000 (22:42 +0000)
committerConrad Meyer <cem@FreeBSD.org>
Wed, 15 Nov 2017 22:42:20 +0000 (22:42 +0000)
commitf95f6841c8a6160d05a83d68e8a33e85cb63d700
tree24113467ad57f54248a81c2c62a796f9f63b6871
parentedb01d11f89618f0bfb1db67682effb1dd9fa781
ipsec: Use the same keysize values for HMAC as prior to r324017

The HMAC construction natively permits any key size between 0 and the input
block length. Before r324017, the auth_hash 'keysize' member was the hash
output length, which was used by ipsec for key sizes. (Non-ipsec consumers
need the ability to use other keysizes, hence, r324017.)

The ipsec SADB code blindly uses the auth_hash 'keysize' member for both
minimum and maximum key size, which is wrong (from an HMAC perspective).
For now, just switch it to 'hashsize', which matches the existing
expectations.

Instead it should probably use the range [0, keysize]. But there may be
other broken code in ipsec that rejects hashes with too small a minimum
key size.

Reported by: olivier@
Reviewed by: olivier, no objection from ae
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12770
sys/netipsec/key.c