summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authormiod <>2014-07-11 14:49:12 +0000
committermiod <>2014-07-11 14:49:12 +0000
commitb6f66ef7a475c9fa45a9b91e4b9e9f0a5b40ec6e (patch)
treeedeb4851f369965e38e544698d000f6930e7c890 /src/lib
parentffd8e2b0a176e17f7cc153964317616117fe8413 (diff)
downloadopenbsd-b6f66ef7a475c9fa45a9b91e4b9e9f0a5b40ec6e.tar.gz
openbsd-b6f66ef7a475c9fa45a9b91e4b9e9f0a5b40ec6e.tar.bz2
openbsd-b6f66ef7a475c9fa45a9b91e4b9e9f0a5b40ec6e.zip
In ASN1_get_object(), reject primitive encodings using the indefinite length
constructed form. OpenSSL PR #2438 via OpenSSL trunk
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn1_lib.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index d851339753..2b952abae6 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.31 2014/07/11 14:22:55 miod Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.32 2014/07/11 14:49:12 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -137,6 +137,9 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
137 if (!asn1_get_length(&p, &inf, plength, (int)max)) 137 if (!asn1_get_length(&p, &inf, plength, (int)max))
138 goto err; 138 goto err;
139 139
140 if (inf && !(ret & V_ASN1_CONSTRUCTED))
141 goto err;
142
140#if 0 143#if 0
141 fprintf(stderr, "p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n", 144 fprintf(stderr, "p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n",
142 (int)p, *plength, omax, (int)*pp, (int)(p+ *plength), 145 (int)p, *plength, omax, (int)*pp, (int)(p+ *plength),
diff --git a/src/lib/libssl/src/crypto/asn1/asn1_lib.c b/src/lib/libssl/src/crypto/asn1/asn1_lib.c
index d851339753..2b952abae6 100644
--- a/src/lib/libssl/src/crypto/asn1/asn1_lib.c
+++ b/src/lib/libssl/src/crypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.31 2014/07/11 14:22:55 miod Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.32 2014/07/11 14:49:12 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -137,6 +137,9 @@ ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
137 if (!asn1_get_length(&p, &inf, plength, (int)max)) 137 if (!asn1_get_length(&p, &inf, plength, (int)max))
138 goto err; 138 goto err;
139 139
140 if (inf && !(ret & V_ASN1_CONSTRUCTED))
141 goto err;
142
140#if 0 143#if 0
141 fprintf(stderr, "p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n", 144 fprintf(stderr, "p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n",
142 (int)p, *plength, omax, (int)*pp, (int)(p+ *plength), 145 (int)p, *plength, omax, (int)*pp, (int)(p+ *plength),