diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-03-30 08:38:54 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-03-30 08:38:54 +0000 |
commit | 113868f64840631a2b10a2e8987268f2c6566552 (patch) | |
tree | 087c05184fd083ca653d1b85bd10c3c51361bb4a /src/pluto/asn1.c | |
parent | c9e3aaf0657e98bc047486ba87edf1489a39ba94 (diff) | |
download | vyos-strongswan-113868f64840631a2b10a2e8987268f2c6566552.tar.gz vyos-strongswan-113868f64840631a2b10a2e8987268f2c6566552.zip |
- New upstream release.
Diffstat (limited to 'src/pluto/asn1.c')
-rw-r--r-- | src/pluto/asn1.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/pluto/asn1.c b/src/pluto/asn1.c index 0e50b8211..7436d4d1a 100644 --- a/src/pluto/asn1.c +++ b/src/pluto/asn1.c @@ -11,7 +11,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * RCSID $Id: asn1.c 3252 2007-10-06 21:24:50Z andreas $ + * RCSID $Id: asn1.c 3451 2008-02-05 19:27:05Z andreas $ */ #include <stdlib.h> @@ -758,13 +758,23 @@ is_asn1(chunk_t blob) ) return FALSE; } + len = asn1_length(&blob); - if (len != blob.len) + + /* exact match */ + if (len == blob.len) { - DBG(DBG_PARSING, - DBG_log(" file size does not match ASN.1 coded length"); - ) - return FALSE; + return TRUE; } - return TRUE; + + /* some websites append a surplus newline character to the blob */ + if (len + 1 == blob.len && *(blob.ptr + len) == '\n') + { + return TRUE; + } + + DBG(DBG_PARSING, + DBG_log(" file size does not match ASN.1 coded length"); + ) + return FALSE; } |