diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_req.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_req.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_req.c b/src/lib/libcrypto/x509/x509_req.c index c0a2a64a0b..5155d743ab 100644 --- a/src/lib/libcrypto/x509/x509_req.c +++ b/src/lib/libcrypto/x509/x509_req.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_req.c,v 1.29 2022/08/18 16:26:33 tb Exp $ */ | 1 | /* $OpenBSD: x509_req.c,v 1.30 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 | * |
| @@ -115,6 +115,7 @@ err: | |||
| 115 | X509_REQ_free(ret); | 115 | X509_REQ_free(ret); |
| 116 | return (NULL); | 116 | return (NULL); |
| 117 | } | 117 | } |
| 118 | LCRYPTO_ALIAS(X509_to_X509_REQ) | ||
| 118 | 119 | ||
| 119 | EVP_PKEY * | 120 | EVP_PKEY * |
| 120 | X509_REQ_get_pubkey(X509_REQ *req) | 121 | X509_REQ_get_pubkey(X509_REQ *req) |
| @@ -123,6 +124,7 @@ X509_REQ_get_pubkey(X509_REQ *req) | |||
| 123 | return (NULL); | 124 | return (NULL); |
| 124 | return (X509_PUBKEY_get(req->req_info->pubkey)); | 125 | return (X509_PUBKEY_get(req->req_info->pubkey)); |
| 125 | } | 126 | } |
| 127 | LCRYPTO_ALIAS(X509_REQ_get_pubkey) | ||
| 126 | 128 | ||
| 127 | EVP_PKEY * | 129 | EVP_PKEY * |
| 128 | X509_REQ_get0_pubkey(X509_REQ *req) | 130 | X509_REQ_get0_pubkey(X509_REQ *req) |
| @@ -131,6 +133,7 @@ X509_REQ_get0_pubkey(X509_REQ *req) | |||
| 131 | return NULL; | 133 | return NULL; |
| 132 | return X509_PUBKEY_get0(req->req_info->pubkey); | 134 | return X509_PUBKEY_get0(req->req_info->pubkey); |
| 133 | } | 135 | } |
| 136 | LCRYPTO_ALIAS(X509_REQ_get0_pubkey) | ||
| 134 | 137 | ||
| 135 | int | 138 | int |
| 136 | X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) | 139 | X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) |
| @@ -170,6 +173,7 @@ X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) | |||
| 170 | 173 | ||
| 171 | return (ok); | 174 | return (ok); |
| 172 | } | 175 | } |
| 176 | LCRYPTO_ALIAS(X509_REQ_check_private_key) | ||
| 173 | 177 | ||
| 174 | /* It seems several organisations had the same idea of including a list of | 178 | /* It seems several organisations had the same idea of including a list of |
| 175 | * extensions in a certificate request. There are at least two OIDs that are | 179 | * extensions in a certificate request. There are at least two OIDs that are |
| @@ -193,18 +197,21 @@ X509_REQ_extension_nid(int req_nid) | |||
| 193 | return 1; | 197 | return 1; |
| 194 | } | 198 | } |
| 195 | } | 199 | } |
| 200 | LCRYPTO_ALIAS(X509_REQ_extension_nid) | ||
| 196 | 201 | ||
| 197 | int * | 202 | int * |
| 198 | X509_REQ_get_extension_nids(void) | 203 | X509_REQ_get_extension_nids(void) |
| 199 | { | 204 | { |
| 200 | return ext_nids; | 205 | return ext_nids; |
| 201 | } | 206 | } |
| 207 | LCRYPTO_ALIAS(X509_REQ_get_extension_nids) | ||
| 202 | 208 | ||
| 203 | void | 209 | void |
| 204 | X509_REQ_set_extension_nids(int *nids) | 210 | X509_REQ_set_extension_nids(int *nids) |
| 205 | { | 211 | { |
| 206 | ext_nids = nids; | 212 | ext_nids = nids; |
| 207 | } | 213 | } |
| 214 | LCRYPTO_ALIAS(X509_REQ_set_extension_nids) | ||
| 208 | 215 | ||
| 209 | STACK_OF(X509_EXTENSION) * | 216 | STACK_OF(X509_EXTENSION) * |
| 210 | X509_REQ_get_extensions(X509_REQ *req) | 217 | X509_REQ_get_extensions(X509_REQ *req) |
| @@ -231,6 +238,7 @@ X509_REQ_get_extensions(X509_REQ *req) | |||
| 231 | p = ext->value.sequence->data; | 238 | p = ext->value.sequence->data; |
| 232 | return d2i_X509_EXTENSIONS(NULL, &p, ext->value.sequence->length); | 239 | return d2i_X509_EXTENSIONS(NULL, &p, ext->value.sequence->length); |
| 233 | } | 240 | } |
| 241 | LCRYPTO_ALIAS(X509_REQ_get_extensions) | ||
| 234 | 242 | ||
| 235 | /* | 243 | /* |
| 236 | * Add a STACK_OF extensions to a certificate request: allow alternative OIDs | 244 | * Add a STACK_OF extensions to a certificate request: allow alternative OIDs |
| @@ -254,6 +262,7 @@ X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, | |||
| 254 | 262 | ||
| 255 | return rv; | 263 | return rv; |
| 256 | } | 264 | } |
| 265 | LCRYPTO_ALIAS(X509_REQ_add_extensions_nid) | ||
| 257 | 266 | ||
| 258 | /* This is the normal usage: use the "official" OID */ | 267 | /* This is the normal usage: use the "official" OID */ |
| 259 | int | 268 | int |
| @@ -261,6 +270,7 @@ X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts) | |||
| 261 | { | 270 | { |
| 262 | return X509_REQ_add_extensions_nid(req, exts, NID_ext_req); | 271 | return X509_REQ_add_extensions_nid(req, exts, NID_ext_req); |
| 263 | } | 272 | } |
| 273 | LCRYPTO_ALIAS(X509_REQ_add_extensions) | ||
| 264 | 274 | ||
| 265 | /* Request attribute functions */ | 275 | /* Request attribute functions */ |
| 266 | 276 | ||
| @@ -269,12 +279,14 @@ X509_REQ_get_attr_count(const X509_REQ *req) | |||
| 269 | { | 279 | { |
| 270 | return X509at_get_attr_count(req->req_info->attributes); | 280 | return X509at_get_attr_count(req->req_info->attributes); |
| 271 | } | 281 | } |
| 282 | LCRYPTO_ALIAS(X509_REQ_get_attr_count) | ||
| 272 | 283 | ||
| 273 | int | 284 | int |
| 274 | X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) | 285 | X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) |
| 275 | { | 286 | { |
| 276 | return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos); | 287 | return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos); |
| 277 | } | 288 | } |
| 289 | LCRYPTO_ALIAS(X509_REQ_get_attr_by_NID) | ||
| 278 | 290 | ||
| 279 | int | 291 | int |
| 280 | X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, | 292 | X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, |
| @@ -282,18 +294,21 @@ X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, | |||
| 282 | { | 294 | { |
| 283 | return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); | 295 | return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); |
| 284 | } | 296 | } |
| 297 | LCRYPTO_ALIAS(X509_REQ_get_attr_by_OBJ) | ||
| 285 | 298 | ||
| 286 | X509_ATTRIBUTE * | 299 | X509_ATTRIBUTE * |
| 287 | X509_REQ_get_attr(const X509_REQ *req, int loc) | 300 | X509_REQ_get_attr(const X509_REQ *req, int loc) |
| 288 | { | 301 | { |
| 289 | return X509at_get_attr(req->req_info->attributes, loc); | 302 | return X509at_get_attr(req->req_info->attributes, loc); |
| 290 | } | 303 | } |
| 304 | LCRYPTO_ALIAS(X509_REQ_get_attr) | ||
| 291 | 305 | ||
| 292 | X509_ATTRIBUTE * | 306 | X509_ATTRIBUTE * |
| 293 | X509_REQ_delete_attr(X509_REQ *req, int loc) | 307 | X509_REQ_delete_attr(X509_REQ *req, int loc) |
| 294 | { | 308 | { |
| 295 | return X509at_delete_attr(req->req_info->attributes, loc); | 309 | return X509at_delete_attr(req->req_info->attributes, loc); |
| 296 | } | 310 | } |
| 311 | LCRYPTO_ALIAS(X509_REQ_delete_attr) | ||
| 297 | 312 | ||
| 298 | int | 313 | int |
| 299 | X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) | 314 | X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) |
| @@ -302,6 +317,7 @@ X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) | |||
| 302 | return 1; | 317 | return 1; |
| 303 | return 0; | 318 | return 0; |
| 304 | } | 319 | } |
| 320 | LCRYPTO_ALIAS(X509_REQ_add1_attr) | ||
| 305 | 321 | ||
| 306 | int | 322 | int |
| 307 | X509_REQ_add1_attr_by_OBJ(X509_REQ *req, const ASN1_OBJECT *obj, int type, | 323 | X509_REQ_add1_attr_by_OBJ(X509_REQ *req, const ASN1_OBJECT *obj, int type, |
| @@ -312,6 +328,7 @@ X509_REQ_add1_attr_by_OBJ(X509_REQ *req, const ASN1_OBJECT *obj, int type, | |||
| 312 | return 1; | 328 | return 1; |
| 313 | return 0; | 329 | return 0; |
| 314 | } | 330 | } |
| 331 | LCRYPTO_ALIAS(X509_REQ_add1_attr_by_OBJ) | ||
| 315 | 332 | ||
| 316 | int | 333 | int |
| 317 | X509_REQ_add1_attr_by_NID(X509_REQ *req, int nid, int type, | 334 | X509_REQ_add1_attr_by_NID(X509_REQ *req, int nid, int type, |
| @@ -322,6 +339,7 @@ X509_REQ_add1_attr_by_NID(X509_REQ *req, int nid, int type, | |||
| 322 | return 1; | 339 | return 1; |
| 323 | return 0; | 340 | return 0; |
| 324 | } | 341 | } |
| 342 | LCRYPTO_ALIAS(X509_REQ_add1_attr_by_NID) | ||
| 325 | 343 | ||
| 326 | int | 344 | int |
| 327 | X509_REQ_add1_attr_by_txt(X509_REQ *req, const char *attrname, int type, | 345 | X509_REQ_add1_attr_by_txt(X509_REQ *req, const char *attrname, int type, |
| @@ -332,6 +350,7 @@ X509_REQ_add1_attr_by_txt(X509_REQ *req, const char *attrname, int type, | |||
| 332 | return 1; | 350 | return 1; |
| 333 | return 0; | 351 | return 0; |
| 334 | } | 352 | } |
| 353 | LCRYPTO_ALIAS(X509_REQ_add1_attr_by_txt) | ||
| 335 | 354 | ||
| 336 | int | 355 | int |
| 337 | i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp) | 356 | i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp) |
| @@ -339,3 +358,4 @@ i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp) | |||
| 339 | req->req_info->enc.modified = 1; | 358 | req->req_info->enc.modified = 1; |
| 340 | return i2d_X509_REQ_INFO(req->req_info, pp); | 359 | return i2d_X509_REQ_INFO(req->req_info, pp); |
| 341 | } | 360 | } |
| 361 | LCRYPTO_ALIAS(i2d_re_X509_REQ_tbs) | ||
