diff options
author | Andrey V. Elsukov <ae@FreeBSD.org> | 2015-11-16 07:10:42 +0000 |
---|---|---|
committer | Andrey V. Elsukov <ae@FreeBSD.org> | 2015-11-16 07:10:42 +0000 |
commit | 0c80e7df436b13daaa144f1228c8de445740822f (patch) | |
tree | c0b5fb4d85d387aee141d8b8fc3d47209f3c93cd | |
parent | e742867ba480eaa26a59781f8225844055dcefee (diff) |
Notes
-rw-r--r-- | sys/netipsec/key.c | 2 | ||||
-rw-r--r-- | sys/netipsec/xform_esp.c | 8 | ||||
-rw-r--r-- | sys/opencrypto/xform.c | 2 |
3 files changed, 3 insertions, 9 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 9927509a4524b..7af23cf6c4465 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -6706,7 +6706,7 @@ key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) continue; alg = (struct sadb_alg *)(mtod(n, caddr_t) + off); alg->sadb_alg_id = i; - alg->sadb_alg_ivlen = ealgo->blocksize; + alg->sadb_alg_ivlen = ealgo->ivsize; alg->sadb_alg_minbits = _BITS(ealgo->minkey); alg->sadb_alg_maxbits = _BITS(ealgo->maxkey); off += PFKEY_ALIGN8(sizeof(struct sadb_alg)); diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 9f645c0c4f55b..c8b5f16417f12 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -200,16 +200,10 @@ esp_init(struct secasvar *sav, struct xformsw *xsp) return EINVAL; } - /* - * NB: The null xform needs a non-zero blocksize to keep the - * crypto code happy but if we use it to set ivlen then - * the ESP header will be processed incorrectly. The - * compromise is to force it to zero here. - */ if (SAV_ISCTRORGCM(sav)) sav->ivlen = 8; /* RFC4106 3.1 and RFC3686 3.1 */ else - sav->ivlen = (txform == &enc_xform_null ? 0 : txform->ivsize); + sav->ivlen = txform->ivsize; /* * Setup AH-related state. diff --git a/sys/opencrypto/xform.c b/sys/opencrypto/xform.c index cb44bfad029ab..3dee3664e0a4b 100644 --- a/sys/opencrypto/xform.c +++ b/sys/opencrypto/xform.c @@ -154,7 +154,7 @@ MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers"); struct enc_xform enc_xform_null = { CRYPTO_NULL_CBC, "NULL", /* NB: blocksize of 4 is to generate a properly aligned ESP header */ - NULL_BLOCK_LEN, NULL_BLOCK_LEN, NULL_MIN_KEY, NULL_MAX_KEY, + NULL_BLOCK_LEN, 0, NULL_MIN_KEY, NULL_MAX_KEY, null_encrypt, null_decrypt, null_setkey, |