]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Some fixes pointed out by Dimitri Papadopoulos-Orfanos <papadopo@shfj.cea.fr>
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 21 Nov 2003 09:37:03 +0000 (09:37 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 21 Nov 2003 09:37:03 +0000 (09:37 +0000)
THANKS
lib/gnutls_session.c
lib/x509/pkcs12.c
libextra/gnutls_openssl.c
src/certtool.gaa
src/serv-gaa.c
src/serv.c
src/serv.gaa

diff --git a/THANKS b/THANKS
index 3a13c797232f55c49744562ab8383d03726675a7..ea3609ba8239cf004bc2fea850274fa2925cf545 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -17,3 +17,4 @@ Ivo Timmermans            <ivo@o2w.nl>
 Ian Peters                <itp@ximian.com>
 Arne Thomassen            <arne@arne-thomassen.de>
 Casey Marshall            <rsdio@metastatic.org>
+Dimitri        Papadopoulos-Orfanos <papadopo@shfj.cea.fr>
index e897afba5e43a198e93fa590ea454031280b2736..2c44748431b59dc65be67460859de003ce4f38ec 100644 (file)
@@ -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();
index 1f0a571466a0ce8e05a1927081d833de07e709a3..9f61e21d0d553b98907da024b6d47fb1d8e310d2 100644 (file)
@@ -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();
index 373ca1c8f2f36fc9210737d717bcb490b10beb3e..558502bae60c821e366fd124073b18f5387970ec 100644 (file)
@@ -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);
 }
index 8e94aed7aa27555fa2e3bbc83760b319e6572733..007200952aea6ab744811b89c4306c31f326f2b8 100644 (file)
@@ -7,6 +7,9 @@
 # include <io.h>
 #endif
 
+void print_license(void);
+void certtool_version(void);
+
 #}
 
 helpnode "Certtool help\nUsage: certtool [options]"
index 29085639bbaca35af4f2baf2a8f61b9672bdbaa5..abb4d237e0312266c452cf8362592b732ed94f73 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <common.h>
 
-void print_license(void);
+void print_serv_license(void);
 void serv_version(void);
 
 #include <stdio.h>
@@ -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;
index 1e145075bd246e7fc0426cc99156e98781ea5e00..b855cbad440fce0cfcd4428408d1f39865b59085 100644 (file)
@@ -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
index fefcfe78daff6c2826de3dc7529ffac6fb9172f2..c4dcf0c871ed07f4dff3db051f0fbbda73bf07b8 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <common.h>
 
-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;