diff options
author | tb <> | 2023-07-28 10:33:13 +0000 |
---|---|---|
committer | tb <> | 2023-07-28 10:33:13 +0000 |
commit | d13035e40f9f0aeb77be3097963f11fabf83e401 (patch) | |
tree | 6ca61cb63c965a6e1ab24f4f13909d7067ef58fb /src/lib/libcrypto/asn1/a_bitstr.c | |
parent | a6fe4431097f0743a991627e730ef8ceebc499b6 (diff) | |
download | openbsd-d13035e40f9f0aeb77be3097963f11fabf83e401.tar.gz openbsd-d13035e40f9f0aeb77be3097963f11fabf83e401.tar.bz2 openbsd-d13035e40f9f0aeb77be3097963f11fabf83e401.zip |
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
Diffstat (limited to 'src/lib/libcrypto/asn1/a_bitstr.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_bitstr.c | 54 |
1 files changed, 1 insertions, 53 deletions
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 @@ | |||
1 | /* $OpenBSD: a_bitstr.c,v 1.40 2023/07/28 10:30:16 tb Exp $ */ | 1 | /* $OpenBSD: a_bitstr.c,v 1.41 2023/07/28 10:33:13 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 | * |
@@ -163,58 +163,6 @@ ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n) | |||
163 | LCRYPTO_ALIAS(ASN1_BIT_STRING_get_bit); | 163 | LCRYPTO_ALIAS(ASN1_BIT_STRING_get_bit); |
164 | 164 | ||
165 | int | 165 | int |
166 | ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, | ||
167 | BIT_STRING_BITNAME *tbl, int indent) | ||
168 | { | ||
169 | BIT_STRING_BITNAME *bnam; | ||
170 | char first = 1; | ||
171 | |||
172 | BIO_printf(out, "%*s", indent, ""); | ||
173 | for (bnam = tbl; bnam->lname; bnam++) { | ||
174 | if (ASN1_BIT_STRING_get_bit(bs, bnam->bitnum)) { | ||
175 | if (!first) | ||
176 | BIO_puts(out, ", "); | ||
177 | BIO_puts(out, bnam->lname); | ||
178 | first = 0; | ||
179 | } | ||
180 | } | ||
181 | BIO_puts(out, "\n"); | ||
182 | return 1; | ||
183 | } | ||
184 | LCRYPTO_ALIAS(ASN1_BIT_STRING_name_print); | ||
185 | |||
186 | int | ||
187 | ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, | ||
188 | BIT_STRING_BITNAME *tbl) | ||
189 | { | ||
190 | int bitnum; | ||
191 | |||
192 | bitnum = ASN1_BIT_STRING_num_asc(name, tbl); | ||
193 | if (bitnum < 0) | ||
194 | return 0; | ||
195 | if (bs) { | ||
196 | if (!ASN1_BIT_STRING_set_bit(bs, bitnum, value)) | ||
197 | return 0; | ||
198 | } | ||
199 | return 1; | ||
200 | } | ||
201 | LCRYPTO_ALIAS(ASN1_BIT_STRING_set_asc); | ||
202 | |||
203 | int | ||
204 | ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl) | ||
205 | { | ||
206 | BIT_STRING_BITNAME *bnam; | ||
207 | |||
208 | for (bnam = tbl; bnam->lname; bnam++) { | ||
209 | if (!strcmp(bnam->sname, name) || | ||
210 | !strcmp(bnam->lname, name)) | ||
211 | return bnam->bitnum; | ||
212 | } | ||
213 | return -1; | ||
214 | } | ||
215 | LCRYPTO_ALIAS(ASN1_BIT_STRING_num_asc); | ||
216 | |||
217 | int | ||
218 | i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) | 166 | i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) |
219 | { | 167 | { |
220 | int ret, j, bits, len; | 168 | int ret, j, bits, len; |