diff options
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_par.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_par.c b/src/lib/libcrypto/asn1/asn1_par.c index 2d1c7b2b48..6c14f271b6 100644 --- a/src/lib/libcrypto/asn1/asn1_par.c +++ b/src/lib/libcrypto/asn1/asn1_par.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1_par.c,v 1.33 2022/01/20 10:49:56 inoguchi Exp $ */ | 1 | /* $OpenBSD: asn1_par.c,v 1.34 2022/02/12 03:07:24 jsing 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 | * |
@@ -233,12 +233,13 @@ asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset, | |||
233 | goto end; | 233 | goto end; |
234 | } | 234 | } |
235 | } else if (tag == V_ASN1_BOOLEAN) { | 235 | } else if (tag == V_ASN1_BOOLEAN) { |
236 | if (len != 1 || p >= tot) { | 236 | if (len == 1 && p < tot) { |
237 | BIO_printf(bp, ":%u", p[0]); | ||
238 | } else { | ||
237 | if (BIO_write(bp, "Bad boolean\n", | 239 | if (BIO_write(bp, "Bad boolean\n", |
238 | 12) <= 0) | 240 | 12) <= 0) |
239 | goto end; | 241 | goto end; |
240 | } | 242 | } |
241 | BIO_printf(bp, ":%u", p[0]); | ||
242 | } else if (tag == V_ASN1_BMPSTRING) { | 243 | } else if (tag == V_ASN1_BMPSTRING) { |
243 | /* do the BMP thang */ | 244 | /* do the BMP thang */ |
244 | } else if (tag == V_ASN1_OCTET_STRING) { | 245 | } else if (tag == V_ASN1_OCTET_STRING) { |