diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-10-30 18:54:53 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-10-30 18:54:53 +0000 |
commit | ffca7d762e28cd66427809fb3fbc23aec9d6e376 (patch) | |
tree | 28a51865eca392c4da2438edc93c5efdf506fb24 | |
parent | c7d75e3bd88ae9702ee538fc073d4116edc79f31 (diff) | |
download | gnutls-ffca7d762e28cd66427809fb3fbc23aec9d6e376.tar.gz |
*** empty log message ***
-rw-r--r-- | src/certtool-gaa.c | 67 | ||||
-rw-r--r-- | src/certtool.c | 21 | ||||
-rw-r--r-- | src/certtool.gaa | 5 | ||||
-rw-r--r-- | src/common.c | 2 |
4 files changed, 64 insertions, 31 deletions
diff --git a/src/certtool-gaa.c b/src/certtool-gaa.c index 73e21d8882..c0ee7a867a 100644 --- a/src/certtool-gaa.c +++ b/src/certtool-gaa.c @@ -140,7 +140,8 @@ void gaa_help(void) __gaa_helpsingle(0, "infile", "FILE ", "Output file."); __gaa_helpsingle('d', "debug", "LEVEL ", "specify the debug level. Default is 1."); __gaa_helpsingle('h', "help", "", "shows this help text"); - __gaa_helpsingle('v', "version", "", "shows the program version"); + __gaa_helpsingle('v', "version", "", "shows the program's version"); + __gaa_helpsingle(0, "copyright", "", "shows the program's license"); #line 100 "gaa.skel" } @@ -235,31 +236,32 @@ int gaa_error = 0; #define GAA_MULTIPLE_OPTION 3 #define GAA_REST 0 -#define GAA_NB_OPTION 24 -#define GAAOPTID_version 1 -#define GAAOPTID_help 2 -#define GAAOPTID_debug 3 -#define GAAOPTID_infile 4 -#define GAAOPTID_outfile 5 -#define GAAOPTID_bits 6 -#define GAAOPTID_outder 7 -#define GAAOPTID_inder 8 -#define GAAOPTID_pkcs8 9 -#define GAAOPTID_to_p12 10 -#define GAAOPTID_key_info 11 -#define GAAOPTID_p12_info 12 -#define GAAOPTID_certificate_info 13 -#define GAAOPTID_load_ca_certificate 14 -#define GAAOPTID_load_ca_privkey 15 -#define GAAOPTID_load_certificate 16 -#define GAAOPTID_load_request 17 -#define GAAOPTID_load_privkey 18 -#define GAAOPTID_verify_chain 19 -#define GAAOPTID_generate_request 20 -#define GAAOPTID_generate_privkey 21 -#define GAAOPTID_update_certificate 22 -#define GAAOPTID_generate_certificate 23 -#define GAAOPTID_generate_self_signed 24 +#define GAA_NB_OPTION 25 +#define GAAOPTID_copyright 1 +#define GAAOPTID_version 2 +#define GAAOPTID_help 3 +#define GAAOPTID_debug 4 +#define GAAOPTID_infile 5 +#define GAAOPTID_outfile 6 +#define GAAOPTID_bits 7 +#define GAAOPTID_outder 8 +#define GAAOPTID_inder 9 +#define GAAOPTID_pkcs8 10 +#define GAAOPTID_to_p12 11 +#define GAAOPTID_key_info 12 +#define GAAOPTID_p12_info 13 +#define GAAOPTID_certificate_info 14 +#define GAAOPTID_load_ca_certificate 15 +#define GAAOPTID_load_ca_privkey 16 +#define GAAOPTID_load_certificate 17 +#define GAAOPTID_load_request 18 +#define GAAOPTID_load_privkey 19 +#define GAAOPTID_verify_chain 20 +#define GAAOPTID_generate_request 21 +#define GAAOPTID_generate_privkey 22 +#define GAAOPTID_update_certificate 23 +#define GAAOPTID_generate_certificate 24 +#define GAAOPTID_generate_self_signed 25 #line 168 "gaa.skel" @@ -540,6 +542,7 @@ int gaa_get_option_num(char *str, int status) GAA_CHECK1STR("", GAAOPTID_load_privkey); case GAA_MULTIPLE_OPTION: #line 375 "gaa.skel" + GAA_CHECK1STR("", GAAOPTID_copyright); GAA_CHECK1STR("v", GAAOPTID_version); GAA_CHECK1STR("h", GAAOPTID_help); GAA_CHECK1STR("", GAAOPTID_outder); @@ -559,6 +562,7 @@ int gaa_get_option_num(char *str, int status) #line 277 "gaa.skel" break; case GAA_WORD_OPTION: + GAA_CHECKSTR("copyright", GAAOPTID_copyright); GAA_CHECKSTR("version", GAAOPTID_version); GAA_CHECKSTR("help", GAAOPTID_help); GAA_CHECKSTR("debug", GAAOPTID_debug); @@ -624,6 +628,13 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) switch(gaa_num) { + case GAAOPTID_copyright: + OK = 0; +#line 63 "certtool.gaa" +{ print_license(); exit(0); ;}; + + return GAA_OK; + break; case GAAOPTID_version: OK = 0; #line 62 "certtool.gaa" @@ -843,10 +854,10 @@ int gaa(int argc, char **argv, gaainfo *gaaval) if(inited == 0) { -#line 64 "certtool.gaa" +#line 65 "certtool.gaa" { gaaval->bits = 1024; gaaval->pkcs8 = 0; gaaval->privkey = NULL; gaaval->ca=NULL; gaaval->ca_privkey = NULL; gaaval->debug=1; gaaval->request = NULL; gaaval->infile = NULL; gaaval->outfile = NULL; gaaval->cert = NULL; - gaaval->incert_format = 0; gaaval->outcert_format = 0; ;}; + gaaval->incert_format = 0; gaaval->outcert_format = 0; gaaval->action=-1; ;}; } inited = 1; diff --git a/src/certtool.c b/src/certtool.c index dcf85837b1..68ccaba557 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -556,6 +556,10 @@ int ret; case 9: pkcs12_info(); break; + default: + fprintf(stderr, "GnuTLS' certtool utility.\n"); + fprintf(stderr, "Please use the --help to get help on this program.\n"); + exit(0); } fclose(outfile); } @@ -1744,3 +1748,20 @@ void certtool_version(void) fprintf(stderr, "version %s. Libgnutls %s.\n", LIBGNUTLS_VERSION, gnutls_check_version(NULL)); } + +void print_license(void) +{ + fprintf(stdout, + "\nCopyright (C) 2001-2003 Nikos Mavroyanopoulos\n" + "This program is free software; you can redistribute it and/or modify \n" + "it under the terms of the GNU General Public License as published by \n" + "the Free Software Foundation; either version 2 of the License, or \n" + "(at your option) any later version. \n" "\n" + "This program is distributed in the hope that it will be useful, \n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of \n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n" + "GNU General Public License for more details. \n" "\n" + "You should have received a copy of the GNU General Public License \n" + "along with this program; if not, write to the Free Software \n" + "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"); +} diff --git a/src/certtool.gaa b/src/certtool.gaa index 99952e5a4e..d37eb779f5 100644 --- a/src/certtool.gaa +++ b/src/certtool.gaa @@ -59,9 +59,10 @@ option (d, debug) INT "LEVEL" { $debug = $1 } "specify the debug level. Default option (h, help) { gaa_help(); exit(0); } "shows this help text" -option (v, version) { certtool_version(); exit(0); } "shows the program version" +option (v, version) { certtool_version(); exit(0); } "shows the program's version" +option ( copyright) { print_license(); exit(0); } "shows the program's license" init { $bits = 1024; $pkcs8 = 0; $privkey = NULL; $ca=NULL; $ca_privkey = NULL; $debug=1; $request = NULL; $infile = NULL; $outfile = NULL; $cert = NULL; - $incert_format = 0; $outcert_format = 0; } + $incert_format = 0; $outcert_format = 0; $action=-1; } diff --git a/src/common.c b/src/common.c index 103f869f10..5ef9832169 100644 --- a/src/common.c +++ b/src/common.c @@ -497,7 +497,7 @@ void print_list(void) void print_license(void) { fprintf(stdout, - "\nCopyright (C) 2001-2002 Nikos Mavroyanopoulos\n" + "\nCopyright (C) 2001-2003 Nikos Mavroyanopoulos\n" "This program is free software; you can redistribute it and/or modify \n" "it under the terms of the GNU General Public License as published by \n" "the Free Software Foundation; either version 2 of the License, or \n" |