diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2004-11-13 13:26:06 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2004-11-13 13:26:06 +0000 |
commit | 78df5a2f1e050c7d1f16c549c82bd3ee7057fe6c (patch) | |
tree | c817f1fae3c8fe86104b1dce8716a10539fe5e64 /apps | |
parent | 6c9f57d6294acfda3f9ad694b5e7b3f0c7f6a5bd (diff) |
Fix x509.c so it creates serial number file again if no
serial number is supplied on command line.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/x509.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/x509.c b/apps/x509.c index d00511c78a..b2288b69c2 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -606,9 +606,12 @@ bad: sno = ASN1_INTEGER_new(); if (!sno || !rand_serial(NULL, sno)) goto end; + if (!X509_set_serialNumber(x, sno)) + goto end; + ASN1_INTEGER_free(sno); + sno = NULL; } - - if (!X509_set_serialNumber(x, sno)) + else if (!X509_set_serialNumber(x, sno)) goto end; if (!X509_set_issuer_name(x,req->req_info->subject)) goto end; |