diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/Symbols.list | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_bitstr.c | 29 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/asn1.h | 3 |
5 files changed, 3 insertions, 35 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index f9f1b10c22..110a3fa9c5 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
@@ -26,7 +26,6 @@ ASIdentifiers_free | |||
26 | ASIdentifiers_it | 26 | ASIdentifiers_it |
27 | ASIdentifiers_new | 27 | ASIdentifiers_new |
28 | ASN1_ANY_it | 28 | ASN1_ANY_it |
29 | ASN1_BIT_STRING_check | ||
30 | ASN1_BIT_STRING_free | 29 | ASN1_BIT_STRING_free |
31 | ASN1_BIT_STRING_get_bit | 30 | ASN1_BIT_STRING_get_bit |
32 | ASN1_BIT_STRING_it | 31 | ASN1_BIT_STRING_it |
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index 50803c59bb..eada22cc44 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
@@ -931,7 +931,6 @@ _libre_i2d_ASN1_BIT_STRING | |||
931 | _libre_ASN1_BIT_STRING_set | 931 | _libre_ASN1_BIT_STRING_set |
932 | _libre_ASN1_BIT_STRING_set_bit | 932 | _libre_ASN1_BIT_STRING_set_bit |
933 | _libre_ASN1_BIT_STRING_get_bit | 933 | _libre_ASN1_BIT_STRING_get_bit |
934 | _libre_ASN1_BIT_STRING_check | ||
935 | _libre_ASN1_BIT_STRING_name_print | 934 | _libre_ASN1_BIT_STRING_name_print |
936 | _libre_ASN1_BIT_STRING_num_asc | 935 | _libre_ASN1_BIT_STRING_num_asc |
937 | _libre_ASN1_BIT_STRING_set_asc | 936 | _libre_ASN1_BIT_STRING_set_asc |
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c index 8076723de8..b985db60da 100644 --- a/src/lib/libcrypto/asn1/a_bitstr.c +++ b/src/lib/libcrypto/asn1/a_bitstr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_bitstr.c,v 1.39 2023/07/05 21:23:36 beck Exp $ */ | 1 | /* $OpenBSD: a_bitstr.c,v 1.40 2023/07/28 10:30:16 tb 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 | * |
@@ -162,33 +162,6 @@ ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n) | |||
162 | } | 162 | } |
163 | LCRYPTO_ALIAS(ASN1_BIT_STRING_get_bit); | 163 | LCRYPTO_ALIAS(ASN1_BIT_STRING_get_bit); |
164 | 164 | ||
165 | /* | ||
166 | * Checks if the given bit string contains only bits specified by | ||
167 | * the flags vector. Returns 0 if there is at least one bit set in 'a' | ||
168 | * which is not specified in 'flags', 1 otherwise. | ||
169 | * 'len' is the length of 'flags'. | ||
170 | */ | ||
171 | int | ||
172 | ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags, | ||
173 | int flags_len) | ||
174 | { | ||
175 | int i, ok; | ||
176 | |||
177 | /* Check if there is one bit set at all. */ | ||
178 | if (!a || !a->data) | ||
179 | return 1; | ||
180 | |||
181 | /* Check each byte of the internal representation of the bit string. */ | ||
182 | ok = 1; | ||
183 | for (i = 0; i < a->length && ok; ++i) { | ||
184 | unsigned char mask = i < flags_len ? ~flags[i] : 0xff; | ||
185 | /* We are done if there is an unneeded bit set. */ | ||
186 | ok = (a->data[i] & mask) == 0; | ||
187 | } | ||
188 | return ok; | ||
189 | } | ||
190 | LCRYPTO_ALIAS(ASN1_BIT_STRING_check); | ||
191 | |||
192 | int | 165 | int |
193 | ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, | 166 | ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, |
194 | BIT_STRING_BITNAME *tbl, int indent) | 167 | BIT_STRING_BITNAME *tbl, int indent) |
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index bef5cb4808..51fb2862cd 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1.h,v 1.78 2023/07/28 10:02:11 tb Exp $ */ | 1 | /* $OpenBSD: asn1.h,v 1.79 2023/07/28 10:30:16 tb 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 | * |
@@ -576,8 +576,6 @@ extern const ASN1_ITEM ASN1_BIT_STRING_it; | |||
576 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); | 576 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); |
577 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); | 577 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); |
578 | int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); | 578 | int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); |
579 | int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, | ||
580 | const unsigned char *flags, int flags_len); | ||
581 | 579 | ||
582 | #ifndef OPENSSL_NO_BIO | 580 | #ifndef OPENSSL_NO_BIO |
583 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, | 581 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, |
diff --git a/src/lib/libcrypto/hidden/openssl/asn1.h b/src/lib/libcrypto/hidden/openssl/asn1.h index 2a1eda1a89..087d1294c1 100644 --- a/src/lib/libcrypto/hidden/openssl/asn1.h +++ b/src/lib/libcrypto/hidden/openssl/asn1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1.h,v 1.4 2023/07/28 10:02:11 tb Exp $ */ | 1 | /* $OpenBSD: asn1.h,v 1.5 2023/07/28 10:30:16 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -61,7 +61,6 @@ LCRYPTO_USED(i2d_ASN1_BIT_STRING); | |||
61 | LCRYPTO_USED(ASN1_BIT_STRING_set); | 61 | LCRYPTO_USED(ASN1_BIT_STRING_set); |
62 | LCRYPTO_USED(ASN1_BIT_STRING_set_bit); | 62 | LCRYPTO_USED(ASN1_BIT_STRING_set_bit); |
63 | LCRYPTO_USED(ASN1_BIT_STRING_get_bit); | 63 | LCRYPTO_USED(ASN1_BIT_STRING_get_bit); |
64 | LCRYPTO_USED(ASN1_BIT_STRING_check); | ||
65 | LCRYPTO_USED(ASN1_BIT_STRING_name_print); | 64 | LCRYPTO_USED(ASN1_BIT_STRING_name_print); |
66 | LCRYPTO_USED(ASN1_BIT_STRING_num_asc); | 65 | LCRYPTO_USED(ASN1_BIT_STRING_num_asc); |
67 | LCRYPTO_USED(ASN1_BIT_STRING_set_asc); | 66 | LCRYPTO_USED(ASN1_BIT_STRING_set_asc); |