From: Dr. Stephen Henson Date: Sat, 13 Nov 2004 13:26:06 +0000 (+0000) Subject: Fix x509.c so it creates serial number file again if no X-Git-Tag: BEN_FIPS_TEST_6~14^2~45 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=78df5a2f1e050c7d1f16c549c82bd3ee7057fe6c;p=oweals%2Fopenssl.git Fix x509.c so it creates serial number file again if no serial number is supplied on command line. --- 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;