freebsd-dev/sys
Conrad Meyer 3693b18840 opencrypto: Loosen restriction on HMAC key sizes
Theoretically, HMACs do not actually have any limit on key sizes.
Transforms should compact input keys larger than the HMAC block size by
using the transform (hash) on the input key.

(Short input keys are padded out with zeros to the HMAC block size.)

Still, not all FreeBSD crypto drivers that provide HMAC functionality
handle longer-than-blocksize keys appropriately, so enforce a "maximum" key
length in the crypto API for auth_hashes that previously expressed a
requirement.  (The "maximum" is the size of a single HMAC block for the
given transform.)  Unconstrained auth_hashes are left as-is.

I believe the previous hardcoded sizes were committed in the original
import of opencrypto from OpenBSD and are due to specific protocol
details of IPSec.  Note that none of the previous sizes actually matched
the appropriate HMAC block size.

The previous hardcoded sizes made the SHA tests in cryptotest.py
useless for testing FreeBSD crypto drivers; none of the NIST-KAT example
inputs had keys sized to the previous expectations.

The following drivers were audited to check that they handled keys up to
the block size of the HMAC safely:

  Software HMAC:
    * padlock(4)
    * cesa
    * glxsb
    * safe(4)
    * ubsec(4)

  Hardware accelerated HMAC:
    * ccr(4)
    * hifn(4)
    * sec(4) (Only supports up to 64 byte keys despite claiming to
      support SHA2 HMACs, but validates input key sizes)
    * cryptocteon (MIPS)
    * nlmsec (MIPS)
    * rmisec (MIPS) (Amusingly, does not appear to use key material at
      all -- presumed broken)

Reviewed by:	jhb (previous version), rlibby (previous version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12437
2017-09-26 16:18:10 +00:00
..
amd64 Do not do torn writes to active LDTs. 2017-09-19 17:57:04 +00:00
arm Remove the VIRT kernel config, it's now useable through GENERIC. 2017-09-24 13:28:24 +00:00
arm64 Fix indentation for r323068 2017-09-19 20:40:05 +00:00
boot libefi: efipart_floppy() will should not pass acpi pointer if the HID test fails 2017-09-25 19:49:56 +00:00
bsm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
cam cam iosched: Bettar account IOPS for smoother performance 2017-09-22 02:36:36 +00:00
cddl fix r324011, MFV of r323535, 8585 improve batching done in zil_commit() 2017-09-26 15:38:16 +00:00
compat Small style(9) issue: spaces vs TAB. 2017-09-24 20:57:03 +00:00
conf Miscellaneous fixes and improvements to MMCCAM stack 2017-09-15 19:47:44 +00:00
contrib Modernize the use of vm_page_unwire(). Since r288122, vm_page_unwire() 2017-09-24 22:29:11 +00:00
crypto opencrypto: Loosen restriction on HMAC key sizes 2017-09-26 16:18:10 +00:00
ddb Rename mkdumpheader() and group EKCD functions in kern_shutdown.c. 2017-08-18 04:04:09 +00:00
dev Fix gcc compilation issues in the mvneta driver 2017-09-25 02:06:51 +00:00
fs Use tmpfs_print for tmpfs FIFOs. 2017-09-25 20:26:16 +00:00
gdb
geom g_resize_provider_event: Do not invoke orphan method twice 2017-09-24 19:59:26 +00:00
gnu Update DTS files from Linux 4.12 2017-07-09 13:53:32 +00:00
i386 Fix indentation for r323068 2017-09-19 20:40:05 +00:00
isa Use better hard-coded defaults for the cursor shape, and remove nearby 2017-08-19 19:33:16 +00:00
kern Log signal number passed to PT_STEP requests in KTR_PTRACE traces. 2017-09-25 20:38:55 +00:00
kgssapi
libkern Continuing efforts to provide hardening of FFS, this change adds a 2017-09-22 12:45:15 +00:00
mips Add MIPS32/64 Rev2 CP0 intctl register definitions. 2017-09-15 19:56:21 +00:00
modules Give icee(4) a detach() method so it can be used as a module. Add a 2017-09-17 22:58:13 +00:00
net Have ifmp_ring_enqueue() abdicate instead of switch to a consumer 2017-09-23 16:46:30 +00:00
net80211 net80211: fix a typo (premable -> preamble). 2017-08-27 22:13:03 +00:00
netgraph Unprotected modification of ng_iface(4) private data leads to kernel panic. 2017-09-21 20:16:10 +00:00
netinet Add missing locking. Found by Coverity while scanning the usrsctp 2017-09-22 06:33:01 +00:00
netinet6 Fix a locking issue found by Coverity scanning the usrsctp library. 2017-09-09 20:51:54 +00:00
netipsec opencrypto: Loosen restriction on HMAC key sizes 2017-09-26 16:18:10 +00:00
netpfil Use in_localip() function instead of unlocked access to addresses hash 2017-09-20 22:35:28 +00:00
netsmb
nfs Improve FHA locality control for NFS read/write requests. 2017-07-31 15:23:19 +00:00
nfsclient Add an NFSv4.1 mount option for "use one openowner". 2017-04-13 21:54:19 +00:00
nfsserver
nlm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
ofed Remove unsafe access to the LinuxKPI file structure from ibcore. 2017-09-09 06:34:20 +00:00
opencrypto opencrypto: Loosen restriction on HMAC key sizes 2017-09-26 16:18:10 +00:00
powerpc Fix indentation for r323068 2017-09-19 20:40:05 +00:00
riscv Sync with amd64/arm/arm64/i386/mips pmap change r288256: 2017-09-20 04:19:49 +00:00
rpc Listening sockets improvements. 2017-06-08 21:30:34 +00:00
security Sprinkle __read_frequently on few obvious places. 2017-09-06 20:33:33 +00:00
sparc64 Fix indentation for r323068 2017-09-19 20:40:05 +00:00
sys Make struct grouptask gt_name member a char array 2017-09-23 01:39:16 +00:00
teken Fix syscons escape sequence for setting the local cursor type. This sequence 2017-08-18 15:40:40 +00:00
tests style(9): sort headers 2017-05-09 05:08:47 +00:00
tools make.conf: Add the possibility to use another DTC 2017-06-17 23:34:53 +00:00
ufs Fix 32bit build. 2017-09-22 16:42:41 +00:00
vm Change vm_page_try_to_free() to require a managed page. Essentially, 2017-09-24 23:35:01 +00:00
x86 x86: Decode AMD "Extended Feature Extensions ID EBX" bits 2017-09-20 18:30:37 +00:00
xdr * limit size of buffers to RPC_MAXDATASIZE 2017-06-01 06:12:25 +00:00
xen
Makefile Remove glimpse make target added in r181432 2017-05-22 15:53:30 +00:00