diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-10-13 03:56:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-10-13 03:56:53 +0000 |
commit | 22e3613826a28f046f3e48639956c7721e7c8de0 (patch) | |
tree | b40087d17162a531e26e12265702d52afad688f0 | |
parent | 60ad84521a4b13807694f41f6f01a989c8210aac (diff) | |
download | libmicrohttpd-22e3613826a28f046f3e48639956c7721e7c8de0.tar.gz libmicrohttpd-22e3613826a28f046f3e48639956c7721e7c8de0.zip |
integrating fixes in gnutls
-rw-r--r-- | src/daemon/https/tls/auth_rsa.c | 1 | ||||
-rw-r--r-- | src/daemon/https/tls/auth_rsa_export.c | 1 | ||||
-rw-r--r-- | src/daemon/https/tls/gnutls_cert.c | 1 | ||||
-rw-r--r-- | src/daemon/https/tls/gnutls_cert.h | 1 | ||||
-rw-r--r-- | src/daemon/https/tls/gnutls_constate.c | 3 | ||||
-rw-r--r-- | src/daemon/https/tls/gnutls_handshake.c | 2 | ||||
-rw-r--r-- | src/daemon/https/tls/gnutls_mpi.h | 2 | ||||
-rw-r--r-- | src/daemon/https/tls/gnutls_sig.c | 1 | ||||
-rw-r--r-- | src/daemon/https/tls/gnutls_x509.c | 4 | ||||
-rw-r--r-- | src/daemon/https/x509/common.c | 38 | ||||
-rw-r--r-- | src/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 index f39a91fb..1b461951 100644 --- a/src/daemon/https/tls/auth_rsa.c +++ b/src/daemon/https/tls/auth_rsa.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include "gnutls_errors.h" | 31 | #include "gnutls_errors.h" |
32 | #include "gnutls_dh.h" | 32 | #include "gnutls_dh.h" |
33 | #include "gnutls_num.h" | 33 | #include "gnutls_num.h" |
34 | #include "libtasn1.h" | ||
35 | #include "gnutls_datum.h" | 34 | #include "gnutls_datum.h" |
36 | #include "auth_cert.h" | 35 | #include "auth_cert.h" |
37 | #include <gnutls_pk.h> | 36 | #include <gnutls_pk.h> |
diff --git a/src/daemon/https/tls/auth_rsa_export.c b/src/daemon/https/tls/auth_rsa_export.c index 5fdce12e..575a2b72 100644 --- a/src/daemon/https/tls/auth_rsa_export.c +++ b/src/daemon/https/tls/auth_rsa_export.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include "gnutls_errors.h" | 31 | #include "gnutls_errors.h" |
32 | #include "gnutls_dh.h" | 32 | #include "gnutls_dh.h" |
33 | #include "gnutls_num.h" | 33 | #include "gnutls_num.h" |
34 | #include "libtasn1.h" | ||
35 | #include "gnutls_datum.h" | 34 | #include "gnutls_datum.h" |
36 | #include "auth_cert.h" | 35 | #include "auth_cert.h" |
37 | #include <gnutls_pk.h> | 36 | #include <gnutls_pk.h> |
diff --git a/src/daemon/https/tls/gnutls_cert.c b/src/daemon/https/tls/gnutls_cert.c index d01d3918..52be5fb5 100644 --- a/src/daemon/https/tls/gnutls_cert.c +++ b/src/daemon/https/tls/gnutls_cert.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <gnutls_errors.h> | 30 | #include <gnutls_errors.h> |
31 | #include <auth_cert.h> | 31 | #include <auth_cert.h> |
32 | #include <gnutls_cert.h> | 32 | #include <gnutls_cert.h> |
33 | #include <libtasn1.h> | ||
34 | #include <gnutls_datum.h> | 33 | #include <gnutls_datum.h> |
35 | #include <gnutls_mpi.h> | 34 | #include <gnutls_mpi.h> |
36 | #include <gnutls_global.h> | 35 | #include <gnutls_global.h> |
diff --git a/src/daemon/https/tls/gnutls_cert.h b/src/daemon/https/tls/gnutls_cert.h index ee3b3ca8..0a1a04db 100644 --- a/src/daemon/https/tls/gnutls_cert.h +++ b/src/daemon/https/tls/gnutls_cert.h | |||
@@ -26,7 +26,6 @@ | |||
26 | # define GNUTLS_CERT_H | 26 | # define GNUTLS_CERT_H |
27 | 27 | ||
28 | #include <gnutls_pk.h> | 28 | #include <gnutls_pk.h> |
29 | #include <libtasn1.h> | ||
30 | #include "x509.h" | 29 | #include "x509.h" |
31 | 30 | ||
32 | #define MAX_PUBLIC_PARAMS_SIZE 4 /* ok for RSA and DSA */ | 31 | #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 index 11c8beca..fe5cf5bd 100644 --- a/src/daemon/https/tls/gnutls_constate.c +++ b/src/daemon/https/tls/gnutls_constate.c | |||
@@ -59,9 +59,6 @@ int | |||
59 | MHD__gnutls_set_keys (MHD_gtls_session_t session, int hash_size, int IV_size, | 59 | MHD__gnutls_set_keys (MHD_gtls_session_t session, int hash_size, int IV_size, |
60 | int key_size, int export_flag) | 60 | int key_size, int export_flag) |
61 | { | 61 | { |
62 | |||
63 | /* FIXME: This function is too long | ||
64 | */ | ||
65 | opaque *key_block; | 62 | opaque *key_block; |
66 | opaque rnd[2 * TLS_RANDOM_SIZE]; | 63 | opaque rnd[2 * TLS_RANDOM_SIZE]; |
67 | opaque rrnd[2 * TLS_RANDOM_SIZE]; | 64 | opaque rrnd[2 * TLS_RANDOM_SIZE]; |
diff --git a/src/daemon/https/tls/gnutls_handshake.c b/src/daemon/https/tls/gnutls_handshake.c index 291ad03e..db28ad9a 100644 --- 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, | |||
1012 | 1012 | ||
1013 | MHD__gnutls_handshake_log ("HSK[%x]: %s was sent [%ld bytes]\n", | 1013 | MHD__gnutls_handshake_log ("HSK[%x]: %s was sent [%ld bytes]\n", |
1014 | session, MHD__gnutls_handshake2str (type), | 1014 | session, MHD__gnutls_handshake2str (type), |
1015 | datasize); | 1015 | (long) datasize); |
1016 | 1016 | ||
1017 | MHD_gnutls_afree (data); | 1017 | MHD_gnutls_afree (data); |
1018 | 1018 | ||
diff --git a/src/daemon/https/tls/gnutls_mpi.h b/src/daemon/https/tls/gnutls_mpi.h index ec633ca0..b3494024 100644 --- a/src/daemon/https/tls/gnutls_mpi.h +++ b/src/daemon/https/tls/gnutls_mpi.h | |||
@@ -27,8 +27,6 @@ | |||
27 | 27 | ||
28 | # include <gnutls_int.h> | 28 | # include <gnutls_int.h> |
29 | # include <gcrypt.h> | 29 | # include <gcrypt.h> |
30 | # include <libtasn1.h> | ||
31 | /* lgl */ | ||
32 | # include "gc.h" | 30 | # include "gc.h" |
33 | 31 | ||
34 | typedef gcry_mpi_t mpi_t; | 32 | typedef gcry_mpi_t mpi_t; |
diff --git a/src/daemon/https/tls/gnutls_sig.c b/src/daemon/https/tls/gnutls_sig.c index fcd756b5..afa7c8e1 100644 --- a/src/daemon/https/tls/gnutls_sig.c +++ b/src/daemon/https/tls/gnutls_sig.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <x509_b64.h> | 27 | #include <x509_b64.h> |
28 | #include <auth_cert.h> | 28 | #include <auth_cert.h> |
29 | #include <gnutls_cert.h> | 29 | #include <gnutls_cert.h> |
30 | #include <libtasn1.h> | ||
31 | #include <gnutls_datum.h> | 30 | #include <gnutls_datum.h> |
32 | #include <gnutls_mpi.h> | 31 | #include <gnutls_mpi.h> |
33 | #include <gnutls_global.h> | 32 | #include <gnutls_global.h> |
diff --git a/src/daemon/https/tls/gnutls_x509.c b/src/daemon/https/tls/gnutls_x509.c index 06ee8635..a326ac01 100644 --- a/src/daemon/https/tls/gnutls_x509.c +++ b/src/daemon/https/tls/gnutls_x509.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <auth_cert.h> | 29 | #include <auth_cert.h> |
30 | #include "gnutls_dh.h" | 30 | #include "gnutls_dh.h" |
31 | #include "gnutls_num.h" | 31 | #include "gnutls_num.h" |
32 | #include "libtasn1.h" | ||
33 | #include "gnutls_datum.h" | 32 | #include "gnutls_datum.h" |
34 | #include <gnutls_pk.h> | 33 | #include <gnutls_pk.h> |
35 | #include <gnutls_algorithms.h> | 34 | #include <gnutls_algorithms.h> |
@@ -141,8 +140,7 @@ MHD__gnutls_x509_cert_verify_peers (MHD_gtls_session_t session, | |||
141 | */ | 140 | */ |
142 | peer_certificate_list_size = info->ncerts; | 141 | peer_certificate_list_size = info->ncerts; |
143 | peer_certificate_list = | 142 | peer_certificate_list = |
144 | MHD_gnutls_calloc (1, | 143 | MHD_gnutls_calloc (peer_certificate_list_size, |
145 | peer_certificate_list_size * | ||
146 | sizeof (MHD_gnutls_x509_crt_t)); | 144 | sizeof (MHD_gnutls_x509_crt_t)); |
147 | if (peer_certificate_list == NULL) | 145 | if (peer_certificate_list == NULL) |
148 | { | 146 | { |
diff --git a/src/daemon/https/x509/common.c b/src/daemon/https/x509/common.c index ca2e355f..1d9c60c7 100644 --- 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, | |||
410 | { | 410 | { |
411 | char *res; | 411 | char *res; |
412 | char escaped[MAX_STRING_LEN]; | 412 | char escaped[MAX_STRING_LEN]; |
413 | unsigned int size; | ||
413 | 414 | ||
414 | if (2 * data_size + 1 > MAX_STRING_LEN) | 415 | if (2 * data_size + 1 > MAX_STRING_LEN) |
415 | { | 416 | { |
416 | MHD_gnutls_assert (); | 417 | MHD_gnutls_assert (); |
417 | return GNUTLS_E_INTERNAL_ERROR; | 418 | return GNUTLS_E_INTERNAL_ERROR; |
418 | } | 419 | } |
419 | |||
420 | res = MHD_gtls_bin2hex (data, data_size, escaped, sizeof (escaped)); | 420 | res = MHD_gtls_bin2hex (data, data_size, escaped, sizeof (escaped)); |
421 | 421 | if (!res) | |
422 | if (res) | ||
423 | { | ||
424 | unsigned int size = strlen (res) + 1; | ||
425 | if (size + 1 > *sizeof_out) | ||
426 | { | ||
427 | *sizeof_out = size; | ||
428 | return GNUTLS_E_SHORT_MEMORY_BUFFER; | ||
429 | } | ||
430 | *sizeof_out = size; /* -1 for the null +1 for the '#' */ | ||
431 | |||
432 | if (out) | ||
433 | { | ||
434 | strcpy ((char *) out, "#"); | ||
435 | strcat ((char *) out, res); | ||
436 | } | ||
437 | |||
438 | return 0; | ||
439 | } | ||
440 | else | ||
441 | { | 422 | { |
442 | MHD_gnutls_assert (); | 423 | MHD_gnutls_assert (); |
443 | return GNUTLS_E_INTERNAL_ERROR; | 424 | return GNUTLS_E_INTERNAL_ERROR; |
444 | } | 425 | } |
445 | 426 | ||
427 | size = strlen (res) + 1; | ||
428 | if (size + 1 > *sizeof_out) | ||
429 | { | ||
430 | *sizeof_out = size; | ||
431 | return GNUTLS_E_SHORT_MEMORY_BUFFER; | ||
432 | } | ||
433 | *sizeof_out = size; /* -1 for the null +1 for the '#' */ | ||
434 | |||
435 | if (out) | ||
436 | { | ||
437 | strcpy ((char*) out, "#"); | ||
438 | strcat ((char*) out, res); | ||
439 | } | ||
446 | return 0; | 440 | return 0; |
447 | } | 441 | } |
448 | 442 | ||
diff --git a/src/daemon/https/x509/x509.h b/src/daemon/https/x509/x509.h index 3afda0da..26892fc8 100644 --- a/src/daemon/https/x509/x509.h +++ b/src/daemon/https/x509/x509.h | |||
@@ -33,6 +33,7 @@ extern "C" | |||
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #include <gnutls.h> | 35 | #include <gnutls.h> |
36 | #include <libtasn1.h> | ||
36 | #include "gnutls_mpi.h" | 37 | #include "gnutls_mpi.h" |
37 | 38 | ||
38 | /* Some OIDs usually found in Distinguished names, or | 39 | /* Some OIDs usually found in Distinguished names, or |