From: Nikos Mavrogiannopoulos Date: Fri, 21 Nov 2003 09:37:03 +0000 (+0000) Subject: Some fixes pointed out by Dimitri Papadopoulos-Orfanos X-Git-Tag: gnutls_0_9_99~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec706eb620ea0eab2ffcbc3ea76e56877cc99865;p=thirdparty%2Fgnutls.git Some fixes pointed out by Dimitri Papadopoulos-Orfanos --- diff --git a/THANKS b/THANKS index 3a13c79723..ea3609ba82 100644 --- a/THANKS +++ b/THANKS @@ -17,3 +17,4 @@ Ivo Timmermans Ian Peters Arne Thomassen Casey Marshall +Dimitri Papadopoulos-Orfanos diff --git a/lib/gnutls_session.c b/lib/gnutls_session.c index e897afba5e..2c44748431 100644 --- a/lib/gnutls_session.c +++ b/lib/gnutls_session.c @@ -119,7 +119,10 @@ int gnutls_session_set_data( gnutls_session session, const void* session_data, size_t session_data_size) { int ret; - gnutls_datum psession = { (opaque*)session_data, session_data_size }; + gnutls_datum psession; + + psession.data = (opaque*)session_data; + psession.size = session_data_size; if (session_data==NULL || session_data_size == 0) { gnutls_assert(); diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c index 1f0a571466..9f61e21d0d 100644 --- a/lib/x509/pkcs12.c +++ b/lib/x509/pkcs12.c @@ -172,7 +172,10 @@ int gnutls_pkcs12_import(gnutls_pkcs12 pkcs12, const gnutls_datum * data, gnutls_x509_crt_fmt format, unsigned int flags) { int result = 0, need_free = 0; - gnutls_datum _data = { data->data, data->size }; + gnutls_datum _data; + + _data.data = data->data; + _data.size = data->size; if (pkcs12==NULL) { gnutls_assert(); diff --git a/libextra/gnutls_openssl.c b/libextra/gnutls_openssl.c index 373ca1c8f2..558502bae6 100644 --- a/libextra/gnutls_openssl.c +++ b/libextra/gnutls_openssl.c @@ -186,7 +186,7 @@ SSL *SSL_new(SSL_CTX *ctx) if (!ssl) return NULL; - err = gnutls_certificate_allocate_cred(&ssl->gnutls_cred); + err = gnutls_certificate_allocate_credentials(&ssl->gnutls_cred); if (err < 0) { last_error = err; @@ -202,7 +202,7 @@ SSL *SSL_new(SSL_CTX *ctx) gnutls_kx_set_priority (ssl->gnutls_state, ctx->method->kx_priority); gnutls_mac_set_priority (ssl->gnutls_state, ctx->method->mac_priority); - gnutls_cred_set (ssl->gnutls_state, GNUTLS_CRD_CERTIFICATE, ssl->gnutls_cred); + gnutls_credentials_set (ssl->gnutls_state, GNUTLS_CRD_CERTIFICATE, ssl->gnutls_cred); if (ctx->certfile) gnutls_certificate_set_x509_trust_file(ssl->gnutls_cred, ctx->certfile, ctx->certfile_type); @@ -223,7 +223,7 @@ SSL *SSL_new(SSL_CTX *ctx) void SSL_free(SSL *ssl) { - gnutls_certificate_free_cred(ssl->gnutls_cred); + gnutls_certificate_free_credentials(ssl->gnutls_cred); gnutls_deinit(ssl->gnutls_state); free(ssl); } diff --git a/src/certtool.gaa b/src/certtool.gaa index 8e94aed7aa..007200952a 100644 --- a/src/certtool.gaa +++ b/src/certtool.gaa @@ -7,6 +7,9 @@ # include #endif +void print_license(void); +void certtool_version(void); + #} helpnode "Certtool help\nUsage: certtool [options]" diff --git a/src/serv-gaa.c b/src/serv-gaa.c index 29085639bb..abb4d237e0 100644 --- a/src/serv-gaa.c +++ b/src/serv-gaa.c @@ -6,7 +6,7 @@ #include -void print_license(void); +void print_serv_license(void); void serv_version(void); #include @@ -463,7 +463,7 @@ int gaa_getint(char *arg) { int tmp; char a; - if(sscanf(arg, "%d%c", &tmp, &a) != 1) + if(sscanf(arg, "%d%c", &tmp, &a) < 1) { printf("Option %s: '%s' isn't an integer\n", gaa_current_option, arg); GAAERROR(-1); @@ -489,7 +489,7 @@ float gaa_getfloat(char *arg) { float tmp; char a; - if(sscanf(arg, "%f%c", &tmp, &a) != 1) + if(sscanf(arg, "%f%c", &tmp, &a) < 1) { printf("Option %s: '%s' isn't a float number\n", gaa_current_option, arg); GAAERROR(-1); @@ -759,7 +759,7 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list) case GAAOPTID_copyright: OK = 0; #line 97 "serv.gaa" -{ print_license(); exit(0); ;}; +{ print_serv_license(); exit(0); ;}; return GAA_OK; break; diff --git a/src/serv.c b/src/serv.c index 1e145075bd..b855cbad44 100644 --- a/src/serv.c +++ b/src/serv.c @@ -1120,6 +1120,23 @@ static int wrap_db_delete(void *dbf, gnutls_datum key) } +void print_serv_license(void) +{ + fprintf(stdout, + "\nCopyright (C) 2001-2003 Paul Sheer, 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"); +} + #ifdef HAVE_LIBOPENCDK static int diff --git a/src/serv.gaa b/src/serv.gaa index fefcfe78da..c4dcf0c871 100644 --- a/src/serv.gaa +++ b/src/serv.gaa @@ -2,7 +2,7 @@ #include -void print_license(void); +void print_serv_license(void); void serv_version(void); #} @@ -94,7 +94,7 @@ option (l, list) { print_list(); exit(0); } "Print a list of the supported algor option (h, help) { gaa_help(); exit(0); } "prints this help" option (v, version) { serv_version(); exit(0); } "prints the program's version number" -option ( copyright) { print_license(); exit(0); } "prints the program's license" +option ( copyright) { print_serv_license(); exit(0); } "prints the program's license" init { $generate=0; $port=5556; $http=0; $ciphers=NULL;