genkey: skip temporary cert generation for CSR case

This commit is contained in:
Joe Orton 2014-02-13 13:02:36 +00:00
parent 7731df4cd6
commit abc69c0f6c
2 changed files with 14 additions and 15 deletions

View File

@ -4,7 +4,7 @@
Summary: SSL certificate and key management utilities Summary: SSL certificate and key management utilities
Name: crypto-utils Name: crypto-utils
Version: 2.4.1 Version: 2.4.1
Release: 49%{?dist} Release: 50%{?dist}
Group: Applications/System Group: Applications/System
# certwatch.c is GPLv2 # certwatch.c is GPLv2
# pemutil.c etc are (MPLv1.1+ or GPLv2+ or LPGLv2+) # pemutil.c etc are (MPLv1.1+ or GPLv2+ or LPGLv2+)
@ -135,6 +135,9 @@ chmod -R u+w $RPM_BUILD_ROOT
%{perl_vendorarch}/auto/Crypt %{perl_vendorarch}/auto/Crypt
%changelog %changelog
* Thu Feb 13 2014 Joe Orton <jorton@redhat.com> - 2.4.1-50
- genkey: skip temporary cert generation for CSR case
* Thu Feb 13 2014 Joe Orton <jorton@redhat.com> - 2.4.1-49 * Thu Feb 13 2014 Joe Orton <jorton@redhat.com> - 2.4.1-49
- genkey: fix noise file handling - genkey: fix noise file handling

View File

@ -1075,7 +1075,10 @@ sub makeCertOpenSSL
exit 1; exit 1;
} }
} }
unlink($noisefile); if ($noisefile) {
unlink($noisefile);
$noisefile = '';
}
} }
# Create a certificate-signing request file that can be submitted to a # Create a certificate-signing request file that can be submitted to a
@ -1430,20 +1433,13 @@ sub genReqWindow
$subject, 730, $randfile, $tmpPasswordFile); $subject, 730, $randfile, $tmpPasswordFile);
} }
# Now make a temporary cert
if (!$genreq_mode) { # Now make a temporary cert; skip for OpenSSL since it would
if (!-f $certfile) { # overwrite the existing key.
if ($nss) { if (!$genreq_mode && !-f $certfile && $nss) {
makeCertNSS($certfile, makeCertNSS($certfile,
$subject, $cert_days, $nssNickname, $subject, $cert_days, $nssNickname,
$randfile, $tmpPasswordFile); $randfile, $tmpPasswordFile);
} else {
makeCertOpenSSL($keyfile,$certfile,
$subject, $cert_days,
$randfile, $tmpPasswordFile);
}
}
} }
undef $csrtext; undef $csrtext;