summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/a_string.c')
-rw-r--r--src/lib/libcrypto/asn1/a_string.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/a_string.c b/src/lib/libcrypto/asn1/a_string.c
index d0e917b871..bfd2abf2f7 100644
--- a/src/lib/libcrypto/asn1/a_string.c
+++ b/src/lib/libcrypto/asn1/a_string.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_string.c,v 1.13 2022/11/28 07:50:47 tb Exp $ */ 1/* $OpenBSD: a_string.c,v 1.14 2023/07/05 21:23:36 beck 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 *
@@ -70,6 +70,7 @@ ASN1_STRING_new(void)
70{ 70{
71 return ASN1_STRING_type_new(V_ASN1_OCTET_STRING); 71 return ASN1_STRING_type_new(V_ASN1_OCTET_STRING);
72} 72}
73LCRYPTO_ALIAS(ASN1_STRING_new);
73 74
74ASN1_STRING * 75ASN1_STRING *
75ASN1_STRING_type_new(int type) 76ASN1_STRING_type_new(int type)
@@ -84,6 +85,7 @@ ASN1_STRING_type_new(int type)
84 85
85 return astr; 86 return astr;
86} 87}
88LCRYPTO_ALIAS(ASN1_STRING_type_new);
87 89
88static void 90static void
89ASN1_STRING_clear(ASN1_STRING *astr) 91ASN1_STRING_clear(ASN1_STRING *astr)
@@ -106,6 +108,7 @@ ASN1_STRING_free(ASN1_STRING *astr)
106 108
107 free(astr); 109 free(astr);
108} 110}
111LCRYPTO_ALIAS(ASN1_STRING_free);
109 112
110int 113int
111ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b) 114ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
@@ -121,6 +124,7 @@ ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
121 124
122 return (a->type - b->type); 125 return (a->type - b->type);
123} 126}
127LCRYPTO_ALIAS(ASN1_STRING_cmp);
124 128
125int 129int
126ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *src) 130ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *src)
@@ -136,6 +140,7 @@ ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *src)
136 140
137 return 1; 141 return 1;
138} 142}
143LCRYPTO_ALIAS(ASN1_STRING_copy);
139 144
140ASN1_STRING * 145ASN1_STRING *
141ASN1_STRING_dup(const ASN1_STRING *src) 146ASN1_STRING_dup(const ASN1_STRING *src)
@@ -153,6 +158,7 @@ ASN1_STRING_dup(const ASN1_STRING *src)
153 } 158 }
154 return astr; 159 return astr;
155} 160}
161LCRYPTO_ALIAS(ASN1_STRING_dup);
156 162
157int 163int
158ASN1_STRING_set(ASN1_STRING *astr, const void *_data, int len) 164ASN1_STRING_set(ASN1_STRING *astr, const void *_data, int len)
@@ -189,6 +195,7 @@ ASN1_STRING_set(ASN1_STRING *astr, const void *_data, int len)
189 195
190 return 1; 196 return 1;
191} 197}
198LCRYPTO_ALIAS(ASN1_STRING_set);
192 199
193void 200void
194ASN1_STRING_set0(ASN1_STRING *astr, void *data, int len) 201ASN1_STRING_set0(ASN1_STRING *astr, void *data, int len)
@@ -198,12 +205,14 @@ ASN1_STRING_set0(ASN1_STRING *astr, void *data, int len)
198 astr->data = data; 205 astr->data = data;
199 astr->length = len; 206 astr->length = len;
200} 207}
208LCRYPTO_ALIAS(ASN1_STRING_set0);
201 209
202int 210int
203ASN1_STRING_length(const ASN1_STRING *astr) 211ASN1_STRING_length(const ASN1_STRING *astr)
204{ 212{
205 return astr->length; 213 return astr->length;
206} 214}
215LCRYPTO_ALIAS(ASN1_STRING_length);
207 216
208void 217void
209ASN1_STRING_length_set(ASN1_STRING *astr, int len) 218ASN1_STRING_length_set(ASN1_STRING *astr, int len)
@@ -211,24 +220,28 @@ ASN1_STRING_length_set(ASN1_STRING *astr, int len)
211 /* This is dangerous and unfixable. */ 220 /* This is dangerous and unfixable. */
212 astr->length = len; 221 astr->length = len;
213} 222}
223LCRYPTO_ALIAS(ASN1_STRING_length_set);
214 224
215int 225int
216ASN1_STRING_type(const ASN1_STRING *astr) 226ASN1_STRING_type(const ASN1_STRING *astr)
217{ 227{
218 return astr->type; 228 return astr->type;
219} 229}
230LCRYPTO_ALIAS(ASN1_STRING_type);
220 231
221unsigned char * 232unsigned char *
222ASN1_STRING_data(ASN1_STRING *astr) 233ASN1_STRING_data(ASN1_STRING *astr)
223{ 234{
224 return astr->data; 235 return astr->data;
225} 236}
237LCRYPTO_ALIAS(ASN1_STRING_data);
226 238
227const unsigned char * 239const unsigned char *
228ASN1_STRING_get0_data(const ASN1_STRING *astr) 240ASN1_STRING_get0_data(const ASN1_STRING *astr)
229{ 241{
230 return astr->data; 242 return astr->data;
231} 243}
244LCRYPTO_ALIAS(ASN1_STRING_get0_data);
232 245
233int 246int
234ASN1_STRING_print(BIO *bp, const ASN1_STRING *astr) 247ASN1_STRING_print(BIO *bp, const ASN1_STRING *astr)
@@ -262,6 +275,7 @@ ASN1_STRING_print(BIO *bp, const ASN1_STRING *astr)
262 275
263 return 1; 276 return 1;
264} 277}
278LCRYPTO_ALIAS(ASN1_STRING_print);
265 279
266/* 280/*
267 * Utility function: convert any string type to UTF8, returns number of bytes 281 * Utility function: convert any string type to UTF8, returns number of bytes
@@ -304,6 +318,7 @@ ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in)
304 318
305 return ret; 319 return ret;
306} 320}
321LCRYPTO_ALIAS(ASN1_STRING_to_UTF8);
307 322
308int 323int
309i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *astr, int type) 324i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *astr, int type)
@@ -338,6 +353,7 @@ i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *astr, int type)
338 err: 353 err:
339 return -1; 354 return -1;
340} 355}
356LCRYPTO_ALIAS(i2a_ASN1_STRING);
341 357
342int 358int
343a2i_ASN1_STRING(BIO *bp, ASN1_STRING *astr, char *buf, int size) 359a2i_ASN1_STRING(BIO *bp, ASN1_STRING *astr, char *buf, int size)
@@ -429,3 +445,4 @@ a2i_ASN1_STRING(BIO *bp, ASN1_STRING *astr, char *buf, int size)
429 445
430 return ret; 446 return ret;
431} 447}
448LCRYPTO_ALIAS(a2i_ASN1_STRING);