diff options
author | Horia Geanta <horia.geanta@freescale.com> | 2013-03-20 10:31:58 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-03-21 05:36:03 -0400 |
commit | 246bbedb9aaf27e2207501d93a869023a439fce5 (patch) | |
tree | c63c3a43a262f3bbb15dfe5696bd2a17bd03b610 /drivers/crypto | |
parent | 991155bacb91c988c45586525771758ddadd44ce (diff) |
Revert "crypto: caam - add IPsec ESN support"
This reverts commit 891104ed008e8646c7860fe5bc70b0aac55dcc6c.
Current IPsec ESN implementation for authencesn(cbc(aes), hmac(sha))
(separate encryption and integrity algorithms) does not conform
to RFC4303.
ICV is generated by hashing the sequence
SPI, SeqNum-High, SeqNum-Low, IV, Payload
instead of
SPI, SeqNum-Low, IV, Payload, SeqNum-High.
Cc: <stable@vger.kernel.org> # 3.8, 3.7
Reported-by: Chaoxing Lin <Chaoxing.Lin@ultra-3eti.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/caamalg.c | 27 | ||||
-rw-r--r-- | drivers/crypto/caam/compat.h | 1 |
2 files changed, 2 insertions, 26 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index b2a0a0726a54..cf268b14ae9a 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c | |||
@@ -1650,11 +1650,7 @@ struct caam_alg_template { | |||
1650 | }; | 1650 | }; |
1651 | 1651 | ||
1652 | static struct caam_alg_template driver_algs[] = { | 1652 | static struct caam_alg_template driver_algs[] = { |
1653 | /* | 1653 | /* single-pass ipsec_esp descriptor */ |
1654 | * single-pass ipsec_esp descriptor | ||
1655 | * authencesn(*,*) is also registered, although not present | ||
1656 | * explicitly here. | ||
1657 | */ | ||
1658 | { | 1654 | { |
1659 | .name = "authenc(hmac(md5),cbc(aes))", | 1655 | .name = "authenc(hmac(md5),cbc(aes))", |
1660 | .driver_name = "authenc-hmac-md5-cbc-aes-caam", | 1656 | .driver_name = "authenc-hmac-md5-cbc-aes-caam", |
@@ -2217,9 +2213,7 @@ static int __init caam_algapi_init(void) | |||
2217 | for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { | 2213 | for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { |
2218 | /* TODO: check if h/w supports alg */ | 2214 | /* TODO: check if h/w supports alg */ |
2219 | struct caam_crypto_alg *t_alg; | 2215 | struct caam_crypto_alg *t_alg; |
2220 | bool done = false; | ||
2221 | 2216 | ||
2222 | authencesn: | ||
2223 | t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]); | 2217 | t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]); |
2224 | if (IS_ERR(t_alg)) { | 2218 | if (IS_ERR(t_alg)) { |
2225 | err = PTR_ERR(t_alg); | 2219 | err = PTR_ERR(t_alg); |
@@ -2233,25 +2227,8 @@ authencesn: | |||
2233 | dev_warn(ctrldev, "%s alg registration failed\n", | 2227 | dev_warn(ctrldev, "%s alg registration failed\n", |
2234 | t_alg->crypto_alg.cra_driver_name); | 2228 | t_alg->crypto_alg.cra_driver_name); |
2235 | kfree(t_alg); | 2229 | kfree(t_alg); |
2236 | } else { | 2230 | } else |
2237 | list_add_tail(&t_alg->entry, &priv->alg_list); | 2231 | list_add_tail(&t_alg->entry, &priv->alg_list); |
2238 | if (driver_algs[i].type == CRYPTO_ALG_TYPE_AEAD && | ||
2239 | !memcmp(driver_algs[i].name, "authenc", 7) && | ||
2240 | !done) { | ||
2241 | char *name; | ||
2242 | |||
2243 | name = driver_algs[i].name; | ||
2244 | memmove(name + 10, name + 7, strlen(name) - 7); | ||
2245 | memcpy(name + 7, "esn", 3); | ||
2246 | |||
2247 | name = driver_algs[i].driver_name; | ||
2248 | memmove(name + 10, name + 7, strlen(name) - 7); | ||
2249 | memcpy(name + 7, "esn", 3); | ||
2250 | |||
2251 | done = true; | ||
2252 | goto authencesn; | ||
2253 | } | ||
2254 | } | ||
2255 | } | 2232 | } |
2256 | if (!list_empty(&priv->alg_list)) | 2233 | if (!list_empty(&priv->alg_list)) |
2257 | dev_info(ctrldev, "%s algorithms registered in /proc/crypto\n", | 2234 | dev_info(ctrldev, "%s algorithms registered in /proc/crypto\n", |
diff --git a/drivers/crypto/caam/compat.h b/drivers/crypto/caam/compat.h index cf15e7813801..762aeff626ac 100644 --- a/drivers/crypto/caam/compat.h +++ b/drivers/crypto/caam/compat.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/debugfs.h> | 24 | #include <linux/debugfs.h> |
25 | #include <linux/circ_buf.h> | 25 | #include <linux/circ_buf.h> |
26 | #include <linux/string.h> | ||
27 | #include <net/xfrm.h> | 26 | #include <net/xfrm.h> |
28 | 27 | ||
29 | #include <crypto/algapi.h> | 28 | #include <crypto/algapi.h> |