diff options
author | jmg <jmg@FreeBSD.org> | 2015-08-04 17:47:11 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2015-08-04 17:47:11 +0000 |
commit | 20a77876c747677e14860ccb77e37ba572e7b1f2 (patch) | |
tree | 90da08143badbf5312e624a76e8aa042d2715ade /sys/netipsec/key_debug.c | |
parent | 97d3fe874dc469ad842c648127f280946d3c08ed (diff) | |
download | FreeBSD-src-20a77876c747677e14860ccb77e37ba572e7b1f2.zip FreeBSD-src-20a77876c747677e14860ccb77e37ba572e7b1f2.tar.gz |
Make IPsec work with AES-GCM and AES-ICM (aka CTR) in OCF... IPsec
defines the keys differently than NIST does, so we have to muck with
key lengths and nonce/IVs to be standard compliant...
Remove the iv from secasvar as it was unused...
Add a counter protected by a mutex to ensure that the counter for GCM
and ICM will never be repeated.. This is a requirement for security..
I would use atomics, but we don't have a 64bit one on all platforms..
Fix a bug where IPsec was depending upon the OCF to ensure that the
blocksize was always at least 4 bytes to maintain alignment... Move
this logic into IPsec so changes to OCF won't break IPsec...
In one place, espx was always non-NULL, so don't test that it's
non-NULL before doing work..
minor style cleanups...
drop setting key and klen as they were not used...
Enforce that OCF won't pass invalid key lengths to AES that would
panic the machine...
This was has been tested by others too... I tested this against
NetBSD 6.1.5 using mini-test suite in
https://github.com/jmgurney/ipseccfgs and the only things that don't
pass are keyed md5 and sha1, and 3des-deriv (setkey syntax error),
all other modes listed in setkey's man page... The nice thing is
that NetBSD uses setkey, so same config files were used on both...
Reviewed by: gnn
Diffstat (limited to 'sys/netipsec/key_debug.c')
-rw-r--r-- | sys/netipsec/key_debug.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/sys/netipsec/key_debug.c b/sys/netipsec/key_debug.c index 97ac061..b5bdb0e 100644 --- a/sys/netipsec/key_debug.c +++ b/sys/netipsec/key_debug.c @@ -577,11 +577,6 @@ kdebug_secasv(struct secasvar *sav) kdebug_sadb_key((struct sadb_ext *)sav->key_auth); if (sav->key_enc != NULL) kdebug_sadb_key((struct sadb_ext *)sav->key_enc); - if (sav->iv != NULL) { - printf(" iv="); - ipsec_hexdump(sav->iv, sav->ivlen ? sav->ivlen : 8); - printf("\n"); - } if (sav->replay != NULL) kdebug_secreplay(sav->replay); |