From d13035e40f9f0aeb77be3097963f11fabf83e401 Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 28 Jul 2023 10:33:13 +0000 Subject: Remove more ASN1_BIT_STRING API This removes ASN1_BIT_STRING_name_print(), ASN1_BIT_STRING_{num,set}_asc(). Before trust was properly handled using OIDs, there was a period where it used bit strings. The actual interfaces used in openssl x509 were removed, but the functions they wrapped remained unused for the next 24 years. ok jsing --- src/lib/libcrypto/asn1/a_bitstr.c | 54 +-------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'src/lib/libcrypto/asn1/a_bitstr.c') diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c index b985db60da..7ea3e12b91 100644 --- a/src/lib/libcrypto/asn1/a_bitstr.c +++ b/src/lib/libcrypto/asn1/a_bitstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_bitstr.c,v 1.40 2023/07/28 10:30:16 tb Exp $ */ +/* $OpenBSD: a_bitstr.c,v 1.41 2023/07/28 10:33:13 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -162,58 +162,6 @@ ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n) } LCRYPTO_ALIAS(ASN1_BIT_STRING_get_bit); -int -ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, - BIT_STRING_BITNAME *tbl, int indent) -{ - BIT_STRING_BITNAME *bnam; - char first = 1; - - BIO_printf(out, "%*s", indent, ""); - for (bnam = tbl; bnam->lname; bnam++) { - if (ASN1_BIT_STRING_get_bit(bs, bnam->bitnum)) { - if (!first) - BIO_puts(out, ", "); - BIO_puts(out, bnam->lname); - first = 0; - } - } - BIO_puts(out, "\n"); - return 1; -} -LCRYPTO_ALIAS(ASN1_BIT_STRING_name_print); - -int -ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, - BIT_STRING_BITNAME *tbl) -{ - int bitnum; - - bitnum = ASN1_BIT_STRING_num_asc(name, tbl); - if (bitnum < 0) - return 0; - if (bs) { - if (!ASN1_BIT_STRING_set_bit(bs, bitnum, value)) - return 0; - } - return 1; -} -LCRYPTO_ALIAS(ASN1_BIT_STRING_set_asc); - -int -ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl) -{ - BIT_STRING_BITNAME *bnam; - - for (bnam = tbl; bnam->lname; bnam++) { - if (!strcmp(bnam->sname, name) || - !strcmp(bnam->lname, name)) - return bnam->bitnum; - } - return -1; -} -LCRYPTO_ALIAS(ASN1_BIT_STRING_num_asc); - int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) { -- cgit v1.2.3-55-g6feb