libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 22e3613826a28f046f3e48639956c7721e7c8de0
parent 60ad84521a4b13807694f41f6f01a989c8210aac
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 13 Oct 2008 03:56:53 +0000

integrating fixes in gnutls

Diffstat:
Msrc/daemon/https/tls/auth_rsa.c | 1-
Msrc/daemon/https/tls/auth_rsa_export.c | 1-
Msrc/daemon/https/tls/gnutls_cert.c | 1-
Msrc/daemon/https/tls/gnutls_cert.h | 1-
Msrc/daemon/https/tls/gnutls_constate.c | 3---
Msrc/daemon/https/tls/gnutls_handshake.c | 2+-
Msrc/daemon/https/tls/gnutls_mpi.h | 2--
Msrc/daemon/https/tls/gnutls_sig.c | 1-
Msrc/daemon/https/tls/gnutls_x509.c | 4+---
Msrc/daemon/https/x509/common.c | 38++++++++++++++++----------------------
Msrc/daemon/https/x509/x509.h | 1+
11 files changed, 19 insertions(+), 36 deletions(-)

diff --git a/src/daemon/https/tls/auth_rsa.c b/src/daemon/https/tls/auth_rsa.c @@ -31,7 +31,6 @@ #include "gnutls_errors.h" #include "gnutls_dh.h" #include "gnutls_num.h" -#include "libtasn1.h" #include "gnutls_datum.h" #include "auth_cert.h" #include <gnutls_pk.h> diff --git a/src/daemon/https/tls/auth_rsa_export.c b/src/daemon/https/tls/auth_rsa_export.c @@ -31,7 +31,6 @@ #include "gnutls_errors.h" #include "gnutls_dh.h" #include "gnutls_num.h" -#include "libtasn1.h" #include "gnutls_datum.h" #include "auth_cert.h" #include <gnutls_pk.h> diff --git a/src/daemon/https/tls/gnutls_cert.c b/src/daemon/https/tls/gnutls_cert.c @@ -30,7 +30,6 @@ #include <gnutls_errors.h> #include <auth_cert.h> #include <gnutls_cert.h> -#include <libtasn1.h> #include <gnutls_datum.h> #include <gnutls_mpi.h> #include <gnutls_global.h> diff --git a/src/daemon/https/tls/gnutls_cert.h b/src/daemon/https/tls/gnutls_cert.h @@ -26,7 +26,6 @@ # define GNUTLS_CERT_H #include <gnutls_pk.h> -#include <libtasn1.h> #include "x509.h" #define MAX_PUBLIC_PARAMS_SIZE 4 /* ok for RSA and DSA */ diff --git a/src/daemon/https/tls/gnutls_constate.c b/src/daemon/https/tls/gnutls_constate.c @@ -59,9 +59,6 @@ int MHD__gnutls_set_keys (MHD_gtls_session_t session, int hash_size, int IV_size, int key_size, int export_flag) { - -/* FIXME: This function is too long - */ opaque *key_block; opaque rnd[2 * TLS_RANDOM_SIZE]; opaque rrnd[2 * TLS_RANDOM_SIZE]; diff --git a/src/daemon/https/tls/gnutls_handshake.c b/src/daemon/https/tls/gnutls_handshake.c @@ -1012,7 +1012,7 @@ MHD_gtls_send_handshake (MHD_gtls_session_t session, void *i_data, MHD__gnutls_handshake_log ("HSK[%x]: %s was sent [%ld bytes]\n", session, MHD__gnutls_handshake2str (type), - datasize); + (long) datasize); MHD_gnutls_afree (data); diff --git a/src/daemon/https/tls/gnutls_mpi.h b/src/daemon/https/tls/gnutls_mpi.h @@ -27,8 +27,6 @@ # include <gnutls_int.h> # include <gcrypt.h> -# include <libtasn1.h> -/* lgl */ # include "gc.h" typedef gcry_mpi_t mpi_t; diff --git a/src/daemon/https/tls/gnutls_sig.c b/src/daemon/https/tls/gnutls_sig.c @@ -27,7 +27,6 @@ #include <x509_b64.h> #include <auth_cert.h> #include <gnutls_cert.h> -#include <libtasn1.h> #include <gnutls_datum.h> #include <gnutls_mpi.h> #include <gnutls_global.h> diff --git a/src/daemon/https/tls/gnutls_x509.c b/src/daemon/https/tls/gnutls_x509.c @@ -29,7 +29,6 @@ #include <auth_cert.h> #include "gnutls_dh.h" #include "gnutls_num.h" -#include "libtasn1.h" #include "gnutls_datum.h" #include <gnutls_pk.h> #include <gnutls_algorithms.h> @@ -141,8 +140,7 @@ MHD__gnutls_x509_cert_verify_peers (MHD_gtls_session_t session, */ peer_certificate_list_size = info->ncerts; peer_certificate_list = - MHD_gnutls_calloc (1, - peer_certificate_list_size * + MHD_gnutls_calloc (peer_certificate_list_size, sizeof (MHD_gnutls_x509_crt_t)); if (peer_certificate_list == NULL) { diff --git a/src/daemon/https/x509/common.c b/src/daemon/https/x509/common.c @@ -410,39 +410,33 @@ MHD__gnutls_x509_data2hex (const opaque * data, { char *res; char escaped[MAX_STRING_LEN]; + unsigned int size; if (2 * data_size + 1 > MAX_STRING_LEN) { MHD_gnutls_assert (); return GNUTLS_E_INTERNAL_ERROR; } - res = MHD_gtls_bin2hex (data, data_size, escaped, sizeof (escaped)); - - if (res) - { - unsigned int size = strlen (res) + 1; - if (size + 1 > *sizeof_out) - { - *sizeof_out = size; - return GNUTLS_E_SHORT_MEMORY_BUFFER; - } - *sizeof_out = size; /* -1 for the null +1 for the '#' */ - - if (out) - { - strcpy ((char *) out, "#"); - strcat ((char *) out, res); - } - - return 0; - } - else + if (!res) { MHD_gnutls_assert (); return GNUTLS_E_INTERNAL_ERROR; } - + + size = strlen (res) + 1; + if (size + 1 > *sizeof_out) + { + *sizeof_out = size; + return GNUTLS_E_SHORT_MEMORY_BUFFER; + } + *sizeof_out = size; /* -1 for the null +1 for the '#' */ + + if (out) + { + strcpy ((char*) out, "#"); + strcat ((char*) out, res); + } return 0; } diff --git a/src/daemon/https/x509/x509.h b/src/daemon/https/x509/x509.h @@ -33,6 +33,7 @@ extern "C" #endif #include <gnutls.h> +#include <libtasn1.h> #include "gnutls_mpi.h" /* Some OIDs usually found in Distinguished names, or