diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-21 09:21:04 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-21 09:21:04 +0000 |
commit | 5200606baac835b247944f41763210a2880286b4 (patch) | |
tree | 697e7d57a37110055e37dac9344995cc26d93cc6 | |
parent | e32cf64df1c48e6f5a6fe2a07233d7a510dc8810 (diff) | |
download | gnutls-5200606baac835b247944f41763210a2880286b4.tar.gz |
*** empty log message ***
-rw-r--r-- | src/cli-gaa.c | 40 | ||||
-rw-r--r-- | src/cli-gaa.h | 2 | ||||
-rw-r--r-- | src/cli.gaa | 5 | ||||
-rw-r--r-- | src/common.c | 4 | ||||
-rw-r--r-- | src/common.h | 3 | ||||
-rw-r--r-- | src/serv-gaa.c | 38 | ||||
-rw-r--r-- | src/serv-gaa.h | 2 | ||||
-rw-r--r-- | src/serv.gaa | 3 |
8 files changed, 70 insertions, 27 deletions
diff --git a/src/cli-gaa.c b/src/cli-gaa.c index fba30c7a8b..c0bc8df4f3 100644 --- a/src/cli-gaa.c +++ b/src/cli-gaa.c @@ -1,5 +1,13 @@ +/* File generated by GAA 1.6.0b1 on Wed Feb 20 22:51:21 2002 + */ +#define GAA_NO_WIN32 +#line 53 "cli.gaa" + + +/* C declarations */ + +#include <common.h> #include <stdio.h> -#include <string.h> #ifndef GAA_NO_WIN32 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(WINDOWS) @@ -100,7 +108,7 @@ void __gaa_helpsingle(char short_name, char *name, printf("\n"); } -void gaa_help() +void gaa_help(void) { printf("cli help\nUsage: cli [options] hostname""\n"); __gaa_helpsingle('r', "resume", "", "Connect, establish a session. Connect again and resume this session."); @@ -176,7 +184,7 @@ extern "C" int gaa(int argc, char *argv[], gaainfo *gaaval); - void gaa_help(); + void gaa_help(void); int gaa_file(char *name, gaainfo *gaaval); @@ -191,10 +199,10 @@ extern "C" /* C declarations */ -#define GAAERROR \ +#define GAAERROR(x) \ { \ gaa_error = 1; \ -return; \ +return x; \ } char *gaa_current_option; @@ -299,12 +307,14 @@ num = 0; \ if(!OK) \ { \ num = 0; \ -target = malloc((gaa_last_non_option - gaa_index) * sizeof(type)); \ +target = NULL; \ +if ( gaa_last_non_option - gaa_index > 0) \ + target = malloc((gaa_last_non_option - gaa_index) * sizeof(type));\ for(; gaa_index < gaa_last_non_option; gaa_index++) \ { \ if(gaa_arg_used[gaa_index] == 0) \ { \ - GAA_FILL_2ARGS(target[num], func); \ + GAA_FILL_2ARGS(target[num], func); \ num++; \ } \ } \ @@ -316,7 +326,9 @@ if(num == 0) \ if(!OK) \ { \ num = 0; \ -target = malloc((gaa_last_non_option - gaa_index) * sizeof(type)); \ +target = NULL; \ +if ( gaa_last_non_option - gaa_index > 0) \ + target = malloc((gaa_last_non_option - gaa_index) * sizeof(type));\ for(; gaa_index < gaa_last_non_option; gaa_index++) \ { \ if(gaa_arg_used[gaa_index] == 0) \ @@ -382,7 +394,7 @@ int gaa_getint(char *arg) if(sscanf(arg, "%d%c", &tmp, &a) != 1) { printf("Option %s : '%s' isn't an integer\n", gaa_current_option, arg); - GAAERROR; + GAAERROR(-1); } return tmp; } @@ -392,7 +404,7 @@ char gaa_getchar(char *arg) if(strlen(arg) != 1) { printf("Option %s : '%s' isn't an character\n", gaa_current_option, arg); - GAAERROR; + GAAERROR(-1); } return arg[0]; } @@ -408,7 +420,7 @@ float gaa_getfloat(char *arg) if(sscanf(arg, "%f%c", &tmp, &a) != 1) { printf("Option %s : '%s' isn't a float number\n", gaa_current_option, arg); - GAAERROR; + GAAERROR(-1); } return tmp; } @@ -703,7 +715,10 @@ int gaa(int argc, char **argv, gaainfo *gaaval) } inited = 1; #line 438 "gaa.skel" - gaa_arg_used = malloc(argc * sizeof(char)); + gaa_arg_used = NULL; + + if (argc > 0) + gaa_arg_used = malloc(argc * sizeof(char)); for(i = 1; i < argc; i++) gaa_arg_used[i] = 0; for(i = 1; i < argc; i++) @@ -867,6 +882,7 @@ int gaa_internal_get_next_str(FILE *file, gaa_str_node *tmp_str, int argc) tmp_str->str[i - 1] = 0; fseek(file,- 1, SEEK_CUR); +/* printf("%d\n", ftell(file)); */ return -1; } diff --git a/src/cli-gaa.h b/src/cli-gaa.h index 237fbd4764..d141d7e450 100644 --- a/src/cli-gaa.h +++ b/src/cli-gaa.h @@ -55,7 +55,7 @@ extern "C" int gaa(int argc, char *argv[], gaainfo *gaaval); - void gaa_help(); + void gaa_help(void); int gaa_file(char *name, gaainfo *gaaval); diff --git a/src/cli.gaa b/src/cli.gaa index bf3e477065..8c16f35002 100644 --- a/src/cli.gaa +++ b/src/cli.gaa @@ -50,3 +50,8 @@ init { $resume=0; $port=5556; $rest_args=NULL; $nrest_args=0; $ciphers=NULL; $nkx=0; $ncomp=0; $nmacs=0; $nctype = 0; $record_size=0; $fingerprint=0; } +## + +/* C declarations */ + +#include <common.h> diff --git a/src/common.c b/src/common.c index 03ec39e6d6..ffc71f83fd 100644 --- a/src/common.c +++ b/src/common.c @@ -120,8 +120,10 @@ void print_cert_vrfy(GNUTLS_STATE state) switch (status) { case GNUTLS_CERT_VALID: + printf("- Peer's certificate is NOT trusted but valid\n"); + break; case GNUTLS_CERT_INVALID: - printf("- Peer's certificate is NOT trusted\n"); + printf("- Peer's certificate is invalid\n"); break; case GNUTLS_CERT_EXPIRED: printf diff --git a/src/common.h b/src/common.h index cba30f8f01..19709f970e 100644 --- a/src/common.h +++ b/src/common.h @@ -1,4 +1,7 @@ #define PORT 5556 #define SERVER "127.0.0.1" +#include <gnutls.h> + int print_info( GNUTLS_STATE state); +int print_list(void);
\ No newline at end of file diff --git a/src/serv-gaa.c b/src/serv-gaa.c index 2eb4b649b1..00fa291472 100644 --- a/src/serv-gaa.c +++ b/src/serv-gaa.c @@ -1,5 +1,11 @@ +/* File generated by GAA 1.6.0b1 on Wed Feb 20 22:51:19 2002 + */ +#define GAA_NO_WIN32 +#line 44 "serv.gaa" + + +#include <common.h> #include <stdio.h> -#include <string.h> #ifndef GAA_NO_WIN32 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(WINDOWS) @@ -100,7 +106,7 @@ void __gaa_helpsingle(char short_name, char *name, printf("\n"); } -void gaa_help() +void gaa_help(void) { printf("serv help\nUsage: serv [options]""\n"); __gaa_helpsingle('g', "generate", "", "Generate Diffie Hellman Parameters."); @@ -169,7 +175,7 @@ extern "C" int gaa(int argc, char *argv[], gaainfo *gaaval); - void gaa_help(); + void gaa_help(void); int gaa_file(char *name, gaainfo *gaaval); @@ -184,10 +190,10 @@ extern "C" /* C declarations */ -#define GAAERROR \ +#define GAAERROR(x) \ { \ gaa_error = 1; \ -return; \ +return x; \ } char *gaa_current_option; @@ -291,12 +297,14 @@ num = 0; \ if(!OK) \ { \ num = 0; \ -target = malloc((gaa_last_non_option - gaa_index) * sizeof(type)); \ +target = NULL; \ +if ( gaa_last_non_option - gaa_index > 0) \ + target = malloc((gaa_last_non_option - gaa_index) * sizeof(type));\ for(; gaa_index < gaa_last_non_option; gaa_index++) \ { \ if(gaa_arg_used[gaa_index] == 0) \ { \ - GAA_FILL_2ARGS(target[num], func); \ + GAA_FILL_2ARGS(target[num], func); \ num++; \ } \ } \ @@ -308,7 +316,9 @@ if(num == 0) \ if(!OK) \ { \ num = 0; \ -target = malloc((gaa_last_non_option - gaa_index) * sizeof(type)); \ +target = NULL; \ +if ( gaa_last_non_option - gaa_index > 0) \ + target = malloc((gaa_last_non_option - gaa_index) * sizeof(type));\ for(; gaa_index < gaa_last_non_option; gaa_index++) \ { \ if(gaa_arg_used[gaa_index] == 0) \ @@ -374,7 +384,7 @@ int gaa_getint(char *arg) if(sscanf(arg, "%d%c", &tmp, &a) != 1) { printf("Option %s : '%s' isn't an integer\n", gaa_current_option, arg); - GAAERROR; + GAAERROR(-1); } return tmp; } @@ -384,7 +394,7 @@ char gaa_getchar(char *arg) if(strlen(arg) != 1) { printf("Option %s : '%s' isn't an character\n", gaa_current_option, arg); - GAAERROR; + GAAERROR(-1); } return arg[0]; } @@ -400,7 +410,7 @@ float gaa_getfloat(char *arg) if(sscanf(arg, "%f%c", &tmp, &a) != 1) { printf("Option %s : '%s' isn't a float number\n", gaa_current_option, arg); - GAAERROR; + GAAERROR(-1); } return tmp; } @@ -661,7 +671,10 @@ int gaa(int argc, char **argv, gaainfo *gaaval) } inited = 1; #line 438 "gaa.skel" - gaa_arg_used = malloc(argc * sizeof(char)); + gaa_arg_used = NULL; + + if (argc > 0) + gaa_arg_used = malloc(argc * sizeof(char)); for(i = 1; i < argc; i++) gaa_arg_used[i] = 0; for(i = 1; i < argc; i++) @@ -825,6 +838,7 @@ int gaa_internal_get_next_str(FILE *file, gaa_str_node *tmp_str, int argc) tmp_str->str[i - 1] = 0; fseek(file,- 1, SEEK_CUR); +/* printf("%d\n", ftell(file)); */ return -1; } diff --git a/src/serv-gaa.h b/src/serv-gaa.h index 5cc7502b6b..2f91a0075a 100644 --- a/src/serv-gaa.h +++ b/src/serv-gaa.h @@ -49,7 +49,7 @@ extern "C" int gaa(int argc, char *argv[], gaainfo *gaaval); - void gaa_help(); + void gaa_help(void); int gaa_file(char *name, gaainfo *gaaval); diff --git a/src/serv.gaa b/src/serv.gaa index 34abc848cf..d6afdb6788 100644 --- a/src/serv.gaa +++ b/src/serv.gaa @@ -41,3 +41,6 @@ init { $generate=0; $port=5556; $http=0; $ciphers=NULL; $kx=NULL; $comp=NULL; $macs=NULL; $ctype=NULL; $nciphers=0; $nkx=0; $ncomp=0; $nmacs=0; $nctype = 0; } +## + +#include <common.h> |