summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-07-28 10:00:10 +0000
committertb <>2023-07-28 10:00:10 +0000
commitf0045e366b4be4794ddf9c7123b1bb43169d83ea (patch)
tree8272f88698795f7034962dbe4a4dec21929fd6ba /src/lib
parentb57b8995befab5a960cda55abaa2c8eeb444dd0a (diff)
downloadopenbsd-f0045e366b4be4794ddf9c7123b1bb43169d83ea.tar.gz
openbsd-f0045e366b4be4794ddf9c7123b1bb43169d83ea.tar.bz2
openbsd-f0045e366b4be4794ddf9c7123b1bb43169d83ea.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/lib')
-rw-r--r--src/lib/libcrypto/Symbols.list6
-rw-r--r--src/lib/libcrypto/Symbols.namespace6
-rw-r--r--src/lib/libcrypto/asn1/a_type.c4
-rw-r--r--src/lib/libcrypto/asn1/asn1_local.h8
-rw-r--r--src/lib/libcrypto/asn1/asn1t.h9
-rw-r--r--src/lib/libcrypto/asn1/tasn_dec.c20
-rw-r--r--src/lib/libcrypto/asn1/tasn_enc.c10
-rw-r--r--src/lib/libcrypto/asn1/tasn_fre.c4
-rw-r--r--src/lib/libcrypto/asn1/tasn_new.c4
-rw-r--r--src/lib/libcrypto/hidden/openssl/asn1t.h8
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
216ASN1_object_size 216ASN1_object_size
217ASN1_parse 217ASN1_parse
218ASN1_parse_dump 218ASN1_parse_dump
219ASN1_primitive_free
220ASN1_primitive_new
221ASN1_put_eoc 219ASN1_put_eoc
222ASN1_put_object 220ASN1_put_object
223ASN1_tag2bit 221ASN1_tag2bit
224ASN1_tag2str 222ASN1_tag2str
225ASN1_template_d2i
226ASN1_template_free
227ASN1_template_i2d
228ASN1_template_new
229ASN1_time_parse 223ASN1_time_parse
230ASN1_time_tm_clamp_notafter 224ASN1_time_tm_clamp_notafter
231ASN1_time_tm_cmp 225ASN1_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
65typedef struct { 67typedef 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);
264ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); 264ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
265 265
266int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
267void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
268
269int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
270void 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
897int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); 897int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
898void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); 898void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
899int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
900int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
901
902void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
903int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *tt);
904int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, 899int 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
907int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); 902int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass);
908int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt);
909void 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}
1260LCRYPTO_ALIAS(ASN1_item_ex_d2i); 1260LCRYPTO_ALIAS(ASN1_item_ex_d2i);
1261
1262int
1263ASN1_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}
1278LCRYPTO_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}
272LCRYPTO_ALIAS(ASN1_item_ex_i2d); 272LCRYPTO_ALIAS(ASN1_item_ex_i2d);
273 273
274int
275ASN1_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}
280LCRYPTO_ALIAS(ASN1_template_i2d);
281
282static int 274static int
283asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, 275asn1_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}
188LCRYPTO_ALIAS(ASN1_template_free);
189 188
190void 189void
191ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) 190ASN1_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}
245LCRYPTO_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}
251LCRYPTO_ALIAS(ASN1_template_new);
252 251
253static void 252static void
254asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) 253asn1_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}
321LCRYPTO_ALIAS(ASN1_primitive_new);
322 320
323static void 321static void
324asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) 322asn1_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
28LCRYPTO_USED(ASN1_item_ex_new); 28LCRYPTO_USED(ASN1_item_ex_new);
29LCRYPTO_USED(ASN1_item_ex_free); 29LCRYPTO_USED(ASN1_item_ex_free);
30LCRYPTO_USED(ASN1_template_new);
31LCRYPTO_USED(ASN1_primitive_new);
32LCRYPTO_USED(ASN1_template_free);
33LCRYPTO_USED(ASN1_template_d2i);
34LCRYPTO_USED(ASN1_item_ex_d2i); 30LCRYPTO_USED(ASN1_item_ex_d2i);
35LCRYPTO_USED(ASN1_item_ex_i2d); 31LCRYPTO_USED(ASN1_item_ex_i2d);
36LCRYPTO_USED(ASN1_template_i2d);
37LCRYPTO_USED(ASN1_primitive_free);
38 32
39#endif /* _LIBCRYPTO_ASN1T_H */ 33#endif /* _LIBCRYPTO_ASN1T_H */