case GAAOPTID_list:
OK = 0;
#line 119 "cli.gaa"
-{ print_list(); exit(0); ;};
+{ print_list(gaaval->verbose); exit(0); ;};
return GAA_OK;
break;
#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"
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++)
}
{
- const gnutls_cipher_algorithm_t *p = gnutls_mac_list();
+ const gnutls_mac_algorithm_t *p = gnutls_mac_list();
printf ("MACs: ");
for (; *p; p++)
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);
case GAAOPTID_list:
OK = 0;
#line 110 "serv.gaa"
-{ print_list(); exit(0); ;};
+{ print_list(0); exit(0); ;};
return GAA_OK;
break;
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"