gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, gnutls_2_10_x, updated. gnutls_2_10_0-3-g470731


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_10_x, updated. gnutls_2_10_0-3-g4707315
Date: Sat, 26 Jun 2010 19:53:02 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=470731587395a6c8e60340e101a39cd4d5ca1bde

The branch, gnutls_2_10_x has been updated
       via  470731587395a6c8e60340e101a39cd4d5ca1bde (commit)
      from  1255895921a4ef639df784996980ade20918253c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 470731587395a6c8e60340e101a39cd4d5ca1bde
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Jun 26 21:51:03 2010 +0200

    When generating private key allow usage of --pkcs-cipher flag.

-----------------------------------------------------------------------

Summary of changes:
 src/certtool.c |   58 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/src/certtool.c b/src/certtool.c
index 860ab90..c4bc928 100644
--- a/src/certtool.c
+++ b/src/certtool.c
@@ -198,6 +198,35 @@ generate_private_key_int (void)
   return key;
 }
 
+static int
+cipher_to_flags (const char *cipher)
+{
+  if (strcasecmp (cipher, "3des") == 0)
+    {
+      return GNUTLS_PKCS_USE_PBES2_3DES;
+    }
+  else if (strcasecmp (cipher, "aes-128") == 0)
+    {
+      return GNUTLS_PKCS_USE_PBES2_AES_128;
+    }
+  else if (strcasecmp (cipher, "aes-192") == 0)
+    {
+      return GNUTLS_PKCS_USE_PBES2_AES_192;
+    }
+  else if (strcasecmp (cipher, "aes-256") == 0)
+    {
+      return GNUTLS_PKCS_USE_PBES2_AES_256;
+    }
+  else if (strcasecmp (cipher, "rc2-40") == 0)
+    {
+      return GNUTLS_PKCS_USE_PKCS12_RC2_40;
+    }
+
+  error (EXIT_FAILURE, 0, "Unknown cipher %s\n", cipher);
+  return -1;
+}
+
+
 static void
 print_private_key (gnutls_x509_privkey_t key)
 {
@@ -223,7 +252,7 @@ print_private_key (gnutls_x509_privkey_t key)
       if (info.export)
        flags = GNUTLS_PKCS_USE_PKCS12_RC2_40;
       else
-       flags = GNUTLS_PKCS_USE_PKCS12_3DES;
+       flags = cipher_to_flags (info.pkcs_cipher);
 
       if ((pass = get_confirmed_pass (true)) == NULL || *pass == '\0')
        flags = GNUTLS_PKCS_PLAIN;
@@ -2437,33 +2466,6 @@ verify_crl (void)
   fprintf (outfile, "\n");
 }
 
-static int
-cipher_to_flags (const char *cipher)
-{
-  if (strcasecmp (cipher, "3des") == 0)
-    {
-      return GNUTLS_PKCS_USE_PBES2_3DES;
-    }
-  else if (strcasecmp (cipher, "aes-128") == 0)
-    {
-      return GNUTLS_PKCS_USE_PBES2_AES_128;
-    }
-  else if (strcasecmp (cipher, "aes-192") == 0)
-    {
-      return GNUTLS_PKCS_USE_PBES2_AES_192;
-    }
-  else if (strcasecmp (cipher, "aes-256") == 0)
-    {
-      return GNUTLS_PKCS_USE_PBES2_AES_256;
-    }
-  else if (strcasecmp (cipher, "rc2-40") == 0)
-    {
-      return GNUTLS_PKCS_USE_PKCS12_RC2_40;
-    }
-
-  error (EXIT_FAILURE, 0, "Unknown cipher %s\n", cipher);
-  return -1;
-}
 
 void
 generate_pkcs8 (void)


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]