diff options
author | Simon Josefsson <simon@josefsson.org> | 2006-09-21 12:25:09 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2006-09-21 12:25:09 +0000 |
commit | 4b053d66035ef48aef79db9a4add96fbfaa34e01 (patch) | |
tree | 8ee5e14432122d58a21b81ef4685bb7393a419a3 | |
parent | 44308c1f9aa8bb32751ce7d9194e4657cfb30239 (diff) | |
download | gnutls-4b053d66035ef48aef79db9a4add96fbfaa34e01.tar.gz |
Revert last patch.
-rw-r--r-- | src/certtool.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 { |