From: tb Date: Fri, 28 Jul 2023 10:30:16 +0000 (+0000) Subject: Remove ASN1_BIT_STRING_check X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1411e9ef2a4ec93e44d8b2cd207dd80b45d88efe;p=openbsd Remove ASN1_BIT_STRING_check This was added with the TS code for no discernible reason. I could not find a single consumer. In the unlikely event that you need this, it is easy enough to write a better version of it yourself. ok jsing --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index f9f1b10c22d..110a3fa9c5a 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -26,7 +26,6 @@ ASIdentifiers_free ASIdentifiers_it ASIdentifiers_new ASN1_ANY_it -ASN1_BIT_STRING_check ASN1_BIT_STRING_free ASN1_BIT_STRING_get_bit ASN1_BIT_STRING_it diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 50803c59bbc..eada22cc441 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -931,7 +931,6 @@ _libre_i2d_ASN1_BIT_STRING _libre_ASN1_BIT_STRING_set _libre_ASN1_BIT_STRING_set_bit _libre_ASN1_BIT_STRING_get_bit -_libre_ASN1_BIT_STRING_check _libre_ASN1_BIT_STRING_name_print _libre_ASN1_BIT_STRING_num_asc _libre_ASN1_BIT_STRING_set_asc diff --git a/lib/libcrypto/asn1/a_bitstr.c b/lib/libcrypto/asn1/a_bitstr.c index 8076723de8c..b985db60da6 100644 --- a/lib/libcrypto/asn1/a_bitstr.c +++ b/lib/libcrypto/asn1/a_bitstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_bitstr.c,v 1.39 2023/07/05 21:23:36 beck Exp $ */ +/* $OpenBSD: a_bitstr.c,v 1.40 2023/07/28 10:30:16 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -162,33 +162,6 @@ ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n) } LCRYPTO_ALIAS(ASN1_BIT_STRING_get_bit); -/* - * Checks if the given bit string contains only bits specified by - * the flags vector. Returns 0 if there is at least one bit set in 'a' - * which is not specified in 'flags', 1 otherwise. - * 'len' is the length of 'flags'. - */ -int -ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags, - int flags_len) -{ - int i, ok; - - /* Check if there is one bit set at all. */ - if (!a || !a->data) - return 1; - - /* Check each byte of the internal representation of the bit string. */ - ok = 1; - for (i = 0; i < a->length && ok; ++i) { - unsigned char mask = i < flags_len ? ~flags[i] : 0xff; - /* We are done if there is an unneeded bit set. */ - ok = (a->data[i] & mask) == 0; - } - return ok; -} -LCRYPTO_ALIAS(ASN1_BIT_STRING_check); - int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, BIT_STRING_BITNAME *tbl, int indent) diff --git a/lib/libcrypto/asn1/asn1.h b/lib/libcrypto/asn1/asn1.h index bef5cb48085..51fb2862cdf 100644 --- a/lib/libcrypto/asn1/asn1.h +++ b/lib/libcrypto/asn1/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.78 2023/07/28 10:02:11 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.79 2023/07/28 10:30:16 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -576,8 +576,6 @@ extern const ASN1_ITEM ASN1_BIT_STRING_it; int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); -int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, - const unsigned char *flags, int flags_len); #ifndef OPENSSL_NO_BIO int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, diff --git a/lib/libcrypto/hidden/openssl/asn1.h b/lib/libcrypto/hidden/openssl/asn1.h index 2a1eda1a894..087d1294c10 100644 --- a/lib/libcrypto/hidden/openssl/asn1.h +++ b/lib/libcrypto/hidden/openssl/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.4 2023/07/28 10:02:11 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.5 2023/07/28 10:30:16 tb Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -61,7 +61,6 @@ LCRYPTO_USED(i2d_ASN1_BIT_STRING); LCRYPTO_USED(ASN1_BIT_STRING_set); LCRYPTO_USED(ASN1_BIT_STRING_set_bit); LCRYPTO_USED(ASN1_BIT_STRING_get_bit); -LCRYPTO_USED(ASN1_BIT_STRING_check); LCRYPTO_USED(ASN1_BIT_STRING_name_print); LCRYPTO_USED(ASN1_BIT_STRING_num_asc); LCRYPTO_USED(ASN1_BIT_STRING_set_asc);