diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_att.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_att.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c index 8d369df900..bff412173b 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.19 2022/05/09 19:19:33 jsing Exp $ */ | 1 | /* $OpenBSD: x509_att.c,v 1.20 2022/11/14 17:48:50 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 | * |
| @@ -73,6 +73,7 @@ X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) | |||
| 73 | { | 73 | { |
| 74 | return sk_X509_ATTRIBUTE_num(x); | 74 | return sk_X509_ATTRIBUTE_num(x); |
| 75 | } | 75 | } |
| 76 | LCRYPTO_ALIAS(X509at_get_attr_count) | ||
| 76 | 77 | ||
| 77 | int | 78 | int |
| 78 | X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) | 79 | X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) |
| @@ -84,6 +85,7 @@ X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, int lastpos) | |||
| 84 | return (-2); | 85 | return (-2); |
| 85 | return (X509at_get_attr_by_OBJ(x, obj, lastpos)); | 86 | return (X509at_get_attr_by_OBJ(x, obj, lastpos)); |
| 86 | } | 87 | } |
| 88 | LCRYPTO_ALIAS(X509at_get_attr_by_NID) | ||
| 87 | 89 | ||
| 88 | int | 90 | int |
| 89 | X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, | 91 | X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, |
| @@ -105,6 +107,7 @@ X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, | |||
| 105 | } | 107 | } |
| 106 | return (-1); | 108 | return (-1); |
| 107 | } | 109 | } |
| 110 | LCRYPTO_ALIAS(X509at_get_attr_by_OBJ) | ||
| 108 | 111 | ||
| 109 | X509_ATTRIBUTE * | 112 | X509_ATTRIBUTE * |
| 110 | X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc) | 113 | X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc) |
| @@ -114,6 +117,7 @@ X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc) | |||
| 114 | else | 117 | else |
| 115 | return sk_X509_ATTRIBUTE_value(x, loc); | 118 | return sk_X509_ATTRIBUTE_value(x, loc); |
| 116 | } | 119 | } |
| 120 | LCRYPTO_ALIAS(X509at_get_attr) | ||
| 117 | 121 | ||
| 118 | X509_ATTRIBUTE * | 122 | X509_ATTRIBUTE * |
| 119 | X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc) | 123 | X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc) |
| @@ -125,6 +129,7 @@ X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc) | |||
| 125 | ret = sk_X509_ATTRIBUTE_delete(x, loc); | 129 | ret = sk_X509_ATTRIBUTE_delete(x, loc); |
| 126 | return (ret); | 130 | return (ret); |
| 127 | } | 131 | } |
| 132 | LCRYPTO_ALIAS(X509at_delete_attr) | ||
| 128 | 133 | ||
| 129 | STACK_OF(X509_ATTRIBUTE) * | 134 | STACK_OF(X509_ATTRIBUTE) * |
| 130 | X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr) | 135 | X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr) |
| @@ -160,6 +165,7 @@ err2: | |||
| 160 | sk_X509_ATTRIBUTE_free(sk); | 165 | sk_X509_ATTRIBUTE_free(sk); |
| 161 | return (NULL); | 166 | return (NULL); |
| 162 | } | 167 | } |
| 168 | LCRYPTO_ALIAS(X509at_add1_attr) | ||
| 163 | 169 | ||
| 164 | STACK_OF(X509_ATTRIBUTE) * | 170 | STACK_OF(X509_ATTRIBUTE) * |
| 165 | X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, const ASN1_OBJECT *obj, | 171 | X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, const ASN1_OBJECT *obj, |
| @@ -175,6 +181,7 @@ X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, const ASN1_OBJECT *obj, | |||
| 175 | X509_ATTRIBUTE_free(attr); | 181 | X509_ATTRIBUTE_free(attr); |
| 176 | return ret; | 182 | return ret; |
| 177 | } | 183 | } |
| 184 | LCRYPTO_ALIAS(X509at_add1_attr_by_OBJ) | ||
| 178 | 185 | ||
| 179 | STACK_OF(X509_ATTRIBUTE) * | 186 | STACK_OF(X509_ATTRIBUTE) * |
| 180 | X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, | 187 | X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, |
| @@ -190,6 +197,7 @@ X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, | |||
| 190 | X509_ATTRIBUTE_free(attr); | 197 | X509_ATTRIBUTE_free(attr); |
| 191 | return ret; | 198 | return ret; |
| 192 | } | 199 | } |
| 200 | LCRYPTO_ALIAS(X509at_add1_attr_by_NID) | ||
| 193 | 201 | ||
| 194 | STACK_OF(X509_ATTRIBUTE) * | 202 | STACK_OF(X509_ATTRIBUTE) * |
| 195 | X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, | 203 | X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, |
| @@ -205,6 +213,7 @@ X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, const char *attrname, | |||
| 205 | X509_ATTRIBUTE_free(attr); | 213 | X509_ATTRIBUTE_free(attr); |
| 206 | return ret; | 214 | return ret; |
| 207 | } | 215 | } |
| 216 | LCRYPTO_ALIAS(X509at_add1_attr_by_txt) | ||
| 208 | 217 | ||
| 209 | void * | 218 | void * |
| 210 | X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, | 219 | X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, |
| @@ -223,6 +232,7 @@ X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, const ASN1_OBJECT *obj, | |||
| 223 | return NULL; | 232 | return NULL; |
| 224 | return X509_ATTRIBUTE_get0_data(at, 0, type, NULL); | 233 | return X509_ATTRIBUTE_get0_data(at, 0, type, NULL); |
| 225 | } | 234 | } |
| 235 | LCRYPTO_ALIAS(X509at_get0_data_by_OBJ) | ||
| 226 | 236 | ||
| 227 | X509_ATTRIBUTE * | 237 | X509_ATTRIBUTE * |
| 228 | X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype, | 238 | X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype, |
| @@ -241,6 +251,7 @@ X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, int atrtype, | |||
| 241 | ASN1_OBJECT_free(obj); | 251 | ASN1_OBJECT_free(obj); |
| 242 | return (ret); | 252 | return (ret); |
| 243 | } | 253 | } |
| 254 | LCRYPTO_ALIAS(X509_ATTRIBUTE_create_by_NID) | ||
| 244 | 255 | ||
| 245 | X509_ATTRIBUTE * | 256 | X509_ATTRIBUTE * |
| 246 | X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, const ASN1_OBJECT *obj, | 257 | X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, const ASN1_OBJECT *obj, |
| @@ -270,6 +281,7 @@ err: | |||
| 270 | X509_ATTRIBUTE_free(ret); | 281 | X509_ATTRIBUTE_free(ret); |
| 271 | return (NULL); | 282 | return (NULL); |
| 272 | } | 283 | } |
| 284 | LCRYPTO_ALIAS(X509_ATTRIBUTE_create_by_OBJ) | ||
| 273 | 285 | ||
| 274 | X509_ATTRIBUTE * | 286 | X509_ATTRIBUTE * |
| 275 | X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, const char *atrname, | 287 | X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, const char *atrname, |
| @@ -288,6 +300,7 @@ X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, const char *atrname, | |||
| 288 | ASN1_OBJECT_free(obj); | 300 | ASN1_OBJECT_free(obj); |
| 289 | return nattr; | 301 | return nattr; |
| 290 | } | 302 | } |
| 303 | LCRYPTO_ALIAS(X509_ATTRIBUTE_create_by_txt) | ||
| 291 | 304 | ||
| 292 | int | 305 | int |
| 293 | X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) | 306 | X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) |
| @@ -298,6 +311,7 @@ X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) | |||
| 298 | attr->object = OBJ_dup(obj); | 311 | attr->object = OBJ_dup(obj); |
| 299 | return attr->object != NULL; | 312 | return attr->object != NULL; |
| 300 | } | 313 | } |
| 314 | LCRYPTO_ALIAS(X509_ATTRIBUTE_set1_object) | ||
| 301 | 315 | ||
| 302 | int | 316 | int |
| 303 | X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, | 317 | X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, |
| @@ -351,6 +365,7 @@ err: | |||
| 351 | X509error(ERR_R_MALLOC_FAILURE); | 365 | X509error(ERR_R_MALLOC_FAILURE); |
| 352 | return 0; | 366 | return 0; |
| 353 | } | 367 | } |
| 368 | LCRYPTO_ALIAS(X509_ATTRIBUTE_set1_data) | ||
| 354 | 369 | ||
| 355 | int | 370 | int |
| 356 | X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr) | 371 | X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr) |
| @@ -360,6 +375,7 @@ X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr) | |||
| 360 | 375 | ||
| 361 | return sk_ASN1_TYPE_num(attr->set); | 376 | return sk_ASN1_TYPE_num(attr->set); |
| 362 | } | 377 | } |
| 378 | LCRYPTO_ALIAS(X509_ATTRIBUTE_count) | ||
| 363 | 379 | ||
| 364 | ASN1_OBJECT * | 380 | ASN1_OBJECT * |
| 365 | X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) | 381 | X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) |
| @@ -368,6 +384,7 @@ X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) | |||
| 368 | return (NULL); | 384 | return (NULL); |
| 369 | return (attr->object); | 385 | return (attr->object); |
| 370 | } | 386 | } |
| 387 | LCRYPTO_ALIAS(X509_ATTRIBUTE_get0_object) | ||
| 371 | 388 | ||
| 372 | void * | 389 | void * |
| 373 | X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, void *data) | 390 | X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, void *data) |
| @@ -383,6 +400,7 @@ X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, void *data) | |||
| 383 | } | 400 | } |
| 384 | return ttmp->value.ptr; | 401 | return ttmp->value.ptr; |
| 385 | } | 402 | } |
| 403 | LCRYPTO_ALIAS(X509_ATTRIBUTE_get0_data) | ||
| 386 | 404 | ||
| 387 | ASN1_TYPE * | 405 | ASN1_TYPE * |
| 388 | X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) | 406 | X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) |
| @@ -392,3 +410,4 @@ X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) | |||
| 392 | 410 | ||
| 393 | return sk_ASN1_TYPE_value(attr->set, idx); | 411 | return sk_ASN1_TYPE_value(attr->set, idx); |
| 394 | } | 412 | } |
| 413 | LCRYPTO_ALIAS(X509_ATTRIBUTE_get0_type) | ||
