netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "David S. Miller" <davem@redhat.com>, netdev@oss.sgi.com
Subject: Re: [ESP] Only one algorithm is required
Date: Sat, 14 Aug 2004 20:52:45 +1000	[thread overview]
Message-ID: <20040814105245.GA20646@gondor.apana.org.au> (raw)
In-Reply-To: <20040814104807.GA20572@gondor.apana.org.au>

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

Hi Dave:

I wrote the wrong subject for the last patch.  It was really
meant for this one :)

Both encryption and authentication are optional for ESP.  However, at
least one of them must be present.  The following patch changes init_state
to match that specification.  It also changes the IPv6 ESP check to allow
zero-length authentication keys as is the case with the IPv4 version.
 
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: esp-alg-check --]
[-- Type: text/plain, Size: 842 bytes --]

===== net/ipv4/esp4.c 1.55 vs edited =====
--- 1.55/net/ipv4/esp4.c	2004-08-12 19:59:52 +10:00
+++ edited/net/ipv4/esp4.c	2004-08-14 09:33:05 +10:00
@@ -372,8 +372,7 @@
 	if (x->aalg) {
 		if (x->aalg->alg_key_len > 512)
 			goto error;
-	}
-	if (x->ealg == NULL)
+	} else if (x->ealg == NULL)
 		goto error;
 
 	esp = kmalloc(sizeof(*esp), GFP_KERNEL);
===== net/ipv6/esp6.c 1.36 vs edited =====
--- 1.36/net/ipv6/esp6.c	2004-08-12 19:59:52 +10:00
+++ edited/net/ipv6/esp6.c	2004-08-14 09:33:25 +10:00
@@ -302,11 +302,11 @@
 {
 	struct esp_data *esp = NULL;
 
+	/* null auth and encryption can have zero length keys */
 	if (x->aalg) {
-		if (x->aalg->alg_key_len == 0 || x->aalg->alg_key_len > 512)
+		if (x->aalg->alg_key_len > 512)
 			goto error;
-	}
-	if (x->ealg == NULL)
+	} else if (x->ealg == NULL)
 		goto error;
 
 	if (x->encap)

  reply	other threads:[~2004-08-14 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-14 10:48 [ESP] Only one algorithm is required Herbert Xu
2004-08-14 10:52 ` Herbert Xu [this message]
2004-08-14 14:16   ` James Morris
2004-08-14 19:24     ` Herbert Xu
2004-08-14 19:56       ` Herbert Xu
2004-08-16  2:54         ` David S. Miller
2004-08-16  2:55 ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040814105245.GA20646@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).