diff options
| author | tb <> | 2022-05-24 19:56:13 +0000 |
|---|---|---|
| committer | tb <> | 2022-05-24 19:56:13 +0000 |
| commit | 3200a91003fa6066f7d8fe64ab97cb6f3c2f78c0 (patch) | |
| tree | e9b11ffb26053c3262a4d8c1bbd5b47b3b3b85a8 /src/lib/libcrypto/asn1/asn1_gen.c | |
| parent | 1b3351c74f01f6fb9bd1b557012d9fd4d43ae9a8 (diff) | |
| download | openbsd-3200a91003fa6066f7d8fe64ab97cb6f3c2f78c0.tar.gz openbsd-3200a91003fa6066f7d8fe64ab97cb6f3c2f78c0.tar.bz2 openbsd-3200a91003fa6066f7d8fe64ab97cb6f3c2f78c0.zip | |
Use asn1_abs_set_unused_bits() in asn1_str2type()
ok jsing
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_gen.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1_gen.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_gen.c b/src/lib/libcrypto/asn1/asn1_gen.c index d800b77a6a..a37091ce7d 100644 --- a/src/lib/libcrypto/asn1/asn1_gen.c +++ b/src/lib/libcrypto/asn1/asn1_gen.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: asn1_gen.c,v 1.18 2021/12/25 13:17:48 jsing Exp $ */ | 1 | /* $OpenBSD: asn1_gen.c,v 1.19 2022/05/24 19:56:13 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 2002. | 3 | * project 2002. |
| 4 | */ | 4 | */ |
| @@ -62,6 +62,8 @@ | |||
| 62 | #include <openssl/err.h> | 62 | #include <openssl/err.h> |
| 63 | #include <openssl/x509v3.h> | 63 | #include <openssl/x509v3.h> |
| 64 | 64 | ||
| 65 | #include "asn1_locl.h" | ||
| 66 | |||
| 65 | #define ASN1_GEN_FLAG 0x10000 | 67 | #define ASN1_GEN_FLAG 0x10000 |
| 66 | #define ASN1_GEN_FLAG_IMP (ASN1_GEN_FLAG|1) | 68 | #define ASN1_GEN_FLAG_IMP (ASN1_GEN_FLAG|1) |
| 67 | #define ASN1_GEN_FLAG_EXP (ASN1_GEN_FLAG|2) | 69 | #define ASN1_GEN_FLAG_EXP (ASN1_GEN_FLAG|2) |
| @@ -754,10 +756,9 @@ asn1_str2type(const char *str, int format, int utype) | |||
| 754 | } | 756 | } |
| 755 | 757 | ||
| 756 | if ((utype == V_ASN1_BIT_STRING) && no_unused) { | 758 | if ((utype == V_ASN1_BIT_STRING) && no_unused) { |
| 757 | atmp->value.asn1_string->flags &= | 759 | if (!asn1_abs_set_unused_bits(atmp->value.asn1_string, |
| 758 | ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); | 760 | 0)) |
| 759 | atmp->value.asn1_string->flags |= | 761 | goto bad_str; |
| 760 | ASN1_STRING_FLAG_BITS_LEFT; | ||
| 761 | } | 762 | } |
| 762 | 763 | ||
| 763 | break; | 764 | break; |
