From e510c62a38274c9d8bb03deb4a88bfcac9c3e13b Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sat, 13 Nov 2004 13:26:24 +0000 Subject: [PATCH] Fix x509.c so it creates serial number file again if no serial number is supplied on command line. --- apps/x509.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/x509.c b/apps/x509.c index dedd9f1a9a..167b94f85f 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -598,9 +598,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; -- 2.25.1