summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/certtool-gaa.c212
-rw-r--r--src/certtool-gaa.h40
2 files changed, 120 insertions, 132 deletions
diff --git a/src/certtool-gaa.c b/src/certtool-gaa.c
index ca872a19d8..2b154a61a4 100644
--- a/src/certtool-gaa.c
+++ b/src/certtool-gaa.c
@@ -11,7 +11,6 @@
# include <io.h>
#endif
-void print_license(void);
void certtool_version(void);
#include <stdio.h>
@@ -169,7 +168,6 @@ void gaa_help(void)
__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's version");
- __gaa_helpsingle(0, "copyright", "", "shows the program's license");
#line 100 "gaa.skel"
}
@@ -184,45 +182,45 @@ typedef struct _gaainfo gaainfo;
struct _gaainfo
{
-#line 108 "certtool.gaa"
+#line 107 "certtool.gaa"
int debug;
-#line 104 "certtool.gaa"
+#line 103 "certtool.gaa"
char *template;
-#line 101 "certtool.gaa"
+#line 100 "certtool.gaa"
char *infile;
-#line 98 "certtool.gaa"
+#line 97 "certtool.gaa"
char *outfile;
-#line 95 "certtool.gaa"
+#line 94 "certtool.gaa"
int bits;
-#line 92 "certtool.gaa"
+#line 91 "certtool.gaa"
int outcert_format;
-#line 89 "certtool.gaa"
+#line 88 "certtool.gaa"
int xml;
-#line 86 "certtool.gaa"
+#line 85 "certtool.gaa"
int incert_format;
-#line 83 "certtool.gaa"
+#line 82 "certtool.gaa"
int export;
-#line 80 "certtool.gaa"
+#line 79 "certtool.gaa"
char *hash;
-#line 77 "certtool.gaa"
+#line 76 "certtool.gaa"
int dsa;
-#line 74 "certtool.gaa"
+#line 73 "certtool.gaa"
int pkcs8;
-#line 69 "certtool.gaa"
+#line 68 "certtool.gaa"
int fix_key;
-#line 54 "certtool.gaa"
+#line 53 "certtool.gaa"
char *pass;
-#line 51 "certtool.gaa"
+#line 50 "certtool.gaa"
char *ca;
-#line 48 "certtool.gaa"
+#line 47 "certtool.gaa"
char *ca_privkey;
-#line 45 "certtool.gaa"
+#line 44 "certtool.gaa"
char *cert;
-#line 42 "certtool.gaa"
+#line 41 "certtool.gaa"
char *request;
-#line 39 "certtool.gaa"
+#line 38 "certtool.gaa"
char *privkey;
-#line 17 "certtool.gaa"
+#line 16 "certtool.gaa"
int action;
#line 114 "gaa.skel"
@@ -278,47 +276,46 @@ static int gaa_error = 0;
#define GAA_MULTIPLE_OPTION 3
#define GAA_REST 0
-#define GAA_NB_OPTION 40
-#define GAAOPTID_copyright 1
-#define GAAOPTID_version 2
-#define GAAOPTID_help 3
-#define GAAOPTID_debug 4
-#define GAAOPTID_template 5
-#define GAAOPTID_infile 6
-#define GAAOPTID_outfile 7
-#define GAAOPTID_bits 8
-#define GAAOPTID_outder 9
-#define GAAOPTID_xml 10
-#define GAAOPTID_inder 11
-#define GAAOPTID_export_ciphers 12
-#define GAAOPTID_hash 13
-#define GAAOPTID_dsa 14
-#define GAAOPTID_pkcs8 15
-#define GAAOPTID_to_p12 16
-#define GAAOPTID_fix_key 17
-#define GAAOPTID_key_info 18
-#define GAAOPTID_smime_to_p7 19
-#define GAAOPTID_p7_info 20
-#define GAAOPTID_p12_info 21
-#define GAAOPTID_crl_info 22
-#define GAAOPTID_certificate_info 23
-#define GAAOPTID_password 24
-#define GAAOPTID_load_ca_certificate 25
-#define GAAOPTID_load_ca_privkey 26
-#define GAAOPTID_load_certificate 27
-#define GAAOPTID_load_request 28
-#define GAAOPTID_load_privkey 29
-#define GAAOPTID_get_dh_params 30
-#define GAAOPTID_generate_dh_params 31
-#define GAAOPTID_verify_crl 32
-#define GAAOPTID_verify_chain 33
-#define GAAOPTID_generate_request 34
-#define GAAOPTID_generate_privkey 35
-#define GAAOPTID_update_certificate 36
-#define GAAOPTID_generate_crl 37
-#define GAAOPTID_generate_proxy 38
-#define GAAOPTID_generate_certificate 39
-#define GAAOPTID_generate_self_signed 40
+#define GAA_NB_OPTION 39
+#define GAAOPTID_version 1
+#define GAAOPTID_help 2
+#define GAAOPTID_debug 3
+#define GAAOPTID_template 4
+#define GAAOPTID_infile 5
+#define GAAOPTID_outfile 6
+#define GAAOPTID_bits 7
+#define GAAOPTID_outder 8
+#define GAAOPTID_xml 9
+#define GAAOPTID_inder 10
+#define GAAOPTID_export_ciphers 11
+#define GAAOPTID_hash 12
+#define GAAOPTID_dsa 13
+#define GAAOPTID_pkcs8 14
+#define GAAOPTID_to_p12 15
+#define GAAOPTID_fix_key 16
+#define GAAOPTID_key_info 17
+#define GAAOPTID_smime_to_p7 18
+#define GAAOPTID_p7_info 19
+#define GAAOPTID_p12_info 20
+#define GAAOPTID_crl_info 21
+#define GAAOPTID_certificate_info 22
+#define GAAOPTID_password 23
+#define GAAOPTID_load_ca_certificate 24
+#define GAAOPTID_load_ca_privkey 25
+#define GAAOPTID_load_certificate 26
+#define GAAOPTID_load_request 27
+#define GAAOPTID_load_privkey 28
+#define GAAOPTID_get_dh_params 29
+#define GAAOPTID_generate_dh_params 30
+#define GAAOPTID_verify_crl 31
+#define GAAOPTID_verify_chain 32
+#define GAAOPTID_generate_request 33
+#define GAAOPTID_generate_privkey 34
+#define GAAOPTID_update_certificate 35
+#define GAAOPTID_generate_crl 36
+#define GAAOPTID_generate_proxy 37
+#define GAAOPTID_generate_certificate 38
+#define GAAOPTID_generate_self_signed 39
#line 168 "gaa.skel"
@@ -620,7 +617,6 @@ static 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);
@@ -652,7 +648,6 @@ static 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);
@@ -736,23 +731,16 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
switch(gaa_num)
{
- case GAAOPTID_copyright:
- OK = 0;
-#line 114 "certtool.gaa"
-{ print_license(); exit(0); ;};
-
- return GAA_OK;
- break;
case GAAOPTID_version:
OK = 0;
-#line 113 "certtool.gaa"
+#line 112 "certtool.gaa"
{ certtool_version(); exit(0); ;};
return GAA_OK;
break;
case GAAOPTID_help:
OK = 0;
-#line 111 "certtool.gaa"
+#line 110 "certtool.gaa"
{ gaa_help(); exit(0); ;};
return GAA_OK;
@@ -762,7 +750,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_debug.arg1, gaa_getint, GAATMP_debug.size1);
gaa_index++;
-#line 109 "certtool.gaa"
+#line 108 "certtool.gaa"
{ gaaval->debug = GAATMP_debug.arg1 ;};
return GAA_OK;
@@ -772,7 +760,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_template.arg1, gaa_getstr, GAATMP_template.size1);
gaa_index++;
-#line 105 "certtool.gaa"
+#line 104 "certtool.gaa"
{ gaaval->template = GAATMP_template.arg1 ;};
return GAA_OK;
@@ -782,7 +770,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_infile.arg1, gaa_getstr, GAATMP_infile.size1);
gaa_index++;
-#line 102 "certtool.gaa"
+#line 101 "certtool.gaa"
{ gaaval->infile = GAATMP_infile.arg1 ;};
return GAA_OK;
@@ -792,7 +780,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_outfile.arg1, gaa_getstr, GAATMP_outfile.size1);
gaa_index++;
-#line 99 "certtool.gaa"
+#line 98 "certtool.gaa"
{ gaaval->outfile = GAATMP_outfile.arg1 ;};
return GAA_OK;
@@ -802,35 +790,35 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_bits.arg1, gaa_getint, GAATMP_bits.size1);
gaa_index++;
-#line 96 "certtool.gaa"
+#line 95 "certtool.gaa"
{ gaaval->bits = GAATMP_bits.arg1 ;};
return GAA_OK;
break;
case GAAOPTID_outder:
OK = 0;
-#line 93 "certtool.gaa"
+#line 92 "certtool.gaa"
{ gaaval->outcert_format=1 ;};
return GAA_OK;
break;
case GAAOPTID_xml:
OK = 0;
-#line 90 "certtool.gaa"
+#line 89 "certtool.gaa"
{ gaaval->xml=1 ;};
return GAA_OK;
break;
case GAAOPTID_inder:
OK = 0;
-#line 87 "certtool.gaa"
+#line 86 "certtool.gaa"
{ gaaval->incert_format=1 ;};
return GAA_OK;
break;
case GAAOPTID_export_ciphers:
OK = 0;
-#line 84 "certtool.gaa"
+#line 83 "certtool.gaa"
{ gaaval->export=1 ;};
return GAA_OK;
@@ -840,77 +828,77 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_hash.arg1, gaa_getstr, GAATMP_hash.size1);
gaa_index++;
-#line 81 "certtool.gaa"
+#line 80 "certtool.gaa"
{ gaaval->hash = GAATMP_hash.arg1 ;};
return GAA_OK;
break;
case GAAOPTID_dsa:
OK = 0;
-#line 78 "certtool.gaa"
+#line 77 "certtool.gaa"
{ gaaval->dsa=1 ;};
return GAA_OK;
break;
case GAAOPTID_pkcs8:
OK = 0;
-#line 75 "certtool.gaa"
+#line 74 "certtool.gaa"
{ gaaval->pkcs8=1 ;};
return GAA_OK;
break;
case GAAOPTID_to_p12:
OK = 0;
-#line 72 "certtool.gaa"
+#line 71 "certtool.gaa"
{ gaaval->action = 8; ;};
return GAA_OK;
break;
case GAAOPTID_fix_key:
OK = 0;
-#line 70 "certtool.gaa"
+#line 69 "certtool.gaa"
{ gaaval->fix_key = 1; ;};
return GAA_OK;
break;
case GAAOPTID_key_info:
OK = 0;
-#line 67 "certtool.gaa"
+#line 66 "certtool.gaa"
{ gaaval->action = 6; ;};
return GAA_OK;
break;
case GAAOPTID_smime_to_p7:
OK = 0;
-#line 65 "certtool.gaa"
+#line 64 "certtool.gaa"
{ gaaval->action = 15; ;};
return GAA_OK;
break;
case GAAOPTID_p7_info:
OK = 0;
-#line 63 "certtool.gaa"
+#line 62 "certtool.gaa"
{ gaaval->action = 12; ;};
return GAA_OK;
break;
case GAAOPTID_p12_info:
OK = 0;
-#line 61 "certtool.gaa"
+#line 60 "certtool.gaa"
{ gaaval->action = 9; ;};
return GAA_OK;
break;
case GAAOPTID_crl_info:
OK = 0;
-#line 59 "certtool.gaa"
+#line 58 "certtool.gaa"
{ gaaval->action = 11; ;};
return GAA_OK;
break;
case GAAOPTID_certificate_info:
OK = 0;
-#line 57 "certtool.gaa"
+#line 56 "certtool.gaa"
{ gaaval->action = 2; ;};
return GAA_OK;
@@ -920,7 +908,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_password.arg1, gaa_getstr, GAATMP_password.size1);
gaa_index++;
-#line 55 "certtool.gaa"
+#line 54 "certtool.gaa"
{ gaaval->pass = GAATMP_password.arg1 ;};
return GAA_OK;
@@ -930,7 +918,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_load_ca_certificate.arg1, gaa_getstr, GAATMP_load_ca_certificate.size1);
gaa_index++;
-#line 52 "certtool.gaa"
+#line 51 "certtool.gaa"
{ gaaval->ca = GAATMP_load_ca_certificate.arg1 ;};
return GAA_OK;
@@ -940,7 +928,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_load_ca_privkey.arg1, gaa_getstr, GAATMP_load_ca_privkey.size1);
gaa_index++;
-#line 49 "certtool.gaa"
+#line 48 "certtool.gaa"
{ gaaval->ca_privkey = GAATMP_load_ca_privkey.arg1 ;};
return GAA_OK;
@@ -950,7 +938,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_load_certificate.arg1, gaa_getstr, GAATMP_load_certificate.size1);
gaa_index++;
-#line 46 "certtool.gaa"
+#line 45 "certtool.gaa"
{ gaaval->cert = GAATMP_load_certificate.arg1 ;};
return GAA_OK;
@@ -960,7 +948,7 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_load_request.arg1, gaa_getstr, GAATMP_load_request.size1);
gaa_index++;
-#line 43 "certtool.gaa"
+#line 42 "certtool.gaa"
{ gaaval->request = GAATMP_load_request.arg1 ;};
return GAA_OK;
@@ -970,84 +958,84 @@ static int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
GAA_TESTMOREARGS;
GAA_FILL(GAATMP_load_privkey.arg1, gaa_getstr, GAATMP_load_privkey.size1);
gaa_index++;
-#line 40 "certtool.gaa"
+#line 39 "certtool.gaa"
{ gaaval->privkey = GAATMP_load_privkey.arg1 ;};
return GAA_OK;
break;
case GAAOPTID_get_dh_params:
OK = 0;
-#line 37 "certtool.gaa"
+#line 36 "certtool.gaa"
{ gaaval->action=16; ;};
return GAA_OK;
break;
case GAAOPTID_generate_dh_params:
OK = 0;
-#line 36 "certtool.gaa"
+#line 35 "certtool.gaa"
{ gaaval->action=10; ;};
return GAA_OK;
break;
case GAAOPTID_verify_crl:
OK = 0;
-#line 34 "certtool.gaa"
+#line 33 "certtool.gaa"
{ gaaval->action=14; ;};
return GAA_OK;
break;
case GAAOPTID_verify_chain:
OK = 0;
-#line 32 "certtool.gaa"
+#line 31 "certtool.gaa"
{ gaaval->action=5; ;};
return GAA_OK;
break;
case GAAOPTID_generate_request:
OK = 0;
-#line 30 "certtool.gaa"
+#line 29 "certtool.gaa"
{ gaaval->action=3; ;};
return GAA_OK;
break;
case GAAOPTID_generate_privkey:
OK = 0;
-#line 28 "certtool.gaa"
+#line 27 "certtool.gaa"
{ gaaval->action=1; ;};
return GAA_OK;
break;
case GAAOPTID_update_certificate:
OK = 0;
-#line 26 "certtool.gaa"
+#line 25 "certtool.gaa"
{ gaaval->action=7; ;};
return GAA_OK;
break;
case GAAOPTID_generate_crl:
OK = 0;
-#line 24 "certtool.gaa"
+#line 23 "certtool.gaa"
{ gaaval->action=13; ;};
return GAA_OK;
break;
case GAAOPTID_generate_proxy:
OK = 0;
-#line 22 "certtool.gaa"
+#line 21 "certtool.gaa"
{ gaaval->action=17; ;};
return GAA_OK;
break;
case GAAOPTID_generate_certificate:
OK = 0;
-#line 20 "certtool.gaa"
+#line 19 "certtool.gaa"
{ gaaval->action=4; ;};
return GAA_OK;
break;
case GAAOPTID_generate_self_signed:
OK = 0;
-#line 18 "certtool.gaa"
+#line 17 "certtool.gaa"
{ gaaval->action=0; ;};
return GAA_OK;
@@ -1076,7 +1064,7 @@ int gaa(int argc, char **argv, gaainfo *gaaval)
if(inited == 0)
{
-#line 116 "certtool.gaa"
+#line 114 "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->action=-1; gaaval->pass = NULL;
diff --git a/src/certtool-gaa.h b/src/certtool-gaa.h
index 28f5981042..0c4b9c92f6 100644
--- a/src/certtool-gaa.h
+++ b/src/certtool-gaa.h
@@ -8,45 +8,45 @@ typedef struct _gaainfo gaainfo;
struct _gaainfo
{
-#line 108 "certtool.gaa"
+#line 107 "certtool.gaa"
int debug;
-#line 104 "certtool.gaa"
+#line 103 "certtool.gaa"
char *template;
-#line 101 "certtool.gaa"
+#line 100 "certtool.gaa"
char *infile;
-#line 98 "certtool.gaa"
+#line 97 "certtool.gaa"
char *outfile;
-#line 95 "certtool.gaa"
+#line 94 "certtool.gaa"
int bits;
-#line 92 "certtool.gaa"
+#line 91 "certtool.gaa"
int outcert_format;
-#line 89 "certtool.gaa"
+#line 88 "certtool.gaa"
int xml;
-#line 86 "certtool.gaa"
+#line 85 "certtool.gaa"
int incert_format;
-#line 83 "certtool.gaa"
+#line 82 "certtool.gaa"
int export;
-#line 80 "certtool.gaa"
+#line 79 "certtool.gaa"
char *hash;
-#line 77 "certtool.gaa"
+#line 76 "certtool.gaa"
int dsa;
-#line 74 "certtool.gaa"
+#line 73 "certtool.gaa"
int pkcs8;
-#line 69 "certtool.gaa"
+#line 68 "certtool.gaa"
int fix_key;
-#line 54 "certtool.gaa"
+#line 53 "certtool.gaa"
char *pass;
-#line 51 "certtool.gaa"
+#line 50 "certtool.gaa"
char *ca;
-#line 48 "certtool.gaa"
+#line 47 "certtool.gaa"
char *ca_privkey;
-#line 45 "certtool.gaa"
+#line 44 "certtool.gaa"
char *cert;
-#line 42 "certtool.gaa"
+#line 41 "certtool.gaa"
char *request;
-#line 39 "certtool.gaa"
+#line 38 "certtool.gaa"
char *privkey;
-#line 17 "certtool.gaa"
+#line 16 "certtool.gaa"
int action;
#line 114 "gaa.skel"