summaryrefslogtreecommitdiff
path: root/lib/libcrypto/x509/x509_r2x.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-04-18 01:59:01 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-04-18 01:59:01 +0000
commit35188ebe93027be05901875cfba50dc273f9d4a6 (patch)
treedf10bf6b1538fafc57e8151223e96d30ad35bcc1 /lib/libcrypto/x509/x509_r2x.c
parent46e0c430ebc727cb807e12fde0c7e7f582b4c1f6 (diff)
blunt force knf
Diffstat (limited to 'lib/libcrypto/x509/x509_r2x.c')
-rw-r--r--lib/libcrypto/x509/x509_r2x.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/libcrypto/x509/x509_r2x.c b/lib/libcrypto/x509/x509_r2x.c
index 254a14693d9..f084447334f 100644
--- a/lib/libcrypto/x509/x509_r2x.c
+++ b/lib/libcrypto/x509/x509_r2x.c
@@ -66,27 +66,25 @@
#include <openssl/buffer.h>
X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
- {
+{
X509 *ret=NULL;
X509_CINF *xi=NULL;
X509_NAME *xn;
- if ((ret=X509_new()) == NULL)
- {
+ if ((ret=X509_new()) == NULL) {
X509err(X509_F_X509_REQ_TO_X509,ERR_R_MALLOC_FAILURE);
goto err;
- }
+ }
/* duplicate the request */
xi=ret->cert_info;
- if (sk_X509_ATTRIBUTE_num(r->req_info->attributes) != 0)
- {
+ if (sk_X509_ATTRIBUTE_num(r->req_info->attributes) != 0) {
if ((xi->version=M_ASN1_INTEGER_new()) == NULL) goto err;
if (!ASN1_INTEGER_set(xi->version,2)) goto err;
/* xi->extensions=ri->attributes; <- bad, should not ever be done
ri->attributes=NULL; */
- }
+ }
xn=X509_REQ_get_subject_name(r);
if (X509_set_subject_name(ret,X509_NAME_dup(xn)) == 0)
@@ -103,12 +101,11 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
if (!X509_sign(ret,pkey,EVP_md5()))
goto err;
- if (0)
- {
+ if (0) {
err:
X509_free(ret);
ret=NULL;
- }
- return(ret);
}
+ return(ret);
+}