diff options
author | Simon Josefsson <simon@josefsson.org> | 2006-09-08 08:05:40 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2006-09-08 08:05:40 +0000 |
commit | 5864fb4e6829dcfdfde90b8a964682f864582888 (patch) | |
tree | 583b531adbd19e95e415007f866701db6de89a60 | |
parent | e2268816a928c16d0a9411eee6989b927e7e4507 (diff) | |
download | gnutls-5864fb4e6829dcfdfde90b8a964682f864582888.tar.gz |
Revert 2.113.2.1 fix, it solved one problem but generated another.
-rw-r--r-- | src/certtool.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/certtool.c b/src/certtool.c index b1d2f5729b..4894752f57 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004,2005,2006 Free Software Foundation + * Copyright (C) 2004,2005 Free Software Foundation * Copyright (C) 2004 Simon Josefsson * Copyright (C) 2003 Nikos Mavroyanopoulos * @@ -288,27 +288,21 @@ 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)); exit (1); } - 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. " @@ -331,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 { |