]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
*** empty log message ***
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 30 Oct 2003 18:54:53 +0000 (18:54 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 30 Oct 2003 18:54:53 +0000 (18:54 +0000)
src/certtool-gaa.c
src/certtool.c
src/certtool.gaa
src/common.c

index 73e21d8882b611fef006e7872a3eac370fe985d0..c0ee7a867a6b7b13eefc27712ed1d5d7e9d6d83c 100644 (file)
@@ -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;
index dcf85837b1caf1a0cc3d02c413a5f5d8fa6ab107..68ccaba5571dd0492f342ce408fd1d855e002a6f 100644 (file)
@@ -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");
+}
index 99952e5a4e78774682f24c0d065e07b78832f8d5..d37eb779f5872885450ec2aa8c2e33f688104f80 100644 (file)
@@ -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; }
 
index 103f869f104c78d5e8912bbebd5b90a89528b759..5ef9832169a51ffd49f771ab035dc3a21603ecb0 100644 (file)
@@ -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"