diff options
author | beck <> | 2002-05-15 02:29:21 +0000 |
---|---|---|
committer | beck <> | 2002-05-15 02:29:21 +0000 |
commit | b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch) | |
tree | fa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/x509/x509_req.c | |
parent | e471e1ea98d673597b182ea85f29e30c97cd08b5 (diff) | |
download | openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2 openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/x509/x509_req.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_req.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/x509/x509_req.c b/src/lib/libcrypto/x509/x509_req.c index 7eca1bd57a..0affa3bf30 100644 --- a/src/lib/libcrypto/x509/x509_req.c +++ b/src/lib/libcrypto/x509/x509_req.c | |||
@@ -156,9 +156,9 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req) | |||
156 | for(i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) { | 156 | for(i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) { |
157 | attr = sk_X509_ATTRIBUTE_value(sk, i); | 157 | attr = sk_X509_ATTRIBUTE_value(sk, i); |
158 | if(X509_REQ_extension_nid(OBJ_obj2nid(attr->object))) { | 158 | if(X509_REQ_extension_nid(OBJ_obj2nid(attr->object))) { |
159 | if(attr->set && sk_ASN1_TYPE_num(attr->value.set)) | 159 | if(attr->single) ext = attr->value.single; |
160 | else if(sk_ASN1_TYPE_num(attr->value.set)) | ||
160 | ext = sk_ASN1_TYPE_value(attr->value.set, 0); | 161 | ext = sk_ASN1_TYPE_value(attr->value.set, 0); |
161 | else ext = attr->value.single; | ||
162 | break; | 162 | break; |
163 | } | 163 | } |
164 | } | 164 | } |
@@ -199,7 +199,7 @@ int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, | |||
199 | if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err; | 199 | if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err; |
200 | if(!sk_ASN1_TYPE_push(attr->value.set, at)) goto err; | 200 | if(!sk_ASN1_TYPE_push(attr->value.set, at)) goto err; |
201 | at = NULL; | 201 | at = NULL; |
202 | attr->set = 1; | 202 | attr->single = 0; |
203 | attr->object = OBJ_nid2obj(nid); | 203 | attr->object = OBJ_nid2obj(nid); |
204 | if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err; | 204 | if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err; |
205 | return 1; | 205 | return 1; |
@@ -251,8 +251,8 @@ int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) | |||
251 | } | 251 | } |
252 | 252 | ||
253 | int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, | 253 | int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, |
254 | ASN1_OBJECT *obj, int type, | 254 | const ASN1_OBJECT *obj, int type, |
255 | unsigned char *bytes, int len) | 255 | const unsigned char *bytes, int len) |
256 | { | 256 | { |
257 | if(X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj, | 257 | if(X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj, |
258 | type, bytes, len)) return 1; | 258 | type, bytes, len)) return 1; |
@@ -261,7 +261,7 @@ int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, | |||
261 | 261 | ||
262 | int X509_REQ_add1_attr_by_NID(X509_REQ *req, | 262 | int X509_REQ_add1_attr_by_NID(X509_REQ *req, |
263 | int nid, int type, | 263 | int nid, int type, |
264 | unsigned char *bytes, int len) | 264 | const unsigned char *bytes, int len) |
265 | { | 265 | { |
266 | if(X509at_add1_attr_by_NID(&req->req_info->attributes, nid, | 266 | if(X509at_add1_attr_by_NID(&req->req_info->attributes, nid, |
267 | type, bytes, len)) return 1; | 267 | type, bytes, len)) return 1; |
@@ -269,8 +269,8 @@ int X509_REQ_add1_attr_by_NID(X509_REQ *req, | |||
269 | } | 269 | } |
270 | 270 | ||
271 | int X509_REQ_add1_attr_by_txt(X509_REQ *req, | 271 | int X509_REQ_add1_attr_by_txt(X509_REQ *req, |
272 | char *attrname, int type, | 272 | const char *attrname, int type, |
273 | unsigned char *bytes, int len) | 273 | const unsigned char *bytes, int len) |
274 | { | 274 | { |
275 | if(X509at_add1_attr_by_txt(&req->req_info->attributes, attrname, | 275 | if(X509at_add1_attr_by_txt(&req->req_info->attributes, attrname, |
276 | type, bytes, len)) return 1; | 276 | type, bytes, len)) return 1; |