Commit f3537f91 authored by David Howells's avatar David Howells Committed by Rusty Russell

ASN.1: Fix an indefinite length skip error

Fix an error in asn1_find_indefinite_length() whereby small definite length
elements of size 0x7f are incorrecly classified as non-small.  Without this
fix, an error will be given as the length of the length will be perceived as
being very much greater than the maximum supported size.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 12e130b0
...@@ -91,7 +91,7 @@ static int asn1_find_indefinite_length(const unsigned char *data, size_t datalen ...@@ -91,7 +91,7 @@ static int asn1_find_indefinite_length(const unsigned char *data, size_t datalen
/* Extract the length */ /* Extract the length */
len = data[dp++]; len = data[dp++];
if (len < 0x7f) { if (len <= 0x7f) {
dp += len; dp += len;
goto next_tag; goto next_tag;
} }
......
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