From: Nikos Mavrogiannopoulos Date: Mon, 18 Mar 2002 07:43:13 +0000 (+0000) Subject: removed default parameters arguments X-Git-Tag: gnutls_0_3_92~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e80c14ffe6f242a3e3ade2e810fe726fde1a332;p=thirdparty%2Fgnutls.git removed default parameters arguments --- diff --git a/src/cli.c b/src/cli.c index a37a9d7444..e98ed34441 100644 --- a/src/cli.c +++ b/src/cli.c @@ -217,12 +217,14 @@ int main(int argc, char **argv) /* gnutls_certificate_client_callback_func( xcred, cert_callback); */ /* SRP stuff */ - if (gnutls_srp_allocate_client_sc(&cred) < 0) { - fprintf(stderr, "memory error\n"); - exit(1); + if (srp_username!=NULL) { + if (gnutls_srp_allocate_client_sc(&cred) < 0) { + fprintf(stderr, "memory error\n"); + exit(1); + } + gnutls_srp_set_client_cred(cred, srp_username, srp_passwd); } - gnutls_srp_set_client_cred(cred, srp_username, srp_passwd); - + /* ANON stuff */ if (gnutls_anon_allocate_client_sc(&anon_cred) < 0) { fprintf(stderr, "memory error\n"); @@ -262,7 +264,8 @@ int main(int argc, char **argv) gnutls_dh_set_prime_bits(state, 1024); gnutls_cred_set(state, GNUTLS_CRD_ANON, anon_cred); - gnutls_cred_set(state, GNUTLS_CRD_SRP, cred); + if (srp_username!=NULL) + gnutls_cred_set(state, GNUTLS_CRD_SRP, cred); gnutls_cred_set(state, GNUTLS_CRD_CERTIFICATE, xcred); /* send the fingerprint */ @@ -451,7 +454,8 @@ int main(int argc, char **argv) gnutls_deinit(state); - gnutls_srp_free_client_sc(cred); + if (srp_username!=NULL) + gnutls_srp_free_client_sc(cred); gnutls_certificate_free_sc(xcred); gnutls_anon_free_client_sc(anon_cred); @@ -460,6 +464,8 @@ int main(int argc, char **argv) return 0; } +#undef DEBUG + static gaainfo info; void gaa_parser(int argc, char **argv) { @@ -476,6 +482,7 @@ void gaa_parser(int argc, char **argv) record_max_size = info.record_size; fingerprint = info.fingerprint; +#ifdef DEBUG if (info.x509_certfile != NULL) x509_certfile = info.x509_certfile; else @@ -510,6 +517,16 @@ void gaa_parser(int argc, char **argv) srp_username = info.srp_username; else srp_username = DEFAULT_SRP_USERNAME; +#else + srp_username = info.srp_username; + srp_passwd = info.srp_passwd; + x509_cafile = info.x509_certfile; + x509_keyfile = info.x509_keyfile; + x509_certfile = info.x509_certfile; + pgp_keyfile = info.pgp_keyfile; + pgp_certfile = info.pgp_certfile; + +#endif pgp_keyring = info.pgp_keyring; pgp_trustdb = info.pgp_trustdb; diff --git a/src/serv.c b/src/serv.c index 0228753329..07c98819e9 100644 --- a/src/serv.c +++ b/src/serv.c @@ -548,6 +548,8 @@ int main(int argc, char **argv) #define DEFAULT_SRP_PASSWD "srp/tpasswd" #define DEFAULT_SRP_PASSWD_CONF "srp/tpasswd.conf" +#undef DEBUG + static gaainfo info; void gaa_parser(int argc, char **argv) { @@ -571,6 +573,7 @@ void gaa_parser(int argc, char **argv) port = info.port; +#ifdef DEBUG if (info.x509_certfile != NULL) x509_certfile = info.x509_certfile; else @@ -596,8 +599,6 @@ void gaa_parser(int argc, char **argv) else pgp_keyfile = DEFAULT_PGP_KEYFILE; - pgp_keyserver = info.pgp_keyserver; - if (info.srp_passwd != NULL) srp_passwd = info.srp_passwd; else @@ -607,7 +608,17 @@ void gaa_parser(int argc, char **argv) srp_passwd_conf = info.srp_passwd_conf; else srp_passwd_conf = DEFAULT_SRP_PASSWD_CONF; +#else + x509_certfile = info.x509_certfile; + x509_keyfile = info.x509_keyfile; + x509_cafile = info.x509_certfile; + pgp_certfile = info.pgp_certfile; + pgp_keyfile = info.pgp_keyfile; + srp_passwd = info.srp_passwd; + srp_passwd_conf = info.srp_passwd_conf; +#endif + pgp_keyserver = info.pgp_keyserver; pgp_keyring = info.pgp_keyring; pgp_trustdb = info.pgp_trustdb;