diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-15 11:34:33 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-15 11:34:33 +0000 |
commit | 9c43b5569f3c8da65e376254497592d6005a03c1 (patch) | |
tree | 568e52e3de9651a2c9f0bb72e57bbc86c1dabbc1 /src | |
parent | 157c25871735d3e84a88bb6b087360cf37c29e57 (diff) | |
download | gnutls-9c43b5569f3c8da65e376254497592d6005a03c1.tar.gz |
updated client and server
Diffstat (limited to 'src')
-rw-r--r-- | src/cli-gaa.c | 97 | ||||
-rw-r--r-- | src/cli-gaa.h | 30 | ||||
-rw-r--r-- | src/cli.c | 135 | ||||
-rw-r--r-- | src/cli.gaa | 7 | ||||
-rw-r--r-- | src/serv-gaa.c | 22 | ||||
-rw-r--r-- | src/serv.gaa | 4 |
6 files changed, 152 insertions, 143 deletions
diff --git a/src/cli-gaa.c b/src/cli-gaa.c index a765d57fa7..72da9d35fc 100644 --- a/src/cli-gaa.c +++ b/src/cli-gaa.c @@ -105,12 +105,13 @@ void gaa_help() printf("cli help\nUsage: cli [options] hostname""\n"); __gaa_helpsingle('r', "resume", "", "Connect, establish a session. Connect again and resume this session."); __gaa_helpsingle('p', "port", """integer"" ", "The port to connect to."); + __gaa_helpsingle(0, "recordsize", """integer"" ", "The maximum record size to advertize."); __gaa_helpsingle(0, "ciphers", """cipher1 cipher2..."" ", "Ciphers to enable."); __gaa_helpsingle(0, "protocols", """protocol1 protocol2..."" ", "Protocols to enable."); __gaa_helpsingle(0, "comp", """comp1 comp2..."" ", "Compression methods to enable."); __gaa_helpsingle(0, "macs", """mac1 mac2..."" ", "MACs to enable."); __gaa_helpsingle(0, "kx", """kx1 kx2..."" ", "Key exchange methods to enable."); - __gaa_helpsingle(0, "certtypes", """certtype1 certtype2..."" ", "Certificate types to enable."); + __gaa_helpsingle(0, "ctypes", """certType1 certType2..."" ", "Certificate types to enable."); __gaa_helpsingle('l', "list", "", "Print a list of the supported algorithms and modes."); __gaa_helpsingle('h', "help", "", "prints this help"); @@ -127,34 +128,36 @@ typedef struct _gaainfo gaainfo; struct _gaainfo { -#line 39 "cli.gaa" +#line 42 "cli.gaa" char **rest_args; -#line 38 "cli.gaa" +#line 41 "cli.gaa" int nrest_args; -#line 31 "cli.gaa" +#line 34 "cli.gaa" char **ctype; -#line 30 "cli.gaa" +#line 33 "cli.gaa" int nctype; -#line 27 "cli.gaa" +#line 30 "cli.gaa" char **kx; -#line 26 "cli.gaa" +#line 29 "cli.gaa" int nkx; -#line 23 "cli.gaa" +#line 26 "cli.gaa" char **macs; -#line 22 "cli.gaa" +#line 25 "cli.gaa" int nmacs; -#line 19 "cli.gaa" +#line 22 "cli.gaa" char **comp; -#line 18 "cli.gaa" +#line 21 "cli.gaa" int ncomp; -#line 15 "cli.gaa" +#line 18 "cli.gaa" char **proto; -#line 14 "cli.gaa" +#line 17 "cli.gaa" int nproto; -#line 11 "cli.gaa" +#line 14 "cli.gaa" char **ciphers; -#line 10 "cli.gaa" +#line 13 "cli.gaa" int nciphers; +#line 9 "cli.gaa" + int record_size; #line 6 "cli.gaa" int port; #line 3 "cli.gaa" @@ -213,17 +216,18 @@ int gaa_error = 0; #define GAA_MULTIPLE_OPTION 3 #define GAA_REST 0 -#define GAA_NB_OPTION 10 +#define GAA_NB_OPTION 11 #define GAAOPTID_help 1 #define GAAOPTID_list 2 -#define GAAOPTID_certtypes 3 +#define GAAOPTID_ctypes 3 #define GAAOPTID_kx 4 #define GAAOPTID_macs 5 #define GAAOPTID_comp 6 #define GAAOPTID_protocols 7 #define GAAOPTID_ciphers 8 -#define GAAOPTID_port 9 -#define GAAOPTID_resume 10 +#define GAAOPTID_recordsize 9 +#define GAAOPTID_port 10 +#define GAAOPTID_resume 11 #line 168 "gaa.skel" @@ -406,7 +410,7 @@ float gaa_getfloat(char *arg) } /* option structures */ -struct GAAOPTION_certtypes +struct GAAOPTION_ctypes { char** arg1; int size1; @@ -442,6 +446,12 @@ struct GAAOPTION_ciphers int size1; }; +struct GAAOPTION_recordsize +{ + int arg1; + int size1; +}; + struct GAAOPTION_port { int arg1; @@ -484,12 +494,13 @@ int gaa_get_option_num(char *str, int status) switch(status) { case GAA_LETTER_OPTION: - GAA_CHECK1STR("", GAAOPTID_certtypes); + GAA_CHECK1STR("", GAAOPTID_ctypes); GAA_CHECK1STR("", GAAOPTID_kx); GAA_CHECK1STR("", GAAOPTID_macs); GAA_CHECK1STR("", GAAOPTID_comp); GAA_CHECK1STR("", GAAOPTID_protocols); GAA_CHECK1STR("", GAAOPTID_ciphers); + GAA_CHECK1STR("", GAAOPTID_recordsize); GAA_CHECK1STR("p", GAAOPTID_port); case GAA_MULTIPLE_OPTION: #line 375 "gaa.skel" @@ -502,12 +513,13 @@ int gaa_get_option_num(char *str, int status) case GAA_WORD_OPTION: GAA_CHECKSTR("help", GAAOPTID_help); GAA_CHECKSTR("list", GAAOPTID_list); - GAA_CHECKSTR("certtypes", GAAOPTID_certtypes); + GAA_CHECKSTR("ctypes", GAAOPTID_ctypes); GAA_CHECKSTR("kx", GAAOPTID_kx); GAA_CHECKSTR("macs", GAAOPTID_macs); GAA_CHECKSTR("comp", GAAOPTID_comp); GAA_CHECKSTR("protocols", GAAOPTID_protocols); GAA_CHECKSTR("ciphers", GAAOPTID_ciphers); + GAA_CHECKSTR("recordsize", GAAOPTID_recordsize); GAA_CHECKSTR("port", GAAOPTID_port); GAA_CHECKSTR("resume", GAAOPTID_resume); @@ -522,12 +534,13 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) { int OK = 0; int gaa_last_non_option; - struct GAAOPTION_certtypes GAATMP_certtypes; + struct GAAOPTION_ctypes GAATMP_ctypes; struct GAAOPTION_kx GAATMP_kx; struct GAAOPTION_macs GAATMP_macs; struct GAAOPTION_comp GAATMP_comp; struct GAAOPTION_protocols GAATMP_protocols; struct GAAOPTION_ciphers GAATMP_ciphers; + struct GAAOPTION_recordsize GAATMP_recordsize; struct GAAOPTION_port GAATMP_port; #line 393 "gaa.skel" @@ -551,30 +564,30 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) { case GAAOPTID_help: OK = 0; -#line 36 "cli.gaa" +#line 39 "cli.gaa" { gaa_help(); exit(0); ;}; return GAA_OK; break; case GAAOPTID_list: OK = 0; -#line 35 "cli.gaa" +#line 38 "cli.gaa" { print_list(); exit(0); ;}; return GAA_OK; break; - case GAAOPTID_certtypes: + case GAAOPTID_ctypes: OK = 0; - GAA_LIST_FILL(GAATMP_certtypes.arg1, gaa_getstr, char*, GAATMP_certtypes.size1); -#line 32 "cli.gaa" -{ gaaval->ctype = GAATMP_certtypes.arg1; gaaval->nctype = GAATMP_certtypes.size1 ;}; + GAA_LIST_FILL(GAATMP_ctypes.arg1, gaa_getstr, char*, GAATMP_ctypes.size1); +#line 35 "cli.gaa" +{ gaaval->ctype = GAATMP_ctypes.arg1; gaaval->nctype = GAATMP_ctypes.size1 ;}; return GAA_OK; break; case GAAOPTID_kx: OK = 0; GAA_LIST_FILL(GAATMP_kx.arg1, gaa_getstr, char*, GAATMP_kx.size1); -#line 28 "cli.gaa" +#line 31 "cli.gaa" { gaaval->kx = GAATMP_kx.arg1; gaaval->nkx = GAATMP_kx.size1 ;}; return GAA_OK; @@ -582,7 +595,7 @@ 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 24 "cli.gaa" +#line 27 "cli.gaa" { gaaval->macs = GAATMP_macs.arg1; gaaval->nmacs = GAATMP_macs.size1 ;}; return GAA_OK; @@ -590,7 +603,7 @@ 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 20 "cli.gaa" +#line 23 "cli.gaa" { gaaval->comp = GAATMP_comp.arg1; gaaval->ncomp = GAATMP_comp.size1 ;}; return GAA_OK; @@ -598,7 +611,7 @@ 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 16 "cli.gaa" +#line 19 "cli.gaa" { gaaval->proto = GAATMP_protocols.arg1; gaaval->nproto = GAATMP_protocols.size1 ;}; return GAA_OK; @@ -606,11 +619,21 @@ 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 12 "cli.gaa" +#line 15 "cli.gaa" { gaaval->ciphers = GAATMP_ciphers.arg1; gaaval->nciphers = GAATMP_ciphers.size1 ;}; return GAA_OK; break; + case GAAOPTID_recordsize: + OK = 0; + GAA_TESTMOREARGS; + GAA_FILL(GAATMP_recordsize.arg1, gaa_getint, GAATMP_recordsize.size1); + gaa_index++; +#line 10 "cli.gaa" +{ gaaval->record_size = GAATMP_recordsize.arg1 ;}; + + return GAA_OK; + break; case GAAOPTID_port: OK = 0; GAA_TESTMOREARGS; @@ -630,7 +653,7 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) break; case GAA_REST: GAA_OPTIONALLIST_FILL(GAAREST_tmp.arg1, gaa_getstr, char*, GAAREST_tmp.size1); -#line 40 "cli.gaa" +#line 43 "cli.gaa" { gaaval->rest_args = GAAREST_tmp.arg1; gaaval->nrest_args = GAAREST_tmp.size1 ;}; return GAA_OK; @@ -658,10 +681,10 @@ int gaa(int argc, char **argv, gaainfo *gaaval) if(inited == 0) { -#line 42 "cli.gaa" +#line 45 "cli.gaa" { gaaval->resume=0; gaaval->port=5556; gaaval->rest_args=NULL; gaaval->nrest_args=0; 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->nkx=0; gaaval->ncomp=0; gaaval->nmacs=0; gaaval->nctype = 0; gaaval->record_size=0; ;}; } inited = 1; diff --git a/src/cli-gaa.h b/src/cli-gaa.h index 8b2e858a77..16c73d2954 100644 --- a/src/cli-gaa.h +++ b/src/cli-gaa.h @@ -8,34 +8,36 @@ typedef struct _gaainfo gaainfo; struct _gaainfo { -#line 39 "cli.gaa" +#line 42 "cli.gaa" char **rest_args; -#line 38 "cli.gaa" +#line 41 "cli.gaa" int nrest_args; -#line 31 "cli.gaa" +#line 34 "cli.gaa" char **ctype; -#line 30 "cli.gaa" +#line 33 "cli.gaa" int nctype; -#line 27 "cli.gaa" +#line 30 "cli.gaa" char **kx; -#line 26 "cli.gaa" +#line 29 "cli.gaa" int nkx; -#line 23 "cli.gaa" +#line 26 "cli.gaa" char **macs; -#line 22 "cli.gaa" +#line 25 "cli.gaa" int nmacs; -#line 19 "cli.gaa" +#line 22 "cli.gaa" char **comp; -#line 18 "cli.gaa" +#line 21 "cli.gaa" int ncomp; -#line 15 "cli.gaa" +#line 18 "cli.gaa" char **proto; -#line 14 "cli.gaa" +#line 17 "cli.gaa" int nproto; -#line 11 "cli.gaa" +#line 14 "cli.gaa" char **ciphers; -#line 10 "cli.gaa" +#line 13 "cli.gaa" int nciphers; +#line 9 "cli.gaa" + int record_size; #line 6 "cli.gaa" int port; #line 3 "cli.gaa" @@ -50,6 +50,7 @@ int resume; char *hostname=NULL; int port; +int record_max_size; int protocol_priority[16] = { GNUTLS_TLS1, GNUTLS_SSL3, 0 }; int kx_priority[16] = @@ -113,7 +114,7 @@ static void gaa_parser(int argc, char **argv); int main(int argc, char **argv) { int err, ret; - int sd, ii; + int sd, ii, i; struct sockaddr_in sa; GNUTLS_STATE state; char buffer[MAX_BUF + 1]; @@ -223,9 +224,14 @@ int main(int argc, char **argv) err = connect(sd, (SA *) & sa, sizeof(sa)); ERR(err, "connect"); - if (resume != 0) { + for (i=0;i<2;i++) { gnutls_init(&state, GNUTLS_CLIENT); + if (i == 1) { + gnutls_session_set_data(state, session, session_size); + free(session); + } + gnutls_cipher_set_priority(state, cipher_priority); gnutls_compression_set_priority(state, comp_priority); gnutls_kx_set_priority(state, kx_priority); @@ -241,7 +247,12 @@ int main(int argc, char **argv) /* use the max record size extension */ - gnutls_record_set_max_size(state, 2048); + if (record_max_size > 0) { + if (gnutls_record_set_max_size(state, record_max_size) < 0) { + fprintf(stderr, "Cannot set the maximum record size to %d.\n", record_max_size); + exit(1); + } + } /* This TLS extension may break old implementations. */ @@ -265,94 +276,63 @@ int main(int argc, char **argv) printf("- Handshake was completed\n"); } - gnutls_session_get_data(state, NULL, &session_size); - session = malloc(session_size); - gnutls_session_get_data(state, session, &session_size); - - gnutls_session_get_id(state, NULL, &session_id_size); - session_id = malloc(session_id_size); - gnutls_session_get_id(state, session_id, &session_id_size); - -/* print some information */ - print_info(state); - - printf("- Disconnecting\n"); - do { - ret = gnutls_bye(state, GNUTLS_SHUT_RDWR); - } while (ret == GNUTLS_E_INTERRUPTED - || ret == GNUTLS_E_AGAIN); - - shutdown(sd, SHUT_WR); - close(sd); - - gnutls_deinit(state); + if (i == 1) { /* resume */ + /* check if we actually resumed the previous session */ - printf - ("\n\n- Connecting again- trying to resume previous session\n"); - sd = socket(AF_INET, SOCK_STREAM, 0); - ERR(sd, "socket"); + gnutls_session_get_id(state, NULL, &tmp_session_id_size); + tmp_session_id = malloc(tmp_session_id_size); + gnutls_session_get_id(state, tmp_session_id, &tmp_session_id_size); - err = connect(sd, (SA *) & sa, sizeof(sa)); - ERR(err, "connect"); - - } + if (memcmp(tmp_session_id, session_id, session_id_size) == + 0) { + printf("- Previous session was resumed\n"); + } else { + fprintf(stderr, + "*** Previous session was NOT resumed\n"); + } + free(tmp_session_id); + free(session_id); + } - /* resume */ - /* Begin handshake again */ - gnutls_init(&state, GNUTLS_CLIENT); - gnutls_cipher_set_priority(state, cipher_priority); - gnutls_compression_set_priority(state, comp_priority); - gnutls_kx_set_priority(state, kx_priority); - gnutls_protocol_set_priority(state, protocol_priority); - gnutls_mac_set_priority(state, mac_priority); - gnutls_cert_type_set_priority(state, cert_type_priority); - gnutls_dh_set_prime_bits(state, 1024); + if (resume!=0 && i==0) { - gnutls_cred_set(state, GNUTLS_CRD_ANON, anon_cred); - gnutls_cred_set(state, GNUTLS_CRD_SRP, cred); - gnutls_cred_set(state, GNUTLS_CRD_CERTIFICATE, xcred); + gnutls_session_get_data(state, NULL, &session_size); + session = malloc(session_size); + gnutls_session_get_data(state, session, &session_size); - if (resume != 0) { - gnutls_session_set_data(state, session, session_size); - free(session); - } + gnutls_session_get_id(state, NULL, &session_id_size); + session_id = malloc(session_id_size); + gnutls_session_get_id(state, session_id, &session_id_size); - gnutls_transport_set_ptr(state, sd); - do { - ret = gnutls_handshake(state); - } while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN); + /* print some information */ + print_info(state); - if (ret < 0) { - if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED - || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) - printf("*** Received alert [%d]\n", - gnutls_alert_get_last(state)); - fprintf(stderr, "*** Handshake failed\n"); - gnutls_perror(ret); - gnutls_deinit(state); - return 1; - } else { - printf("- Handshake was completed\n"); - } + printf("- Disconnecting\n"); + do { + ret = gnutls_bye(state, GNUTLS_SHUT_RDWR); + } while (ret == GNUTLS_E_INTERRUPTED + || ret == GNUTLS_E_AGAIN); + + shutdown(sd, SHUT_WR); + close(sd); - if (resume != 0) { - /* check if we actually resumed the previous session */ - gnutls_session_get_id(state, NULL, &tmp_session_id_size); - tmp_session_id = malloc(tmp_session_id_size); - gnutls_session_get_id(state, tmp_session_id, &tmp_session_id_size); + gnutls_deinit(state); - if (memcmp(tmp_session_id, session_id, session_id_size) == - 0) { - printf("- Previous session was resumed\n"); + printf + ("\n\n- Connecting again- trying to resume previous session\n"); + sd = socket(AF_INET, SOCK_STREAM, 0); + ERR(sd, "socket"); + + err = connect(sd, (SA *) & sa, sizeof(sa)); + ERR(err, "connect"); } else { - fprintf(stderr, - "*** Previous session was NOT resumed\n"); + break; } - free(tmp_session_id); - free(session_id); + } + /* print some information */ print_info(state); @@ -486,6 +466,7 @@ void gaa_parser(int argc, char **argv) resume = info.resume; port = info.port; + record_max_size = info.record_size; if (info.nrest_args==0) hostname="localhost"; else hostname = info.rest_args[0]; diff --git a/src/cli.gaa b/src/cli.gaa index 5d4bbc9c7f..a9d85893cb 100644 --- a/src/cli.gaa +++ b/src/cli.gaa @@ -6,6 +6,9 @@ option (r, resume) { $resume = 1 } "Connect, establish a session. Connect again #int port; option (p, port) INT "integer" { $port = $1 } "The port to connect to." +#int record_size; +option (recordsize) INT "integer" { $record_size = $1 } "The maximum record size to advertize." + #int nciphers; #char **ciphers; @@ -29,7 +32,7 @@ option (kx) *STR "kx1 kx2..." { $kx = $1; $nkx = @1 } "Key exchange methods to e #int nctype; #char **ctype; -option (certtypes) *STR "certtype1 certtype2..." { $ctype = $1; $nctype = @1 } "Certificate types to enable." +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." @@ -41,5 +44,5 @@ rest optional *STR "hostname" { $rest_args = $1; $nrest_args = @1 } init { $resume=0; $port=5556; $rest_args=NULL; $nrest_args=0; $ciphers=NULL; $kx=NULL; $comp=NULL; $macs=NULL; $ctype=NULL; $nciphers=0; - $nkx=0; $ncomp=0; $nmacs=0; $nctype = 0; } + $nkx=0; $ncomp=0; $nmacs=0; $nctype = 0; $record_size=0; } diff --git a/src/serv-gaa.c b/src/serv-gaa.c index f35e12cc4a..2eb4b649b1 100644 --- a/src/serv-gaa.c +++ b/src/serv-gaa.c @@ -105,13 +105,13 @@ void gaa_help() printf("serv help\nUsage: serv [options]""\n"); __gaa_helpsingle('g', "generate", "", "Generate Diffie Hellman Parameters."); __gaa_helpsingle('p', "port", """integer"" ", "The port to connect to."); - __gaa_helpsingle('h', "http", "", "Act as an HTTP Server."); + __gaa_helpsingle(0, "http", "", "Act as an HTTP Server."); __gaa_helpsingle(0, "ciphers", """cipher1 cipher2..."" ", "Ciphers to enable."); __gaa_helpsingle(0, "protocols", """protocol1 protocol2..."" ", "Protocols to enable."); __gaa_helpsingle(0, "comp", """comp1 comp2..."" ", "Compression methods to enable."); __gaa_helpsingle(0, "macs", """mac1 mac2..."" ", "MACs to enable."); __gaa_helpsingle(0, "kx", """kx1 kx2..."" ", "Key exchange methods to enable."); - __gaa_helpsingle(0, "certtypes", """certtype1 certtype2..."" ", "Certificate types to enable."); + __gaa_helpsingle(0, "ctypes", """certType1 certType2..."" ", "Certificate types to enable."); __gaa_helpsingle('l', "list", "", "Print a list of the supported algorithms and modes."); __gaa_helpsingle('h', "help", "", "prints this help"); @@ -215,7 +215,7 @@ int gaa_error = 0; #define GAA_NB_OPTION 11 #define GAAOPTID_help 1 #define GAAOPTID_list 2 -#define GAAOPTID_certtypes 3 +#define GAAOPTID_ctypes 3 #define GAAOPTID_kx 4 #define GAAOPTID_macs 5 #define GAAOPTID_comp 6 @@ -406,7 +406,7 @@ float gaa_getfloat(char *arg) } /* option structures */ -struct GAAOPTION_certtypes +struct GAAOPTION_ctypes { char** arg1; int size1; @@ -477,7 +477,7 @@ int gaa_get_option_num(char *str, int status) switch(status) { case GAA_LETTER_OPTION: - GAA_CHECK1STR("", GAAOPTID_certtypes); + GAA_CHECK1STR("", GAAOPTID_ctypes); GAA_CHECK1STR("", GAAOPTID_kx); GAA_CHECK1STR("", GAAOPTID_macs); GAA_CHECK1STR("", GAAOPTID_comp); @@ -488,7 +488,7 @@ int gaa_get_option_num(char *str, int status) #line 375 "gaa.skel" GAA_CHECK1STR("h", GAAOPTID_help); GAA_CHECK1STR("l", GAAOPTID_list); - GAA_CHECK1STR("h", GAAOPTID_http); + GAA_CHECK1STR("", GAAOPTID_http); GAA_CHECK1STR("g", GAAOPTID_generate); #line 277 "gaa.skel" @@ -496,7 +496,7 @@ int gaa_get_option_num(char *str, int status) case GAA_WORD_OPTION: GAA_CHECKSTR("help", GAAOPTID_help); GAA_CHECKSTR("list", GAAOPTID_list); - GAA_CHECKSTR("certtypes", GAAOPTID_certtypes); + GAA_CHECKSTR("ctypes", GAAOPTID_ctypes); GAA_CHECKSTR("kx", GAAOPTID_kx); GAA_CHECKSTR("macs", GAAOPTID_macs); GAA_CHECKSTR("comp", GAAOPTID_comp); @@ -517,7 +517,7 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) { int OK = 0; int gaa_last_non_option; - struct GAAOPTION_certtypes GAATMP_certtypes; + struct GAAOPTION_ctypes GAATMP_ctypes; struct GAAOPTION_kx GAATMP_kx; struct GAAOPTION_macs GAATMP_macs; struct GAAOPTION_comp GAATMP_comp; @@ -558,11 +558,11 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) return GAA_OK; break; - case GAAOPTID_certtypes: + case GAAOPTID_ctypes: OK = 0; - GAA_LIST_FILL(GAATMP_certtypes.arg1, gaa_getstr, char*, GAATMP_certtypes.size1); + GAA_LIST_FILL(GAATMP_ctypes.arg1, gaa_getstr, char*, GAATMP_ctypes.size1); #line 34 "serv.gaa" -{ gaaval->ctype = GAATMP_certtypes.arg1; gaaval->nctype = GAATMP_certtypes.size1 ;}; +{ gaaval->ctype = GAATMP_ctypes.arg1; gaaval->nctype = GAATMP_ctypes.size1 ;}; return GAA_OK; break; diff --git a/src/serv.gaa b/src/serv.gaa index c7a789541c..34abc848cf 100644 --- a/src/serv.gaa +++ b/src/serv.gaa @@ -7,7 +7,7 @@ option (g, generate) { $generate = 1 } "Generate Diffie Hellman Parameters." option (p, port) INT "integer" { $port = $1 } "The port to connect to." #int http; -option (h, http) { $http = 1 } "Act as an HTTP Server." +option (http) { $http = 1 } "Act as an HTTP Server." #int nciphers; #char **ciphers; @@ -31,7 +31,7 @@ option (kx) *STR "kx1 kx2..." { $kx = $1; $nkx = @1 } "Key exchange methods to e #int nctype; #char **ctype; -option (certtypes) *STR "certtype1 certtype2..." { $ctype = $1; $nctype = @1 } "Certificate types to enable." +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." |