diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-09-16 18:46:16 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-09-16 22:33:25 +0100 |
commit | 95ed0e7c1f4206191c1b0288e352010e70e252db (patch) | |
tree | 69a21e3207ae88e33cf26812dd711081b3e5ee13 /crypto/x509/x509_req.c | |
parent | 5cf6abd805b9f15127f9f343a6e3b662565f93d5 (diff) | |
download | openssl-95ed0e7c1f4206191c1b0288e352010e70e252db.tar.gz |
Embed X509_REQ_INFO
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/x509/x509_req.c')
-rw-r--r-- | crypto/x509/x509_req.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c index 70e27b8306..34336941e5 100644 --- a/crypto/x509/x509_req.c +++ b/crypto/x509/x509_req.c @@ -81,7 +81,7 @@ X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) goto err; } - ri = ret->req_info; + ri = &ret->req_info; ri->version->length = 1; ri->version->data = OPENSSL_malloc(1); @@ -112,9 +112,9 @@ X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) { - if ((req == NULL) || (req->req_info == NULL)) + if (req == NULL) return (NULL); - return (X509_PUBKEY_get(req->req_info->pubkey)); + return (X509_PUBKEY_get(req->req_info.pubkey)); } int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) @@ -195,7 +195,7 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req) int idx, *pnid; const unsigned char *p; - if ((req == NULL) || (req->req_info == NULL) || !ext_nids) + if ((req == NULL) || !ext_nids) return (NULL); for (pnid = ext_nids; *pnid != NID_undef; pnid++) { idx = X509_REQ_get_attr_by_NID(req, *pnid, -1); @@ -244,33 +244,33 @@ int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts) int X509_REQ_get_attr_count(const X509_REQ *req) { - return X509at_get_attr_count(req->req_info->attributes); + return X509at_get_attr_count(req->req_info.attributes); } int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) { - return X509at_get_attr_by_NID(req->req_info->attributes, nid, lastpos); + return X509at_get_attr_by_NID(req->req_info.attributes, nid, lastpos); } int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, int lastpos) { - return X509at_get_attr_by_OBJ(req->req_info->attributes, obj, lastpos); + return X509at_get_attr_by_OBJ(req->req_info.attributes, obj, lastpos); } X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc) { - return X509at_get_attr(req->req_info->attributes, loc); + return X509at_get_attr(req->req_info.attributes, loc); } X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc) { - return X509at_delete_attr(req->req_info->attributes, loc); + return X509at_delete_attr(req->req_info.attributes, loc); } int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) { - if (X509at_add1_attr(&req->req_info->attributes, attr)) + if (X509at_add1_attr(&req->req_info.attributes, attr)) return 1; return 0; } @@ -279,7 +279,7 @@ int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, const ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len) { - if (X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj, + if (X509at_add1_attr_by_OBJ(&req->req_info.attributes, obj, type, bytes, len)) return 1; return 0; @@ -289,7 +289,7 @@ int X509_REQ_add1_attr_by_NID(X509_REQ *req, int nid, int type, const unsigned char *bytes, int len) { - if (X509at_add1_attr_by_NID(&req->req_info->attributes, nid, + if (X509at_add1_attr_by_NID(&req->req_info.attributes, nid, type, bytes, len)) return 1; return 0; @@ -299,7 +299,7 @@ int X509_REQ_add1_attr_by_txt(X509_REQ *req, const char *attrname, int type, const unsigned char *bytes, int len) { - if (X509at_add1_attr_by_txt(&req->req_info->attributes, attrname, + if (X509at_add1_attr_by_txt(&req->req_info.attributes, attrname, type, bytes, len)) return 1; return 0; @@ -307,10 +307,10 @@ int X509_REQ_add1_attr_by_txt(X509_REQ *req, long X509_REQ_get_version(X509_REQ *req) { - return ASN1_INTEGER_get(req->req_info->version); + return ASN1_INTEGER_get(req->req_info.version); } X509_NAME *X509_REQ_get_subject_name(X509_REQ *req) { - return req->req_info->subject; + return req->req_info.subject; } |