* [PATCH] Revert "crypto: caam - add IPsec ESN support"
@ 2013-03-20 14:15 Horia Geanta
2013-03-20 14:15 ` [PATCH] Revert "crypto: talitos " Horia Geanta
2013-03-20 14:26 ` [PATCH] Revert "crypto: caam " Horia Geantă
0 siblings, 2 replies; 7+ messages in thread
From: Horia Geanta @ 2013-03-20 14:15 UTC (permalink / raw)
To: linux-crypto
Cc: Herbert Xu, Chaoxing Lin, Steffen Klassert, Kim Phillips, stable,
3.7
This reverts commit 891104ed008e8646c7860fe5bc70b0aac55dcc6c
(upstream: 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>
---
drivers/crypto/caam/caamalg.c | 27 ++-------------------------
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 b2a0a07..cf268b1 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -1650,11 +1650,7 @@ struct caam_alg_template {
};
static struct caam_alg_template driver_algs[] = {
- /*
- * single-pass ipsec_esp descriptor
- * authencesn(*,*) is also registered, although not present
- * explicitly here.
- */
+ /* single-pass ipsec_esp descriptor */
{
.name = "authenc(hmac(md5),cbc(aes))",
.driver_name = "authenc-hmac-md5-cbc-aes-caam",
@@ -2217,9 +2213,7 @@ static int __init caam_algapi_init(void)
for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
/* TODO: check if h/w supports alg */
struct caam_crypto_alg *t_alg;
- bool done = false;
-authencesn:
t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]);
if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg);
@@ -2233,25 +2227,8 @@ authencesn:
dev_warn(ctrldev, "%s alg registration failed\n",
t_alg->crypto_alg.cra_driver_name);
kfree(t_alg);
- } else {
+ } else
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))
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 cf15e78..762aeff 100644
--- a/drivers/crypto/caam/compat.h
+++ b/drivers/crypto/caam/compat.h
@@ -23,7 +23,6 @@
#include <linux/types.h>
#include <linux/debugfs.h>
#include <linux/circ_buf.h>
-#include <linux/string.h>
#include <net/xfrm.h>
#include <crypto/algapi.h>
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] Revert "crypto: talitos - add IPsec ESN support"
2013-03-20 14:15 [PATCH] Revert "crypto: caam - add IPsec ESN support" Horia Geanta
@ 2013-03-20 14:15 ` Horia Geanta
2013-03-20 14:28 ` Horia Geantă
2013-03-20 14:26 ` [PATCH] Revert "crypto: caam " Horia Geantă
1 sibling, 1 reply; 7+ messages in thread
From: Horia Geanta @ 2013-03-20 14:15 UTC (permalink / raw)
To: linux-crypto
Cc: Herbert Xu, Chaoxing Lin, Steffen Klassert, Kim Phillips, stable,
3.7
This reverts commit e763eb699be723fb41af818118068c6b3afdaf8d
(upstream: 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>
---
drivers/crypto/talitos.c | 30 ++----------------------------
1 files changed, 2 insertions(+), 28 deletions(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 09b184a..5b2b5e6 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -38,7 +38,6 @@
#include <linux/spinlock.h>
#include <linux/rtnetlink.h>
#include <linux/slab.h>
-#include <linux/string.h>
#include <crypto/algapi.h>
#include <crypto/aes.h>
@@ -1974,11 +1973,7 @@ struct talitos_alg_template {
};
static struct talitos_alg_template driver_algs[] = {
- /*
- * AEAD algorithms. These use a single-pass ipsec_esp descriptor.
- * authencesn(*,*) is also registered, although not present
- * explicitly here.
- */
+ /* AEAD algorithms. These use a single-pass ipsec_esp descriptor */
{ .type = CRYPTO_ALG_TYPE_AEAD,
.alg.crypto = {
.cra_name = "authenc(hmac(sha1),cbc(aes))",
@@ -2820,9 +2815,7 @@ static int talitos_probe(struct platform_device *ofdev)
if (hw_supports(dev, driver_algs[i].desc_hdr_template)) {
struct talitos_crypto_alg *t_alg;
char *name = NULL;
- bool authenc = false;
-authencesn:
t_alg = talitos_alg_alloc(dev, &driver_algs[i]);
if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg);
@@ -2837,8 +2830,6 @@ authencesn:
err = crypto_register_alg(
&t_alg->algt.alg.crypto);
name = t_alg->algt.alg.crypto.cra_driver_name;
- authenc = authenc ? !authenc :
- !(bool)memcmp(name, "authenc", 7);
break;
case CRYPTO_ALG_TYPE_AHASH:
err = crypto_register_ahash(
@@ -2851,25 +2842,8 @@ authencesn:
dev_err(dev, "%s alg registration failed\n",
name);
kfree(t_alg);
- } else {
+ } else
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))
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Revert "crypto: caam - add IPsec ESN support"
2013-03-20 14:15 [PATCH] Revert "crypto: caam - add IPsec ESN support" Horia Geanta
2013-03-20 14:15 ` [PATCH] Revert "crypto: talitos " Horia Geanta
@ 2013-03-20 14:26 ` Horia Geantă
1 sibling, 0 replies; 7+ messages in thread
From: Horia Geantă @ 2013-03-20 14:26 UTC (permalink / raw)
To: linux-crypto
Cc: Herbert Xu, Chaoxing Lin, Steffen Klassert, Kim Phillips, stable
On 3/20/2013 4:15 PM, Horia Geanta wrote:
> This reverts commit 891104ed008e8646c7860fe5bc70b0aac55dcc6c
> (upstream: 891104ed008e8646c7860fe5bc70b0aac55dcc6c).
This line is not needed.
Will resend this with commit message updated.
Sorry for the noise.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Revert "crypto: talitos - add IPsec ESN support"
2013-03-20 14:15 ` [PATCH] Revert "crypto: talitos " Horia Geanta
@ 2013-03-20 14:28 ` Horia Geantă
0 siblings, 0 replies; 7+ messages in thread
From: Horia Geantă @ 2013-03-20 14:28 UTC (permalink / raw)
To: linux-crypto
Cc: Herbert Xu, Chaoxing Lin, Steffen Klassert, Kim Phillips, stable
On 3/20/2013 4:15 PM, Horia Geanta wrote:
> This reverts commit e763eb699be723fb41af818118068c6b3afdaf8d
> (upstream: 891104ed008e8646c7860fe5bc70b0aac55dcc6c).
This line is not needed.
Will resend this with commit message updated.
Sorry for the noise.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Revert "crypto: talitos - add IPsec ESN support"
@ 2013-03-20 14:31 Horia Geanta
2013-03-20 23:46 ` Kim Phillips
0 siblings, 1 reply; 7+ messages in thread
From: Horia Geanta @ 2013-03-20 14:31 UTC (permalink / raw)
To: linux-crypto
Cc: Herbert Xu, Chaoxing Lin, Steffen Klassert, Kim Phillips, stable
This reverts commit e763eb699be723fb41af818118068c6b3afdaf8d.
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>
---
drivers/crypto/talitos.c | 30 ++----------------------------
1 files changed, 2 insertions(+), 28 deletions(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 09b184a..5b2b5e6 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -38,7 +38,6 @@
#include <linux/spinlock.h>
#include <linux/rtnetlink.h>
#include <linux/slab.h>
-#include <linux/string.h>
#include <crypto/algapi.h>
#include <crypto/aes.h>
@@ -1974,11 +1973,7 @@ struct talitos_alg_template {
};
static struct talitos_alg_template driver_algs[] = {
- /*
- * AEAD algorithms. These use a single-pass ipsec_esp descriptor.
- * authencesn(*,*) is also registered, although not present
- * explicitly here.
- */
+ /* AEAD algorithms. These use a single-pass ipsec_esp descriptor */
{ .type = CRYPTO_ALG_TYPE_AEAD,
.alg.crypto = {
.cra_name = "authenc(hmac(sha1),cbc(aes))",
@@ -2820,9 +2815,7 @@ static int talitos_probe(struct platform_device *ofdev)
if (hw_supports(dev, driver_algs[i].desc_hdr_template)) {
struct talitos_crypto_alg *t_alg;
char *name = NULL;
- bool authenc = false;
-authencesn:
t_alg = talitos_alg_alloc(dev, &driver_algs[i]);
if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg);
@@ -2837,8 +2830,6 @@ authencesn:
err = crypto_register_alg(
&t_alg->algt.alg.crypto);
name = t_alg->algt.alg.crypto.cra_driver_name;
- authenc = authenc ? !authenc :
- !(bool)memcmp(name, "authenc", 7);
break;
case CRYPTO_ALG_TYPE_AHASH:
err = crypto_register_ahash(
@@ -2851,25 +2842,8 @@ authencesn:
dev_err(dev, "%s alg registration failed\n",
name);
kfree(t_alg);
- } else {
+ } else
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))
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Revert "crypto: talitos - add IPsec ESN support"
2013-03-20 14:31 [PATCH] Revert "crypto: talitos " Horia Geanta
@ 2013-03-20 23:46 ` Kim Phillips
2013-03-21 9:36 ` Herbert Xu
0 siblings, 1 reply; 7+ messages in thread
From: Kim Phillips @ 2013-03-20 23:46 UTC (permalink / raw)
To: Horia Geanta
Cc: linux-crypto, Herbert Xu, Chaoxing Lin, Steffen Klassert, stable
On Wed, 20 Mar 2013 16:31:38 +0200
Horia Geanta <horia.geanta@freescale.com> wrote:
> This reverts commit e763eb699be723fb41af818118068c6b3afdaf8d.
>
> 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>
Kim
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Revert "crypto: talitos - add IPsec ESN support"
2013-03-20 23:46 ` Kim Phillips
@ 2013-03-21 9:36 ` Herbert Xu
0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2013-03-21 9:36 UTC (permalink / raw)
To: Kim Phillips
Cc: Horia Geanta, linux-crypto, Chaoxing Lin, Steffen Klassert,
stable
On Wed, Mar 20, 2013 at 06:46:34PM -0500, Kim Phillips wrote:
> On Wed, 20 Mar 2013 16:31:38 +0200
> Horia Geanta <horia.geanta@freescale.com> wrote:
>
> > This reverts commit e763eb699be723fb41af818118068c6b3afdaf8d.
> >
> > 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>
Both patches applied to crypto. Thanks!
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-03-21 9:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 14:15 [PATCH] Revert "crypto: caam - add IPsec ESN support" Horia Geanta
2013-03-20 14:15 ` [PATCH] Revert "crypto: talitos " Horia Geanta
2013-03-20 14:28 ` Horia Geantă
2013-03-20 14:26 ` [PATCH] Revert "crypto: caam " Horia Geantă
-- strict thread matches above, loose matches on Subject: below --
2013-03-20 14:31 [PATCH] Revert "crypto: talitos " Horia Geanta
2013-03-20 23:46 ` Kim Phillips
2013-03-21 9:36 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).