diff options
| author | tb <> | 2023-07-28 10:00:10 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-28 10:00:10 +0000 |
| commit | 6602851323526cd6d822de23c4b19db917aa927a (patch) | |
| tree | 8272f88698795f7034962dbe4a4dec21929fd6ba /src | |
| parent | 01880b11cac352ccba5d827f27af88f31718069a (diff) | |
| download | openbsd-6602851323526cd6d822de23c4b19db917aa927a.tar.gz openbsd-6602851323526cd6d822de23c4b19db917aa927a.tar.bz2 openbsd-6602851323526cd6d822de23c4b19db917aa927a.zip | |
Make ASN1_{primitive,template}_* internal
These were long removed from the public OpenSSL API, so we can do the
same. Remove ASN1_template_{d2i,i2d}() - those are unused internally.
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/Symbols.list | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/a_type.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1_local.h | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1t.h | 9 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/tasn_dec.c | 20 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/tasn_enc.c | 10 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/tasn_fre.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/asn1/tasn_new.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/hidden/openssl/asn1t.h | 8 |
10 files changed, 16 insertions, 63 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 7dabfa1188..2c38d67e26 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
| @@ -216,16 +216,10 @@ ASN1_mbstring_ncopy | |||
| 216 | ASN1_object_size | 216 | ASN1_object_size |
| 217 | ASN1_parse | 217 | ASN1_parse |
| 218 | ASN1_parse_dump | 218 | ASN1_parse_dump |
| 219 | ASN1_primitive_free | ||
| 220 | ASN1_primitive_new | ||
| 221 | ASN1_put_eoc | 219 | ASN1_put_eoc |
| 222 | ASN1_put_object | 220 | ASN1_put_object |
| 223 | ASN1_tag2bit | 221 | ASN1_tag2bit |
| 224 | ASN1_tag2str | 222 | ASN1_tag2str |
| 225 | ASN1_template_d2i | ||
| 226 | ASN1_template_free | ||
| 227 | ASN1_template_i2d | ||
| 228 | ASN1_template_new | ||
| 229 | ASN1_time_parse | 223 | ASN1_time_parse |
| 230 | ASN1_time_tm_clamp_notafter | 224 | ASN1_time_tm_clamp_notafter |
| 231 | ASN1_time_tm_cmp | 225 | ASN1_time_tm_cmp |
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index d1afd92c08..18d52db63c 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
| @@ -1248,14 +1248,8 @@ _libre_BIO_vsnprintf | |||
| 1248 | _libre_ERR_load_BIO_strings | 1248 | _libre_ERR_load_BIO_strings |
| 1249 | _libre_ASN1_item_ex_new | 1249 | _libre_ASN1_item_ex_new |
| 1250 | _libre_ASN1_item_ex_free | 1250 | _libre_ASN1_item_ex_free |
| 1251 | _libre_ASN1_template_new | ||
| 1252 | _libre_ASN1_primitive_new | ||
| 1253 | _libre_ASN1_template_free | ||
| 1254 | _libre_ASN1_template_d2i | ||
| 1255 | _libre_ASN1_item_ex_d2i | 1251 | _libre_ASN1_item_ex_d2i |
| 1256 | _libre_ASN1_item_ex_i2d | 1252 | _libre_ASN1_item_ex_i2d |
| 1257 | _libre_ASN1_template_i2d | ||
| 1258 | _libre_ASN1_primitive_free | ||
| 1259 | _libre_EC_GFp_simple_method | 1253 | _libre_EC_GFp_simple_method |
| 1260 | _libre_EC_GFp_mont_method | 1254 | _libre_EC_GFp_mont_method |
| 1261 | _libre_EC_GROUP_new | 1255 | _libre_EC_GROUP_new |
diff --git a/src/lib/libcrypto/asn1/a_type.c b/src/lib/libcrypto/asn1/a_type.c index e1506cdcb4..ef0a76e810 100644 --- a/src/lib/libcrypto/asn1/a_type.c +++ b/src/lib/libcrypto/asn1/a_type.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: a_type.c,v 1.26 2023/07/05 21:23:36 beck Exp $ */ | 1 | /* $OpenBSD: a_type.c,v 1.27 2023/07/28 10:00:10 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 | * |
| @@ -62,6 +62,8 @@ | |||
| 62 | #include <openssl/err.h> | 62 | #include <openssl/err.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | 64 | ||
| 65 | #include "asn1_local.h" | ||
| 66 | |||
| 65 | typedef struct { | 67 | typedef struct { |
| 66 | ASN1_INTEGER *num; | 68 | ASN1_INTEGER *num; |
| 67 | ASN1_OCTET_STRING *value; | 69 | ASN1_OCTET_STRING *value; |
diff --git a/src/lib/libcrypto/asn1/asn1_local.h b/src/lib/libcrypto/asn1/asn1_local.h index 0ef5101fcb..566ace798b 100644 --- a/src/lib/libcrypto/asn1/asn1_local.h +++ b/src/lib/libcrypto/asn1/asn1_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: asn1_local.h,v 1.3 2023/07/28 09:58:30 tb Exp $ */ | 1 | /* $OpenBSD: asn1_local.h,v 1.4 2023/07/28 10:00:10 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 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -263,4 +263,10 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, | |||
| 263 | const ASN1_ITEM *it); | 263 | const ASN1_ITEM *it); |
| 264 | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); | 264 | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); |
| 265 | 265 | ||
| 266 | int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
| 267 | void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
| 268 | |||
| 269 | int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
| 270 | void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
| 271 | |||
| 266 | __END_HIDDEN_DECLS | 272 | __END_HIDDEN_DECLS |
diff --git a/src/lib/libcrypto/asn1/asn1t.h b/src/lib/libcrypto/asn1/asn1t.h index bb49be286f..4d79f82ec7 100644 --- a/src/lib/libcrypto/asn1/asn1t.h +++ b/src/lib/libcrypto/asn1/asn1t.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: asn1t.h,v 1.22 2022/09/03 16:01:23 jsing Exp $ */ | 1 | /* $OpenBSD: asn1t.h,v 1.23 2023/07/28 10:00:10 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 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -896,17 +896,10 @@ DECLARE_STACK_OF(ASN1_VALUE) | |||
| 896 | 896 | ||
| 897 | int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | 897 | int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); |
| 898 | void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | 898 | void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); |
| 899 | int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
| 900 | int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
| 901 | |||
| 902 | void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
| 903 | int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *tt); | ||
| 904 | int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, | 899 | int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, |
| 905 | int tag, int aclass, char opt, ASN1_TLC *ctx); | 900 | int tag, int aclass, char opt, ASN1_TLC *ctx); |
| 906 | 901 | ||
| 907 | int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); | 902 | int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); |
| 908 | int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt); | ||
| 909 | void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
| 910 | 903 | ||
| 911 | #ifdef __cplusplus | 904 | #ifdef __cplusplus |
| 912 | } | 905 | } |
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c index 553cab2494..31b9efee54 100644 --- a/src/lib/libcrypto/asn1/tasn_dec.c +++ b/src/lib/libcrypto/asn1/tasn_dec.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tasn_dec.c,v 1.87 2023/07/05 21:23:36 beck Exp $ */ | 1 | /* $OpenBSD: tasn_dec.c,v 1.88 2023/07/28 10:00:10 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 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -1258,21 +1258,3 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long inlen, | |||
| 1258 | return ret; | 1258 | return ret; |
| 1259 | } | 1259 | } |
| 1260 | LCRYPTO_ALIAS(ASN1_item_ex_d2i); | 1260 | LCRYPTO_ALIAS(ASN1_item_ex_d2i); |
| 1261 | |||
| 1262 | int | ||
| 1263 | ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, | ||
| 1264 | const ASN1_TEMPLATE *at) | ||
| 1265 | { | ||
| 1266 | CBS cbs; | ||
| 1267 | int ret; | ||
| 1268 | |||
| 1269 | if (len < 0) | ||
| 1270 | return 0; | ||
| 1271 | |||
| 1272 | CBS_init(&cbs, *in, len); | ||
| 1273 | if ((ret = asn1_template_d2i(pval, &cbs, at, 0, 0)) == 1) | ||
| 1274 | *in = CBS_data(&cbs); | ||
| 1275 | |||
| 1276 | return ret; | ||
| 1277 | } | ||
| 1278 | LCRYPTO_ALIAS(ASN1_template_d2i); | ||
diff --git a/src/lib/libcrypto/asn1/tasn_enc.c b/src/lib/libcrypto/asn1/tasn_enc.c index be0579f840..b71993a139 100644 --- a/src/lib/libcrypto/asn1/tasn_enc.c +++ b/src/lib/libcrypto/asn1/tasn_enc.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tasn_enc.c,v 1.32 2023/07/05 21:23:36 beck Exp $ */ | 1 | /* $OpenBSD: tasn_enc.c,v 1.33 2023/07/28 10:00:10 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 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -271,14 +271,6 @@ ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, | |||
| 271 | } | 271 | } |
| 272 | LCRYPTO_ALIAS(ASN1_item_ex_i2d); | 272 | LCRYPTO_ALIAS(ASN1_item_ex_i2d); |
| 273 | 273 | ||
| 274 | int | ||
| 275 | ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, | ||
| 276 | const ASN1_TEMPLATE *tt) | ||
| 277 | { | ||
| 278 | return asn1_template_ex_i2d(pval, out, tt, -1, 0); | ||
| 279 | } | ||
| 280 | LCRYPTO_ALIAS(ASN1_template_i2d); | ||
| 281 | |||
| 282 | static int | 274 | static int |
| 283 | asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, | 275 | asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, |
| 284 | const ASN1_TEMPLATE *tt, int tag, int iclass) | 276 | const ASN1_TEMPLATE *tt, int tag, int iclass) |
diff --git a/src/lib/libcrypto/asn1/tasn_fre.c b/src/lib/libcrypto/asn1/tasn_fre.c index eb205dd6ab..83c073b55d 100644 --- a/src/lib/libcrypto/asn1/tasn_fre.c +++ b/src/lib/libcrypto/asn1/tasn_fre.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tasn_fre.c,v 1.22 2023/07/05 21:23:36 beck Exp $ */ | 1 | /* $OpenBSD: tasn_fre.c,v 1.23 2023/07/28 10:00:10 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 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -185,7 +185,6 @@ ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | |||
| 185 | } else | 185 | } else |
| 186 | asn1_item_free(pval, tt->item); | 186 | asn1_item_free(pval, tt->item); |
| 187 | } | 187 | } |
| 188 | LCRYPTO_ALIAS(ASN1_template_free); | ||
| 189 | 188 | ||
| 190 | void | 189 | void |
| 191 | ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | 190 | ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) |
| @@ -242,4 +241,3 @@ ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | |||
| 242 | } | 241 | } |
| 243 | *pval = NULL; | 242 | *pval = NULL; |
| 244 | } | 243 | } |
| 245 | LCRYPTO_ALIAS(ASN1_primitive_free); | ||
diff --git a/src/lib/libcrypto/asn1/tasn_new.c b/src/lib/libcrypto/asn1/tasn_new.c index 555267c48f..10c1137dbf 100644 --- a/src/lib/libcrypto/asn1/tasn_new.c +++ b/src/lib/libcrypto/asn1/tasn_new.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tasn_new.c,v 1.24 2023/07/05 21:23:36 beck Exp $ */ | 1 | /* $OpenBSD: tasn_new.c,v 1.25 2023/07/28 10:00:10 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 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -248,7 +248,6 @@ ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | |||
| 248 | done: | 248 | done: |
| 249 | return ret; | 249 | return ret; |
| 250 | } | 250 | } |
| 251 | LCRYPTO_ALIAS(ASN1_template_new); | ||
| 252 | 251 | ||
| 253 | static void | 252 | static void |
| 254 | asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | 253 | asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) |
| @@ -318,7 +317,6 @@ ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) | |||
| 318 | return 1; | 317 | return 1; |
| 319 | return 0; | 318 | return 0; |
| 320 | } | 319 | } |
| 321 | LCRYPTO_ALIAS(ASN1_primitive_new); | ||
| 322 | 320 | ||
| 323 | static void | 321 | static void |
| 324 | asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) | 322 | asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) |
diff --git a/src/lib/libcrypto/hidden/openssl/asn1t.h b/src/lib/libcrypto/hidden/openssl/asn1t.h index d37d1dbbc0..666dea564c 100644 --- a/src/lib/libcrypto/hidden/openssl/asn1t.h +++ b/src/lib/libcrypto/hidden/openssl/asn1t.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: asn1t.h,v 1.2 2023/07/07 19:37:54 beck Exp $ */ | 1 | /* $OpenBSD: asn1t.h,v 1.3 2023/07/28 10:00:10 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> |
| 4 | * | 4 | * |
| @@ -27,13 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | LCRYPTO_USED(ASN1_item_ex_new); | 28 | LCRYPTO_USED(ASN1_item_ex_new); |
| 29 | LCRYPTO_USED(ASN1_item_ex_free); | 29 | LCRYPTO_USED(ASN1_item_ex_free); |
| 30 | LCRYPTO_USED(ASN1_template_new); | ||
| 31 | LCRYPTO_USED(ASN1_primitive_new); | ||
| 32 | LCRYPTO_USED(ASN1_template_free); | ||
| 33 | LCRYPTO_USED(ASN1_template_d2i); | ||
| 34 | LCRYPTO_USED(ASN1_item_ex_d2i); | 30 | LCRYPTO_USED(ASN1_item_ex_d2i); |
| 35 | LCRYPTO_USED(ASN1_item_ex_i2d); | 31 | LCRYPTO_USED(ASN1_item_ex_i2d); |
| 36 | LCRYPTO_USED(ASN1_template_i2d); | ||
| 37 | LCRYPTO_USED(ASN1_primitive_free); | ||
| 38 | 32 | ||
| 39 | #endif /* _LIBCRYPTO_ASN1T_H */ | 33 | #endif /* _LIBCRYPTO_ASN1T_H */ |
