diff options
author | tb <> | 2024-08-31 10:46:40 +0000 |
---|---|---|
committer | tb <> | 2024-08-31 10:46:40 +0000 |
commit | 1d2f824e57591d47f461d3ef7afa58b19d2091e7 (patch) | |
tree | 39b3f44146bb00c2c611ffa1e298dbea4a4634b8 | |
parent | 21cf540d53146de578980b2ac00c1ba17009d853 (diff) | |
download | openbsd-1d2f824e57591d47f461d3ef7afa58b19d2091e7.tar.gz openbsd-1d2f824e57591d47f461d3ef7afa58b19d2091e7.tar.bz2 openbsd-1d2f824e57591d47f461d3ef7afa58b19d2091e7.zip |
Make X509at_* API internal
The only consumer, yara, has been adjusted. It will be some more work
to remove this idiocy internally, but at least we will no longer have
to care about external consumers.
ok beck jsing
-rw-r--r-- | src/lib/libcrypto/Symbols.list | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/x509.h | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509.h | 22 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_att.c | 33 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_local.h | 17 |
5 files changed, 19 insertions, 75 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 5a7bcf01a3..44540e3cfb 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
@@ -2785,16 +2785,6 @@ X509_up_ref | |||
2785 | X509_verify | 2785 | X509_verify |
2786 | X509_verify_cert | 2786 | X509_verify_cert |
2787 | X509_verify_cert_error_string | 2787 | X509_verify_cert_error_string |
2788 | X509at_add1_attr | ||
2789 | X509at_add1_attr_by_NID | ||
2790 | X509at_add1_attr_by_OBJ | ||
2791 | X509at_add1_attr_by_txt | ||
2792 | X509at_delete_attr | ||
2793 | X509at_get0_data_by_OBJ | ||
2794 | X509at_get_attr | ||
2795 | X509at_get_attr_by_NID | ||
2796 | X509at_get_attr_by_OBJ | ||
2797 | X509at_get_attr_count | ||
2798 | X509v3_add_ext | 2788 | X509v3_add_ext |
2799 | X509v3_addr_add_inherit | 2789 | X509v3_addr_add_inherit |
2800 | X509v3_addr_add_prefix | 2790 | X509v3_addr_add_prefix |
diff --git a/src/lib/libcrypto/hidden/openssl/x509.h b/src/lib/libcrypto/hidden/openssl/x509.h index e25250d469..ac990a631d 100644 --- a/src/lib/libcrypto/hidden/openssl/x509.h +++ b/src/lib/libcrypto/hidden/openssl/x509.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509.h,v 1.13 2024/08/31 10:25:38 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.14 2024/08/31 10:46:40 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2022 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -241,16 +241,6 @@ LCRYPTO_USED(X509_EXTENSION_set_data); | |||
241 | LCRYPTO_USED(X509_EXTENSION_get_object); | 241 | LCRYPTO_USED(X509_EXTENSION_get_object); |
242 | LCRYPTO_USED(X509_EXTENSION_get_data); | 242 | LCRYPTO_USED(X509_EXTENSION_get_data); |
243 | LCRYPTO_USED(X509_EXTENSION_get_critical); | 243 | LCRYPTO_USED(X509_EXTENSION_get_critical); |
244 | LCRYPTO_UNUSED(X509at_get_attr_count); | ||
245 | LCRYPTO_USED(X509at_get_attr_by_NID); | ||
246 | LCRYPTO_USED(X509at_get_attr_by_OBJ); | ||
247 | LCRYPTO_UNUSED(X509at_get_attr); | ||
248 | LCRYPTO_UNUSED(X509at_delete_attr); | ||
249 | LCRYPTO_USED(X509at_add1_attr); | ||
250 | LCRYPTO_USED(X509at_add1_attr_by_OBJ); | ||
251 | LCRYPTO_USED(X509at_add1_attr_by_NID); | ||
252 | LCRYPTO_USED(X509at_add1_attr_by_txt); | ||
253 | LCRYPTO_USED(X509at_get0_data_by_OBJ); | ||
254 | LCRYPTO_USED(X509_ATTRIBUTE_create_by_NID); | 244 | LCRYPTO_USED(X509_ATTRIBUTE_create_by_NID); |
255 | LCRYPTO_USED(X509_ATTRIBUTE_create_by_OBJ); | 245 | LCRYPTO_USED(X509_ATTRIBUTE_create_by_OBJ); |
256 | LCRYPTO_USED(X509_ATTRIBUTE_create_by_txt); | 246 | LCRYPTO_USED(X509_ATTRIBUTE_create_by_txt); |
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index ad3bb0f0f2..81c2111d02 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509.h,v 1.117 2024/08/31 10:25:38 tb Exp $ */ | 1 | /* $OpenBSD: x509.h,v 1.118 2024/08/31 10:46:40 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 | * |
@@ -906,26 +906,6 @@ ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); | |||
906 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); | 906 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); |
907 | int X509_EXTENSION_get_critical(const X509_EXTENSION *ex); | 907 | int X509_EXTENSION_get_critical(const X509_EXTENSION *ex); |
908 | 908 | ||
909 | int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); | ||
910 | int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, | ||
911 | int lastpos); | ||
912 | int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, | ||
913 | const ASN1_OBJECT *obj, int lastpos); | ||
914 | X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); | ||
915 | X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); | ||
916 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, | ||
917 | X509_ATTRIBUTE *attr); | ||
918 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, | ||
919 | const ASN1_OBJECT *obj, int type, | ||
920 | const unsigned char *bytes, int len); | ||
921 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, | ||
922 | int nid, int type, | ||
923 | const unsigned char *bytes, int len); | ||
924 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, | ||
925 | const char *attrname, int type, | ||
926 | const unsigned char *bytes, int len); | ||
927 | void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, | ||
928 | const ASN1_OBJECT *obj, int lastpos, int type); | ||
929 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, | 909 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, |
930 | int atrtype, const void *data, int len); | 910 | int atrtype, const void *data, int len); |
931 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, | 911 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, |
diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c index 21b47ce96f..4931cbbc17 100644 --- a/src/lib/libcrypto/x509/x509_att.c +++ b/src/lib/libcrypto/x509/x509_att.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_att.c,v 1.24 2024/07/26 13:33:39 tb Exp $ */ | 1 | /* $OpenBSD: x509_att.c,v 1.25 2024/08/31 10:46:40 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 | * |
@@ -69,14 +69,6 @@ | |||
69 | #include "x509_local.h" | 69 | #include "x509_local.h" |
70 | 70 | ||
71 | int | 71 | int |
72 | X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) | ||
73 | { | ||
74 | X509error(ERR_R_DISABLED); | ||
75 | return 0; | ||
76 | } | ||
77 | LCRYPTO_ALIAS(X509at_get_attr_count); | ||
78 | |||
79 | int | ||
80 | X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) | 72 | X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) |
81 | { | 73 | { |
82 | ASN1_OBJECT *obj; | 74 | ASN1_OBJECT *obj; |
@@ -86,7 +78,6 @@ X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) | |||
86 | return (-2); | 78 | return (-2); |
87 | return (X509at_get_attr_by_OBJ(x, obj, lastpos)); | 79 | return (X509at_get_attr_by_OBJ(x, obj, lastpos)); |
88 | } | 80 | } |
89 | LCRYPTO_ALIAS(X509at_get_attr_by_NID); | ||
90 | 81 | ||
91 | int | 82 | int |
92 | X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, | 83 | X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, |
@@ -108,23 +99,6 @@ X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, | |||
108 | } | 99 | } |
109 | return (-1); | 100 | return (-1); |
110 | } | 101 | } |
111 | LCRYPTO_ALIAS(X509at_get_attr_by_OBJ); | ||
112 | |||
113 | X509_ATTRIBUTE * | ||
114 | X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc) | ||
115 | { | ||
116 | X509error(ERR_R_DISABLED); | ||
117 | return NULL; | ||
118 | } | ||
119 | LCRYPTO_ALIAS(X509at_get_attr); | ||
120 | |||
121 | X509_ATTRIBUTE * | ||
122 | X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc) | ||
123 | { | ||
124 | X509error(ERR_R_DISABLED); | ||
125 | return NULL; | ||
126 | } | ||
127 | LCRYPTO_ALIAS(X509at_delete_attr); | ||
128 | 102 | ||
129 | STACK_OF(X509_ATTRIBUTE) * | 103 | STACK_OF(X509_ATTRIBUTE) * |
130 | X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr) | 104 | X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr) |
@@ -160,7 +134,6 @@ err2: | |||
160 | sk_X509_ATTRIBUTE_free(sk); | 134 | sk_X509_ATTRIBUTE_free(sk); |
161 | return (NULL); | 135 | return (NULL); |
162 | } | 136 | } |
163 | LCRYPTO_ALIAS(X509at_add1_attr); | ||
164 | 137 | ||
165 | STACK_OF(X509_ATTRIBUTE) * | 138 | STACK_OF(X509_ATTRIBUTE) * |
166 | X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, const ASN1_OBJECT *obj, | 139 | X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, const ASN1_OBJECT *obj, |
@@ -176,7 +149,6 @@ X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, const ASN1_OBJECT *obj, | |||
176 | X509_ATTRIBUTE_free(attr); | 149 | X509_ATTRIBUTE_free(attr); |
177 | return ret; | 150 | return ret; |
178 | } | 151 | } |
179 | LCRYPTO_ALIAS(X509at_add1_attr_by_OBJ); | ||
180 | 152 | ||
181 | STACK_OF(X509_ATTRIBUTE) * | 153 | STACK_OF(X509_ATTRIBUTE) * |
182 | X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, | 154 | X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, |
@@ -192,7 +164,6 @@ X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, | |||
192 | X509_ATTRIBUTE_free(attr); | 164 | X509_ATTRIBUTE_free(attr); |
193 | return ret; | 165 | return ret; |
194 | } | 166 | } |
195 | LCRYPTO_ALIAS(X509at_add1_attr_by_NID); | ||
196 | 167 | ||
197 | STACK_OF(X509_ATTRIBUTE) * | 168 | STACK_OF(X509_ATTRIBUTE) * |
198 | X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, | 169 | X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, |
@@ -208,7 +179,6 @@ X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, | |||
208 | X509_ATTRIBUTE_free(attr); | 179 | X509_ATTRIBUTE_free(attr); |
209 | return ret; | 180 | return ret; |
210 | } | 181 | } |
211 | LCRYPTO_ALIAS(X509at_add1_attr_by_txt); | ||
212 | 182 | ||
213 | void * | 183 | void * |
214 | X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, | 184 | X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, |
@@ -227,7 +197,6 @@ X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, | |||
227 | return NULL; | 197 | return NULL; |
228 | return X509_ATTRIBUTE_get0_data(at, 0, type, NULL); | 198 | return X509_ATTRIBUTE_get0_data(at, 0, type, NULL); |
229 | } | 199 | } |
230 | LCRYPTO_ALIAS(X509at_get0_data_by_OBJ); | ||
231 | 200 | ||
232 | X509_ATTRIBUTE * | 201 | X509_ATTRIBUTE * |
233 | X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype, | 202 | X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype, |
diff --git a/src/lib/libcrypto/x509/x509_local.h b/src/lib/libcrypto/x509/x509_local.h index b3a51ec2e7..bb64729b3c 100644 --- a/src/lib/libcrypto/x509/x509_local.h +++ b/src/lib/libcrypto/x509/x509_local.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_local.h,v 1.31 2024/08/31 10:19:17 tb Exp $ */ | 1 | /* $OpenBSD: x509_local.h,v 1.32 2024/08/31 10:46:40 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 2013. | 3 | * project 2013. |
4 | */ | 4 | */ |
@@ -424,6 +424,21 @@ X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, | |||
424 | int X509_PURPOSE_get_by_id(int id); | 424 | int X509_PURPOSE_get_by_id(int id); |
425 | int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); | 425 | int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); |
426 | 426 | ||
427 | int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, | ||
428 | int lastpos); | ||
429 | int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, | ||
430 | const ASN1_OBJECT *obj, int lastpos); | ||
431 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, | ||
432 | X509_ATTRIBUTE *attr); | ||
433 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, | ||
434 | const ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len); | ||
435 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, | ||
436 | int nid, int type, const unsigned char *bytes, int len); | ||
437 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, | ||
438 | const char *attrname, int type, const unsigned char *bytes, int len); | ||
439 | void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, | ||
440 | const ASN1_OBJECT *obj, int lastpos, int type); | ||
441 | |||
427 | int X509V3_add_value(const char *name, const char *value, | 442 | int X509V3_add_value(const char *name, const char *value, |
428 | STACK_OF(CONF_VALUE) **extlist); | 443 | STACK_OF(CONF_VALUE) **extlist); |
429 | int X509V3_add_value_uchar(const char *name, const unsigned char *value, | 444 | int X509V3_add_value_uchar(const char *name, const unsigned char *value, |