From: Simon Josefsson Date: Thu, 21 Sep 2006 12:25:09 +0000 (+0000) Subject: Revert last patch. X-Git-Tag: gnutls_1_5_1~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b053d66035ef48aef79db9a4add96fbfaa34e01;p=thirdparty%2Fgnutls.git Revert last patch. --- diff --git a/src/certtool.c b/src/certtool.c index 180a7c996e..52c7a26d55 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -288,7 +288,7 @@ generate_certificate (gnutls_x509_privkey * ret_key, gnutls_x509_crt ca_crt) unsigned int usage = 0, server; gnutls_x509_crq crq; /* request */ - ret = gnutls_x509_crt_init (&crt); + ret = gnutls_x509_crt_init (&crt); if (ret < 0) { fprintf (stderr, "crt_init: %s\n", gnutls_strerror (ret)); @@ -296,20 +296,13 @@ generate_certificate (gnutls_x509_privkey * ret_key, gnutls_x509_crt ca_crt) } - key = load_private_key (1); - - result = gnutls_x509_crt_set_key (crt, key); - if (result < 0) - { - fprintf (stderr, "set_key: %s\n", gnutls_strerror (result)); - exit (1); - } - crq = load_request (); if (crq == NULL) { + key = load_private_key (1); + if (!batch) fprintf (stderr, "Please enter the details of the certificate's distinguished name. " @@ -332,6 +325,13 @@ generate_certificate (gnutls_x509_privkey * ret_key, gnutls_x509_crt ca_crt) get_pkcs9_email_crt_set (crt); + result = gnutls_x509_crt_set_key (crt, key); + if (result < 0) + { + fprintf (stderr, "set_key: %s\n", gnutls_strerror (result)); + exit (1); + } + } else {