diff options
Diffstat (limited to 'src/cli-gaa.c')
-rw-r--r-- | src/cli-gaa.c | 163 |
1 files changed, 75 insertions, 88 deletions
diff --git a/src/cli-gaa.c b/src/cli-gaa.c index 24ccb9210c..990168818f 100644 --- a/src/cli-gaa.c +++ b/src/cli-gaa.c @@ -134,7 +134,6 @@ void gaa_help(void) __gaa_helpsingle(0, "x509fmtder", "", "Use DER format for certificates to read from."); __gaa_helpsingle('f', "fingerprint", "", "Send the openpgp fingerprint, instead of the key."); __gaa_helpsingle(0, "disable-extensions", "", "Disable all the TLS extensions."); - __gaa_helpsingle(0, "xml", "", "Print the certificate information in XML format."); __gaa_helpsingle(0, "print-cert", "", "Print the certificate in PEM format."); __gaa_helpsingle(0, "recordsize", "integer ", "The maximum record size to advertize."); __gaa_helpsingle('V', "verbose", "", "More verbose output."); @@ -179,74 +178,72 @@ typedef struct _gaainfo gaainfo; struct _gaainfo { -#line 128 "cli.gaa" +#line 125 "cli.gaa" char *rest_args; -#line 119 "cli.gaa" - int insecure; #line 116 "cli.gaa" - char *port; + int insecure; #line 113 "cli.gaa" - char *opaque_prf_input; + char *port; #line 110 "cli.gaa" - char *authz_saml_assertion; + char *opaque_prf_input; #line 107 "cli.gaa" - char *authz_x509_attr_cert; + char *authz_saml_assertion; #line 104 "cli.gaa" - char *psk_key; + char *authz_x509_attr_cert; #line 101 "cli.gaa" - char *psk_username; + char *psk_key; #line 98 "cli.gaa" - char *srp_passwd; + char *psk_username; #line 95 "cli.gaa" - char *srp_username; + char *srp_passwd; #line 92 "cli.gaa" - char *x509_certfile; + char *srp_username; #line 89 "cli.gaa" - char *x509_keyfile; + char *x509_certfile; #line 86 "cli.gaa" - char *pgp_certfile; + char *x509_keyfile; #line 83 "cli.gaa" - char *pgp_trustdb; + char *pgp_certfile; #line 80 "cli.gaa" - char *pgp_keyring; + char *pgp_trustdb; #line 77 "cli.gaa" - char *pgp_keyfile; + char *pgp_keyring; #line 74 "cli.gaa" - char *x509_crlfile; + char *pgp_keyfile; #line 71 "cli.gaa" - char *x509_cafile; + char *x509_crlfile; #line 68 "cli.gaa" + char *x509_cafile; +#line 65 "cli.gaa" char **ctype; -#line 67 "cli.gaa" - int nctype; #line 64 "cli.gaa" + int nctype; +#line 61 "cli.gaa" char **kx; -#line 63 "cli.gaa" - int nkx; #line 60 "cli.gaa" + int nkx; +#line 57 "cli.gaa" char **macs; -#line 59 "cli.gaa" - int nmacs; #line 56 "cli.gaa" + int nmacs; +#line 53 "cli.gaa" char **comp; -#line 55 "cli.gaa" - int ncomp; #line 52 "cli.gaa" + int ncomp; +#line 49 "cli.gaa" char **proto; -#line 51 "cli.gaa" - int nproto; #line 48 "cli.gaa" + int nproto; +#line 45 "cli.gaa" char **ciphers; -#line 47 "cli.gaa" - int nciphers; #line 44 "cli.gaa" - int verbose; + int nciphers; #line 41 "cli.gaa" - int record_size; + int verbose; #line 38 "cli.gaa" - int print_cert; + int record_size; #line 35 "cli.gaa" - int xml; + int print_cert; #line 32 "cli.gaa" int disable_extensions; #line 29 "cli.gaa" @@ -315,7 +312,7 @@ static int gaa_error = 0; #define GAA_MULTIPLE_OPTION 3 #define GAA_REST 0 -#define GAA_NB_OPTION 38 +#define GAA_NB_OPTION 37 #define GAAOPTID_copyright 1 #define GAAOPTID_version 2 #define GAAOPTID_help 3 @@ -346,14 +343,13 @@ static int gaa_error = 0; #define GAAOPTID_verbose 28 #define GAAOPTID_recordsize 29 #define GAAOPTID_print_cert 30 -#define GAAOPTID_xml 31 -#define GAAOPTID_disable_extensions 32 -#define GAAOPTID_fingerprint 33 -#define GAAOPTID_x509fmtder 34 -#define GAAOPTID_crlf 35 -#define GAAOPTID_starttls 36 -#define GAAOPTID_resume 37 -#define GAAOPTID_debug 38 +#define GAAOPTID_disable_extensions 31 +#define GAAOPTID_fingerprint 32 +#define GAAOPTID_x509fmtder 33 +#define GAAOPTID_crlf 34 +#define GAAOPTID_starttls 35 +#define GAAOPTID_resume 36 +#define GAAOPTID_debug 37 #line 168 "gaa.skel" @@ -753,7 +749,6 @@ static int gaa_get_option_num(char *str, int status) GAA_CHECK1STR("", GAAOPTID_insecure); GAA_CHECK1STR("V", GAAOPTID_verbose); GAA_CHECK1STR("", GAAOPTID_print_cert); - GAA_CHECK1STR("", GAAOPTID_xml); GAA_CHECK1STR("", GAAOPTID_disable_extensions); GAA_CHECK1STR("f", GAAOPTID_fingerprint); GAA_CHECK1STR("", GAAOPTID_x509fmtder); @@ -794,7 +789,6 @@ static int gaa_get_option_num(char *str, int status) GAA_CHECKSTR("verbose", GAAOPTID_verbose); GAA_CHECKSTR("recordsize", GAAOPTID_recordsize); GAA_CHECKSTR("print-cert", GAAOPTID_print_cert); - GAA_CHECKSTR("xml", GAAOPTID_xml); GAA_CHECKSTR("disable-extensions", GAAOPTID_disable_extensions); GAA_CHECKSTR("fingerprint", GAAOPTID_fingerprint); GAA_CHECKSTR("x509fmtder", GAAOPTID_x509fmtder); @@ -860,35 +854,35 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) { case GAAOPTID_copyright: OK = 0; -#line 126 "cli.gaa" +#line 123 "cli.gaa" { print_license(); exit(0); ;}; return GAA_OK; break; case GAAOPTID_version: OK = 0; -#line 125 "cli.gaa" +#line 122 "cli.gaa" { cli_version(); exit(0); ;}; return GAA_OK; break; case GAAOPTID_help: OK = 0; -#line 123 "cli.gaa" +#line 120 "cli.gaa" { gaa_help(); exit(0); ;}; return GAA_OK; break; case GAAOPTID_list: OK = 0; -#line 122 "cli.gaa" +#line 119 "cli.gaa" { print_list(gaaval->verbose); exit(0); ;}; return GAA_OK; break; case GAAOPTID_insecure: OK = 0; -#line 120 "cli.gaa" +#line 117 "cli.gaa" { gaaval->insecure = 1 ;}; return GAA_OK; @@ -898,7 +892,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_port.arg1, gaa_getstr, GAATMP_port.size1); gaa_index++; -#line 117 "cli.gaa" +#line 114 "cli.gaa" { gaaval->port = GAATMP_port.arg1 ;}; return GAA_OK; @@ -908,7 +902,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_opaque_prf_input.arg1, gaa_getstr, GAATMP_opaque_prf_input.size1); gaa_index++; -#line 114 "cli.gaa" +#line 111 "cli.gaa" { gaaval->opaque_prf_input = GAATMP_opaque_prf_input.arg1 ;}; return GAA_OK; @@ -918,7 +912,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_authz_saml_assertion.arg1, gaa_getstr, GAATMP_authz_saml_assertion.size1); gaa_index++; -#line 111 "cli.gaa" +#line 108 "cli.gaa" { gaaval->authz_saml_assertion = GAATMP_authz_saml_assertion.arg1 ;}; return GAA_OK; @@ -928,7 +922,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_authz_x509_attr_cert.arg1, gaa_getstr, GAATMP_authz_x509_attr_cert.size1); gaa_index++; -#line 108 "cli.gaa" +#line 105 "cli.gaa" { gaaval->authz_x509_attr_cert = GAATMP_authz_x509_attr_cert.arg1 ;}; return GAA_OK; @@ -938,7 +932,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_pskkey.arg1, gaa_getstr, GAATMP_pskkey.size1); gaa_index++; -#line 105 "cli.gaa" +#line 102 "cli.gaa" { gaaval->psk_key = GAATMP_pskkey.arg1 ;}; return GAA_OK; @@ -948,7 +942,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_pskusername.arg1, gaa_getstr, GAATMP_pskusername.size1); gaa_index++; -#line 102 "cli.gaa" +#line 99 "cli.gaa" { gaaval->psk_username = GAATMP_pskusername.arg1 ;}; return GAA_OK; @@ -958,7 +952,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_srppasswd.arg1, gaa_getstr, GAATMP_srppasswd.size1); gaa_index++; -#line 99 "cli.gaa" +#line 96 "cli.gaa" { gaaval->srp_passwd = GAATMP_srppasswd.arg1 ;}; return GAA_OK; @@ -968,7 +962,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_srpusername.arg1, gaa_getstr, GAATMP_srpusername.size1); gaa_index++; -#line 96 "cli.gaa" +#line 93 "cli.gaa" { gaaval->srp_username = GAATMP_srpusername.arg1 ;}; return GAA_OK; @@ -978,7 +972,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_x509certfile.arg1, gaa_getstr, GAATMP_x509certfile.size1); gaa_index++; -#line 93 "cli.gaa" +#line 90 "cli.gaa" { gaaval->x509_certfile = GAATMP_x509certfile.arg1 ;}; return GAA_OK; @@ -988,7 +982,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_x509keyfile.arg1, gaa_getstr, GAATMP_x509keyfile.size1); gaa_index++; -#line 90 "cli.gaa" +#line 87 "cli.gaa" { gaaval->x509_keyfile = GAATMP_x509keyfile.arg1 ;}; return GAA_OK; @@ -998,7 +992,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_pgpcertfile.arg1, gaa_getstr, GAATMP_pgpcertfile.size1); gaa_index++; -#line 87 "cli.gaa" +#line 84 "cli.gaa" { gaaval->pgp_certfile = GAATMP_pgpcertfile.arg1 ;}; return GAA_OK; @@ -1008,7 +1002,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_pgptrustdb.arg1, gaa_getstr, GAATMP_pgptrustdb.size1); gaa_index++; -#line 84 "cli.gaa" +#line 81 "cli.gaa" { gaaval->pgp_trustdb = GAATMP_pgptrustdb.arg1 ;}; return GAA_OK; @@ -1018,7 +1012,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_pgpkeyring.arg1, gaa_getstr, GAATMP_pgpkeyring.size1); gaa_index++; -#line 81 "cli.gaa" +#line 78 "cli.gaa" { gaaval->pgp_keyring = GAATMP_pgpkeyring.arg1 ;}; return GAA_OK; @@ -1028,7 +1022,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_pgpkeyfile.arg1, gaa_getstr, GAATMP_pgpkeyfile.size1); gaa_index++; -#line 78 "cli.gaa" +#line 75 "cli.gaa" { gaaval->pgp_keyfile = GAATMP_pgpkeyfile.arg1 ;}; return GAA_OK; @@ -1038,7 +1032,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_x509crlfile.arg1, gaa_getstr, GAATMP_x509crlfile.size1); gaa_index++; -#line 75 "cli.gaa" +#line 72 "cli.gaa" { gaaval->x509_crlfile = GAATMP_x509crlfile.arg1 ;}; return GAA_OK; @@ -1048,7 +1042,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_x509cafile.arg1, gaa_getstr, GAATMP_x509cafile.size1); gaa_index++; -#line 72 "cli.gaa" +#line 69 "cli.gaa" { gaaval->x509_cafile = GAATMP_x509cafile.arg1 ;}; return GAA_OK; @@ -1056,7 +1050,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) case GAAOPTID_ctypes: OK = 0; GAA_LIST_FILL(GAATMP_ctypes.arg1, gaa_getstr, char*, GAATMP_ctypes.size1); -#line 69 "cli.gaa" +#line 66 "cli.gaa" { gaaval->ctype = GAATMP_ctypes.arg1; gaaval->nctype = GAATMP_ctypes.size1 ;}; return GAA_OK; @@ -1064,7 +1058,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) case GAAOPTID_kx: OK = 0; GAA_LIST_FILL(GAATMP_kx.arg1, gaa_getstr, char*, GAATMP_kx.size1); -#line 65 "cli.gaa" +#line 62 "cli.gaa" { gaaval->kx = GAATMP_kx.arg1; gaaval->nkx = GAATMP_kx.size1 ;}; return GAA_OK; @@ -1072,7 +1066,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) case GAAOPTID_macs: OK = 0; GAA_LIST_FILL(GAATMP_macs.arg1, gaa_getstr, char*, GAATMP_macs.size1); -#line 61 "cli.gaa" +#line 58 "cli.gaa" { gaaval->macs = GAATMP_macs.arg1; gaaval->nmacs = GAATMP_macs.size1 ;}; return GAA_OK; @@ -1080,7 +1074,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) case GAAOPTID_comp: OK = 0; GAA_LIST_FILL(GAATMP_comp.arg1, gaa_getstr, char*, GAATMP_comp.size1); -#line 57 "cli.gaa" +#line 54 "cli.gaa" { gaaval->comp = GAATMP_comp.arg1; gaaval->ncomp = GAATMP_comp.size1 ;}; return GAA_OK; @@ -1088,7 +1082,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) case GAAOPTID_protocols: OK = 0; GAA_LIST_FILL(GAATMP_protocols.arg1, gaa_getstr, char*, GAATMP_protocols.size1); -#line 53 "cli.gaa" +#line 50 "cli.gaa" { gaaval->proto = GAATMP_protocols.arg1; gaaval->nproto = GAATMP_protocols.size1 ;}; return GAA_OK; @@ -1096,14 +1090,14 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) case GAAOPTID_ciphers: OK = 0; GAA_LIST_FILL(GAATMP_ciphers.arg1, gaa_getstr, char*, GAATMP_ciphers.size1); -#line 49 "cli.gaa" +#line 46 "cli.gaa" { gaaval->ciphers = GAATMP_ciphers.arg1; gaaval->nciphers = GAATMP_ciphers.size1 ;}; return GAA_OK; break; case GAAOPTID_verbose: OK = 0; -#line 45 "cli.gaa" +#line 42 "cli.gaa" { gaaval->verbose = 1 ;}; return GAA_OK; @@ -1113,22 +1107,15 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAATMP_recordsize.arg1, gaa_getint, GAATMP_recordsize.size1); gaa_index++; -#line 42 "cli.gaa" +#line 39 "cli.gaa" { gaaval->record_size = GAATMP_recordsize.arg1 ;}; return GAA_OK; break; case GAAOPTID_print_cert: OK = 0; -#line 39 "cli.gaa" -{ gaaval->print_cert = 1 ;}; - - return GAA_OK; - break; - case GAAOPTID_xml: - OK = 0; #line 36 "cli.gaa" -{ gaaval->xml = 1 ;}; +{ gaaval->print_cert = 1 ;}; return GAA_OK; break; @@ -1188,7 +1175,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) GAA_TESTMOREARGS; GAA_FILL(GAAREST_tmp.arg1, gaa_getstr, GAAREST_tmp.size1); gaa_index++; -#line 129 "cli.gaa" +#line 126 "cli.gaa" { gaaval->rest_args = GAAREST_tmp.arg1; ;}; return GAA_OK; @@ -1217,13 +1204,13 @@ int gaa(int argc, char **argv, gaainfo *gaaval) if(inited == 0) { -#line 131 "cli.gaa" +#line 128 "cli.gaa" { gaaval->resume=0; gaaval->port="443"; gaaval->rest_args=NULL; gaaval->ciphers=NULL; gaaval->kx=NULL; gaaval->comp=NULL; gaaval->macs=NULL; gaaval->ctype=NULL; gaaval->nciphers=0; gaaval->nkx=0; gaaval->ncomp=0; gaaval->nmacs=0; gaaval->nctype = 0; gaaval->record_size=0; gaaval->fingerprint=0; gaaval->pgp_trustdb=NULL; gaaval->pgp_keyring=NULL; gaaval->x509_crlfile = NULL; gaaval->x509_cafile = NULL; gaaval->pgp_keyfile=NULL; gaaval->pgp_certfile=NULL; gaaval->disable_extensions = 0; - gaaval->x509_keyfile=NULL; gaaval->x509_certfile=NULL; gaaval->crlf = 0; gaaval->xml = 0; + gaaval->x509_keyfile=NULL; gaaval->x509_certfile=NULL; gaaval->crlf = 0; gaaval->srp_username=NULL; gaaval->srp_passwd=NULL; gaaval->fmtder = 0; gaaval->starttls =0; gaaval->debug = 0; gaaval->print_cert = 0; gaaval->verbose = 0; gaaval->psk_key = NULL; gaaval->psk_username = NULL; @@ -1376,7 +1363,7 @@ static int gaa_internal_get_next_str(FILE *file, gaa_str_node *tmp_str, int argc len++; a = fgetc( file); - if(a==EOF) return 0; /* a = ' '; */ + if(a==EOF) return 0; //a = ' '; } len += 1; |