Commit 8b1e54c4 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "This removes IPsec ESN support from the talitos/caam drivers since
  they were implemented incorrectly, causing interoperability problems
  if ESN is used with them."

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  Revert "crypto: caam - add IPsec ESN support"
  Revert "crypto: talitos - add IPsec ESN support"
parents d3f72cfb 246bbedb
...@@ -1650,11 +1650,7 @@ struct caam_alg_template { ...@@ -1650,11 +1650,7 @@ struct caam_alg_template {
}; };
static struct caam_alg_template driver_algs[] = { static struct caam_alg_template driver_algs[] = {
/* /* single-pass ipsec_esp descriptor */
* single-pass ipsec_esp descriptor
* authencesn(*,*) is also registered, although not present
* explicitly here.
*/
{ {
.name = "authenc(hmac(md5),cbc(aes))", .name = "authenc(hmac(md5),cbc(aes))",
.driver_name = "authenc-hmac-md5-cbc-aes-caam", .driver_name = "authenc-hmac-md5-cbc-aes-caam",
...@@ -2217,9 +2213,7 @@ static int __init caam_algapi_init(void) ...@@ -2217,9 +2213,7 @@ static int __init caam_algapi_init(void)
for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
/* TODO: check if h/w supports alg */ /* TODO: check if h/w supports alg */
struct caam_crypto_alg *t_alg; struct caam_crypto_alg *t_alg;
bool done = false;
authencesn:
t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]); t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]);
if (IS_ERR(t_alg)) { if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg); err = PTR_ERR(t_alg);
...@@ -2233,25 +2227,8 @@ static int __init caam_algapi_init(void) ...@@ -2233,25 +2227,8 @@ static int __init caam_algapi_init(void)
dev_warn(ctrldev, "%s alg registration failed\n", dev_warn(ctrldev, "%s alg registration failed\n",
t_alg->crypto_alg.cra_driver_name); t_alg->crypto_alg.cra_driver_name);
kfree(t_alg); kfree(t_alg);
} else { } else
list_add_tail(&t_alg->entry, &priv->alg_list); list_add_tail(&t_alg->entry, &priv->alg_list);
if (driver_algs[i].type == CRYPTO_ALG_TYPE_AEAD &&
!memcmp(driver_algs[i].name, "authenc", 7) &&
!done) {
char *name;
name = driver_algs[i].name;
memmove(name + 10, name + 7, strlen(name) - 7);
memcpy(name + 7, "esn", 3);
name = driver_algs[i].driver_name;
memmove(name + 10, name + 7, strlen(name) - 7);
memcpy(name + 7, "esn", 3);
done = true;
goto authencesn;
}
}
} }
if (!list_empty(&priv->alg_list)) if (!list_empty(&priv->alg_list))
dev_info(ctrldev, "%s algorithms registered in /proc/crypto\n", dev_info(ctrldev, "%s algorithms registered in /proc/crypto\n",
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/circ_buf.h> #include <linux/circ_buf.h>
#include <linux/string.h>
#include <net/xfrm.h> #include <net/xfrm.h>
#include <crypto/algapi.h> #include <crypto/algapi.h>
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h>
#include <crypto/algapi.h> #include <crypto/algapi.h>
#include <crypto/aes.h> #include <crypto/aes.h>
...@@ -1974,11 +1973,7 @@ struct talitos_alg_template { ...@@ -1974,11 +1973,7 @@ struct talitos_alg_template {
}; };
static struct talitos_alg_template driver_algs[] = { static struct talitos_alg_template driver_algs[] = {
/* /* AEAD algorithms. These use a single-pass ipsec_esp descriptor */
* AEAD algorithms. These use a single-pass ipsec_esp descriptor.
* authencesn(*,*) is also registered, although not present
* explicitly here.
*/
{ .type = CRYPTO_ALG_TYPE_AEAD, { .type = CRYPTO_ALG_TYPE_AEAD,
.alg.crypto = { .alg.crypto = {
.cra_name = "authenc(hmac(sha1),cbc(aes))", .cra_name = "authenc(hmac(sha1),cbc(aes))",
...@@ -2820,9 +2815,7 @@ static int talitos_probe(struct platform_device *ofdev) ...@@ -2820,9 +2815,7 @@ static int talitos_probe(struct platform_device *ofdev)
if (hw_supports(dev, driver_algs[i].desc_hdr_template)) { if (hw_supports(dev, driver_algs[i].desc_hdr_template)) {
struct talitos_crypto_alg *t_alg; struct talitos_crypto_alg *t_alg;
char *name = NULL; char *name = NULL;
bool authenc = false;
authencesn:
t_alg = talitos_alg_alloc(dev, &driver_algs[i]); t_alg = talitos_alg_alloc(dev, &driver_algs[i]);
if (IS_ERR(t_alg)) { if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg); err = PTR_ERR(t_alg);
...@@ -2837,8 +2830,6 @@ static int talitos_probe(struct platform_device *ofdev) ...@@ -2837,8 +2830,6 @@ static int talitos_probe(struct platform_device *ofdev)
err = crypto_register_alg( err = crypto_register_alg(
&t_alg->algt.alg.crypto); &t_alg->algt.alg.crypto);
name = t_alg->algt.alg.crypto.cra_driver_name; name = t_alg->algt.alg.crypto.cra_driver_name;
authenc = authenc ? !authenc :
!(bool)memcmp(name, "authenc", 7);
break; break;
case CRYPTO_ALG_TYPE_AHASH: case CRYPTO_ALG_TYPE_AHASH:
err = crypto_register_ahash( err = crypto_register_ahash(
...@@ -2851,25 +2842,8 @@ static int talitos_probe(struct platform_device *ofdev) ...@@ -2851,25 +2842,8 @@ static int talitos_probe(struct platform_device *ofdev)
dev_err(dev, "%s alg registration failed\n", dev_err(dev, "%s alg registration failed\n",
name); name);
kfree(t_alg); kfree(t_alg);
} else { } else
list_add_tail(&t_alg->entry, &priv->alg_list); list_add_tail(&t_alg->entry, &priv->alg_list);
if (authenc) {
struct crypto_alg *alg =
&driver_algs[i].alg.crypto;
name = alg->cra_name;
memmove(name + 10, name + 7,
strlen(name) - 7);
memcpy(name + 7, "esn", 3);
name = alg->cra_driver_name;
memmove(name + 10, name + 7,
strlen(name) - 7);
memcpy(name + 7, "esn", 3);
goto authencesn;
}
}
} }
} }
if (!list_empty(&priv->alg_list)) if (!list_empty(&priv->alg_list))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment