]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Use gnutls_cipher_suite_info.
authorSimon Josefsson <simon@josefsson.org>
Wed, 4 Apr 2007 14:13:47 +0000 (14:13 +0000)
committerSimon Josefsson <simon@josefsson.org>
Wed, 4 Apr 2007 14:13:47 +0000 (14:13 +0000)
src/cli-gaa.c
src/cli.gaa
src/common.c
src/common.h
src/serv-gaa.c
src/serv.gaa

index 1bd9d35bd5bb08cecd98cc2b6e704d59b5ac0796..3460050b94cb67f00e52e6428c2883598c317c38 100644 (file)
@@ -869,7 +869,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
        case GAAOPTID_list:
        OK = 0;
 #line 119 "cli.gaa"
-{ print_list(); exit(0); ;};
+{ print_list(gaaval->verbose); exit(0); ;};
 
                return GAA_OK;
                break;
index 8a33c86fa11c53279af9943974c9879d75ef9aa2..64b5394fef5f14050408e9ac7eff8f1358149205 100644 (file)
@@ -116,7 +116,7 @@ option (p, port) STR "PORT" { $port = $1 } "The port to connect to."
 #int insecure;
 option (insecure) { $insecure = 1 } "Don't abort program if server certificate can't be validated."
 
-option (l, list) { print_list(); exit(0); } "Print a list of the supported algorithms and modes."
+option (l, list) { print_list($verbose); exit(0); } "Print a list of the supported algorithms and modes."
 option (h, help) { gaa_help(); exit(0); } "prints this help"
 
 option (v, version) { cli_version(); exit(0); } "prints the program's version number"
index 79858731972e6d79abc4404a441208afb6354208..f7cfebfdad6c388b8cac41a9a63f00856086a028 100644 (file)
@@ -590,14 +590,38 @@ print_cert_info (gnutls_session session, const char *hostname)
       break;
 #endif
     }
-
 }
 
 void
-print_list (void)
+print_list (int verbose)
 {
   {
-    const gnutls_protocol_t *p = gnutls_certificate_type_list();
+    size_t i;
+    const char *name;
+    char id[2];
+    gnutls_kx_algorithm_t kx;
+    gnutls_cipher_algorithm_t cipher;
+    gnutls_mac_algorithm_t mac;
+    gnutls_protocol_t version;
+
+    printf ("Cipher suites:\n");
+    for (i = 0; (name = gnutls_cipher_suite_info
+                (i, id, &kx, &cipher, &mac, &version)); i++)
+      {
+       printf ("%-50s\t0x%02x, 0x%02x\t%s\n",
+               name,
+               (unsigned char) id[0], (unsigned char) id[1],
+               gnutls_protocol_get_name (version));
+       if (verbose)
+         printf ("\tKey exchange: %s\n\tCipher: %s\n\tMAC: %s\n\n",
+                 gnutls_kx_get_name (kx),
+                 gnutls_cipher_get_name (cipher),
+                 gnutls_mac_get_name (mac));
+      }
+  }
+
+  {
+    const gnutls_certificate_type_t *p = gnutls_certificate_type_list();
 
     printf ("Certificate types: ");
     for (; *p; p++)
@@ -639,7 +663,7 @@ print_list (void)
   }
 
   {
-    const gnutls_cipher_algorithm_t *p = gnutls_mac_list();
+    const gnutls_mac_algorithm_t *p = gnutls_mac_list();
 
     printf ("MACs: ");
     for (; *p; p++)
index 706280f73cb84f1f1055cc061a77210f9eebf215..966077146a380db9948405b815eb9b241ea6bfee 100644 (file)
@@ -25,7 +25,7 @@ extern const char str_unknown[];
 
 int print_info (gnutls_session state, const char *hostname);
 void print_cert_info (gnutls_session state, const char *hostname);
-void print_list (void);
+void print_list (int verbose);
 
 void parse_comp (char **comp, int ncomp, int *comp_priority);
 void parse_kx (char **kx, int nkx, int *kx_priority);
index c6ef41bc4cab8306d3d5917fa9fb9ed62d7c6325..f0fe9c4b57039b69df3c336f5e495e9f39b98b06 100644 (file)
@@ -851,7 +851,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
        case GAAOPTID_list:
        OK = 0;
 #line 110 "serv.gaa"
-{ print_list(); exit(0); ;};
+{ print_list(0); exit(0); ;};
 
                return GAA_OK;
                break;
index e9b5429173382e33ada35f51eae5b88372ed348e..19ab745cd81965319727a863845565273f47f3dd 100644 (file)
@@ -107,7 +107,7 @@ option (kx) *STR "kx1 kx2..." { $kx = $1; $nkx = @1 } "Key exchange methods to e
 option (ctypes) *STR "certType1 certType2..." { $ctype = $1; $nctype = @1 } "Certificate types to enable."
 
 
-option (l, list) { print_list(); exit(0); } "Print a list of the supported algorithms  and modes."
+option (l, list) { print_list(0); exit(0); } "Print a list of the supported algorithms  and modes."
 option (h, help) { gaa_help(); exit(0); } "prints this help"
 
 option (v, version) { serv_version(); exit(0); } "prints the program's version number"