diff options
54 files changed, 577 insertions, 562 deletions
diff --git a/configure.ac b/configure.ac index e467f0e7..c6b71330 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -130,12 +130,11 @@ AC_DEFINE_UNQUOTED([MHD_REQ_CURL_VERSION], "$MHD_REQ_CURL_VERSION", [required cU | |||
130 | AC_DEFINE_UNQUOTED([MHD_REQ_CURL_OPENSSL_VERSION], "$MHD_REQ_CURL_OPENSSL_VERSION", [required cURL SSL version to run tests]) | 130 | AC_DEFINE_UNQUOTED([MHD_REQ_CURL_OPENSSL_VERSION], "$MHD_REQ_CURL_OPENSSL_VERSION", [required cURL SSL version to run tests]) |
131 | AC_DEFINE_UNQUOTED([MHD_REQ_CURL_GNUTLS_VERSION], "$MHD_REQ_CURL_GNUTLS_VERSION", [gnuTLS lib version - used in conjunction with cURL]) | 131 | AC_DEFINE_UNQUOTED([MHD_REQ_CURL_GNUTLS_VERSION], "$MHD_REQ_CURL_GNUTLS_VERSION", [gnuTLS lib version - used in conjunction with cURL]) |
132 | 132 | ||
133 | |||
134 | # large file support (> 4 GB) | 133 | # large file support (> 4 GB) |
135 | AC_SYS_LARGEFILE | 134 | AC_SYS_LARGEFILE |
136 | AC_FUNC_FSEEKO | 135 | AC_FUNC_FSEEKO |
137 | 136 | ||
138 | # optional: have error messages? | 137 | # optional: have error messages ? |
139 | AC_MSG_CHECKING(--enable-messages argument) | 138 | AC_MSG_CHECKING(--enable-messages argument) |
140 | AC_ARG_ENABLE(messages, | 139 | AC_ARG_ENABLE(messages, |
141 | [AS_HELP_STRING([--enable-messages], | 140 | [AS_HELP_STRING([--enable-messages], |
@@ -148,6 +147,24 @@ then | |||
148 | AC_DEFINE([HAVE_MESSAGES],[1],[Include error messages]) | 147 | AC_DEFINE([HAVE_MESSAGES],[1],[Include error messages]) |
149 | fi | 148 | fi |
150 | 149 | ||
150 | # optional: compile TLS client side code [only for test running] ? | ||
151 | AC_MSG_CHECKING(--enable-client-side argument) | ||
152 | AC_ARG_ENABLE(client-side, | ||
153 | [AS_HELP_STRING([--enable-client-side], | ||
154 | [Compile client side code])], | ||
155 | [enable_client_side=$enableval], | ||
156 | [enable_client_side="no"]) | ||
157 | AC_MSG_RESULT($enable_client_side) | ||
158 | if test "$enable_client_side" = "no" | ||
159 | then | ||
160 | AC_DEFINE([MHD_DEBUG_TLS],[0],[Compile client side code. This will enable running some test cases.]) | ||
161 | MSG_CLIENT_SIDE="disabled. running some test cases won't be possible" | ||
162 | else | ||
163 | AC_DEFINE([MHD_DEBUG_TLS],[1],[Compile client side code. This will enable running some test cases.]) | ||
164 | MSG_CLIENT_SIDE="enabled" | ||
165 | fi | ||
166 | AM_CONDITIONAL(MHD_DEBUG_TLS, test "$enable_client_side" != "no") | ||
167 | |||
151 | # optional: have zzuf, socat? | 168 | # optional: have zzuf, socat? |
152 | AC_CHECK_PROG([HAVE_ZZUF],[zzuf], 1, 0) | 169 | AC_CHECK_PROG([HAVE_ZZUF],[zzuf], 1, 0) |
153 | AC_CHECK_PROG([HAVE_SOCAT],[socat], 1, 0) | 170 | AC_CHECK_PROG([HAVE_SOCAT],[socat], 1, 0) |
@@ -207,7 +224,7 @@ AC_ARG_ENABLE([OpenPGP], | |||
207 | [AS_HELP_STRING([--enable-OpenPGP], | 224 | [AS_HELP_STRING([--enable-OpenPGP], |
208 | [enable OpenPGP support (default is no)])], | 225 | [enable OpenPGP support (default is no)])], |
209 | [enable_openpgp=$enableval], | 226 | [enable_openpgp=$enableval], |
210 | [enable_openpgp="yes"]) | 227 | [enable_openpgp="no"]) |
211 | AC_MSG_RESULT($enable_openpgp) | 228 | AC_MSG_RESULT($enable_openpgp) |
212 | if test "$enable_openpgp" = "yes" | 229 | if test "$enable_openpgp" = "yes" |
213 | then | 230 | then |
@@ -320,17 +337,18 @@ fi | |||
320 | AC_MSG_NOTICE([Configured to build curl/libcurl: | 337 | AC_MSG_NOTICE([Configured to build curl/libcurl: |
321 | Configuration Summery: | 338 | Configuration Summery: |
322 | 339 | ||
323 | os: ${host_os} | 340 | os: ${host_os} |
324 | target dir: ${prefix} | 341 | target dir: ${prefix} |
325 | messages: ${enable_messages} | 342 | messages: ${enable_messages} |
326 | HTTPS support: ${enable_HTTPS} | 343 | HTTPS support: ${enable_HTTPS} |
327 | TLS support: ${enable_TLS} | 344 | TLS support: ${enable_TLS} |
328 | SSLv3 support: ${enable_SSL} | 345 | SSLv3 support: ${enable_SSL} |
329 | OpenGPG support: ${enable_openpgp} | 346 | OpenGPG support: ${enable_openpgp} |
330 | x509 support: ${enable_x509} | 347 | x509 support: ${enable_x509} |
331 | libgcrypt: ${MSG_GCRYPT} | 348 | libgcrypt: ${MSG_GCRYPT} |
332 | 349 | ||
333 | # Testing | 350 | # Testing |
334 | libcurl: ${MSG_CURL} | 351 | libcurl: ${MSG_CURL} |
352 | client code dep.: ${MSG_CLIENT_SIDE} | ||
335 | ]) | 353 | ]) |
336 | 354 | ||
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 9b31f115..2a26b5f5 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -109,12 +109,12 @@ MHD_init_daemon_certificate (struct MHD_Daemon *daemon) | |||
109 | #if HAVE_MESSAGES | 109 | #if HAVE_MESSAGES |
110 | MHD_DLOG (daemon, "Failed to load certificate\n"); | 110 | MHD_DLOG (daemon, "Failed to load certificate\n"); |
111 | #endif | 111 | #endif |
112 | return MHD_NO; | 112 | return -1; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | /* initialize security aspects of the HTTPS daemon */ | 116 | /* initialize security aspects of the HTTPS daemon */ |
117 | int | 117 | static int |
118 | MHD_TLS_init (struct MHD_Daemon *daemon) | 118 | MHD_TLS_init (struct MHD_Daemon *daemon) |
119 | { | 119 | { |
120 | int ret; | 120 | int ret; |
@@ -129,24 +129,21 @@ MHD_TLS_init (struct MHD_Daemon *daemon) | |||
129 | } | 129 | } |
130 | MHD_gnutls_dh_params_generate2 (daemon->dh_params, 1024); | 130 | MHD_gnutls_dh_params_generate2 (daemon->dh_params, 1024); |
131 | MHD_gnutls_anon_set_server_dh_params (daemon->anon_cred, daemon->dh_params); | 131 | MHD_gnutls_anon_set_server_dh_params (daemon->anon_cred, daemon->dh_params); |
132 | break; | 132 | return 0; |
133 | case MHD_GNUTLS_CRD_CERTIFICATE: | 133 | case MHD_GNUTLS_CRD_CERTIFICATE: |
134 | ret = MHD_gnutls_certificate_allocate_credentials (&daemon->x509_cred) ; | 134 | ret = MHD_gnutls_certificate_allocate_credentials (&daemon->x509_cred) ; |
135 | if (ret != 0) { | 135 | if (ret != 0) { |
136 | return GNUTLS_E_MEMORY_ERROR; | 136 | return GNUTLS_E_MEMORY_ERROR; |
137 | } | 137 | } |
138 | if ((ret = MHD_init_daemon_certificate (daemon)) != 0) | 138 | return MHD_init_daemon_certificate (daemon); |
139 | return ret; | ||
140 | default: | 139 | default: |
141 | #if HAVE_MESSAGES | 140 | #if HAVE_MESSAGES |
142 | MHD_DLOG (daemon, | 141 | MHD_DLOG (daemon, |
143 | "Error: no daemon credentials type found. f: %s, l: %d\n", | 142 | "Error: no daemon credentials type found. f: %s, l: %d\n", |
144 | __FUNCTION__, __LINE__); | 143 | __FUNCTION__, __LINE__); |
145 | #endif | 144 | #endif |
146 | break; | 145 | return -1; |
147 | } | 146 | } |
148 | |||
149 | return MHD_NO; | ||
150 | } | 147 | } |
151 | 148 | ||
152 | inline static int | 149 | inline static int |
@@ -1028,7 +1025,7 @@ MHD_start_daemon_va (unsigned int options, | |||
1028 | 1025 | ||
1029 | #if HTTPS_SUPPORT | 1026 | #if HTTPS_SUPPORT |
1030 | /* initialize HTTPS daemon certificate aspects & send / recv functions */ | 1027 | /* initialize HTTPS daemon certificate aspects & send / recv functions */ |
1031 | if (options & MHD_USE_SSL && MHD_TLS_init (retVal) != 0) | 1028 | if ((options & MHD_USE_SSL) && MHD_TLS_init (retVal)) |
1032 | { | 1029 | { |
1033 | #if HAVE_MESSAGES | 1030 | #if HAVE_MESSAGES |
1034 | MHD_DLOG (retVal, "Failed to initialize HTTPS daemon\n"); | 1031 | MHD_DLOG (retVal, "Failed to initialize HTTPS daemon\n"); |
diff --git a/src/daemon/https/openpgp/gnutls_ia.c b/src/daemon/https/openpgp/gnutls_ia.c index b0751e85..ed810052 100644 --- a/src/daemon/https/openpgp/gnutls_ia.c +++ b/src/daemon/https/openpgp/gnutls_ia.c | |||
@@ -9,12 +9,12 @@ | |||
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation, either version 3 of the License, or | 10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
12 | * | 12 | * |
13 | * GNUTLS-EXTRA is distributed in the hope that it will be useful, | 13 | * GNUTLS-EXTRA is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | */ | 20 | */ |
@@ -448,10 +448,6 @@ gnutls_ia_recv (mhd_gtls_session_t session, char *data, size_t sizeofdata) | |||
448 | return len; | 448 | return len; |
449 | } | 449 | } |
450 | 450 | ||
451 | /* XXX rewrite the following two functions as state machines, to | ||
452 | handle EAGAIN/EINTERRUPTED? just add more problems to callers, | ||
453 | though. */ | ||
454 | |||
455 | int | 451 | int |
456 | _gnutls_ia_client_handshake (mhd_gtls_session_t session) | 452 | _gnutls_ia_client_handshake (mhd_gtls_session_t session) |
457 | { | 453 | { |
@@ -617,7 +613,7 @@ gnutls_ia_handshake_p (mhd_gtls_session_t session) | |||
617 | if (!ext->gnutls_ia_allowskip || !MHD_gtls_session_is_resumed (session)) | 613 | if (!ext->gnutls_ia_allowskip || !MHD_gtls_session_is_resumed (session)) |
618 | return 1; | 614 | return 1; |
619 | 615 | ||
620 | /* If we're resuming and we and the peer both allow skipping on resumption: | 616 | /* If we're resuming and we and the peer both allow skipping on resumption: |
621 | * don't do IA */ | 617 | * don't do IA */ |
622 | 618 | ||
623 | return !ext->gnutls_ia_peer_allowskip; | 619 | return !ext->gnutls_ia_peer_allowskip; |
diff --git a/src/daemon/https/tls/auth_anon.c b/src/daemon/https/tls/auth_anon.c index ae6346c3..9f1373dc 100644 --- a/src/daemon/https/tls/auth_anon.c +++ b/src/daemon/https/tls/auth_anon.c | |||
@@ -40,15 +40,15 @@ | |||
40 | #include <gnutls_state.h> | 40 | #include <gnutls_state.h> |
41 | #include <auth_dh_common.h> | 41 | #include <auth_dh_common.h> |
42 | 42 | ||
43 | static int gen_anon_server_kx (mhd_gtls_session_t, opaque **); | 43 | static int mhd_gtls_gen_anon_server_kx (mhd_gtls_session_t, opaque **); |
44 | static int proc_anon_client_kx (mhd_gtls_session_t, opaque *, size_t); | 44 | static int mhd_gtls_proc_anon_client_kx (mhd_gtls_session_t, opaque *, size_t); |
45 | static int mhd_gtls_proc_anon_server_kx (mhd_gtls_session_t, opaque *, size_t); | 45 | static int mhd_gtls_proc_anon_server_kx (mhd_gtls_session_t, opaque *, size_t); |
46 | 46 | ||
47 | const mhd_gtls_mod_auth_st anon_auth_struct = { | 47 | const mhd_gtls_mod_auth_st mhd_gtls_anon_auth_struct = { |
48 | "ANON", | 48 | "ANON", |
49 | NULL, | 49 | NULL, |
50 | NULL, | 50 | NULL, |
51 | gen_anon_server_kx, | 51 | mhd_gtls_gen_anon_server_kx, |
52 | mhd_gtls_gen_dh_common_client_kx, /* this can be shared */ | 52 | mhd_gtls_gen_dh_common_client_kx, /* this can be shared */ |
53 | NULL, | 53 | NULL, |
54 | NULL, | 54 | NULL, |
@@ -56,13 +56,13 @@ const mhd_gtls_mod_auth_st anon_auth_struct = { | |||
56 | NULL, | 56 | NULL, |
57 | NULL, /* certificate */ | 57 | NULL, /* certificate */ |
58 | mhd_gtls_proc_anon_server_kx, | 58 | mhd_gtls_proc_anon_server_kx, |
59 | proc_anon_client_kx, | 59 | mhd_gtls_proc_anon_client_kx, |
60 | NULL, | 60 | NULL, |
61 | NULL | 61 | NULL |
62 | }; | 62 | }; |
63 | 63 | ||
64 | static int | 64 | static int |
65 | gen_anon_server_kx (mhd_gtls_session_t session, opaque ** data) | 65 | mhd_gtls_gen_anon_server_kx (mhd_gtls_session_t session, opaque ** data) |
66 | { | 66 | { |
67 | mpi_t g, p; | 67 | mpi_t g, p; |
68 | const mpi_t *mpis; | 68 | const mpi_t *mpis; |
@@ -111,7 +111,7 @@ gen_anon_server_kx (mhd_gtls_session_t session, opaque ** data) | |||
111 | 111 | ||
112 | 112 | ||
113 | static int | 113 | static int |
114 | proc_anon_client_kx (mhd_gtls_session_t session, opaque * data, | 114 | mhd_gtls_proc_anon_client_kx (mhd_gtls_session_t session, opaque * data, |
115 | size_t _data_size) | 115 | size_t _data_size) |
116 | { | 116 | { |
117 | mhd_gtls_anon_server_credentials_t cred; | 117 | mhd_gtls_anon_server_credentials_t cred; |
diff --git a/src/daemon/https/tls/auth_anon.h b/src/daemon/https/tls/auth_anon.h index 631dd595..bdb0c1e4 100644 --- a/src/daemon/https/tls/auth_anon.h +++ b/src/daemon/https/tls/auth_anon.h | |||
@@ -42,7 +42,7 @@ typedef struct mhd_gtls_anon_client_credentials_st | |||
42 | 42 | ||
43 | typedef struct mhd_gtls_anon_auth_info_st | 43 | typedef struct mhd_gtls_anon_auth_info_st |
44 | { | 44 | { |
45 | dh_info_st dh; | 45 | mhd_gtls_dh_info_st dh; |
46 | } * mhd_anon_auth_info_t; | 46 | } * mhd_anon_auth_info_t; |
47 | 47 | ||
48 | typedef struct mhd_gtls_anon_auth_info_st anon_auth_info_st; | 48 | typedef struct mhd_gtls_anon_auth_info_st anon_auth_info_st; |
diff --git a/src/daemon/https/tls/auth_cert.c b/src/daemon/https/tls/auth_cert.c index 7fea2569..308c3878 100644 --- a/src/daemon/https/tls/auth_cert.c +++ b/src/daemon/https/tls/auth_cert.c | |||
@@ -147,7 +147,7 @@ _gnutls_cert_get_issuer_dn (gnutls_cert * cert, gnutls_datum_t * odn) | |||
147 | (_gnutls_get_pkix (), "PKIX1.Certificate", &dn)) != ASN1_SUCCESS) | 147 | (_gnutls_get_pkix (), "PKIX1.Certificate", &dn)) != ASN1_SUCCESS) |
148 | { | 148 | { |
149 | gnutls_assert (); | 149 | gnutls_assert (); |
150 | return _gnutls_asn2err (result); | 150 | return mhd_gtls_asn2err (result); |
151 | } | 151 | } |
152 | 152 | ||
153 | result = asn1_der_decoding (&dn, cert->raw.data, cert->raw.size, NULL); | 153 | result = asn1_der_decoding (&dn, cert->raw.data, cert->raw.size, NULL); |
@@ -156,7 +156,7 @@ _gnutls_cert_get_issuer_dn (gnutls_cert * cert, gnutls_datum_t * odn) | |||
156 | /* couldn't decode DER */ | 156 | /* couldn't decode DER */ |
157 | gnutls_assert (); | 157 | gnutls_assert (); |
158 | asn1_delete_structure (&dn); | 158 | asn1_delete_structure (&dn); |
159 | return _gnutls_asn2err (result); | 159 | return mhd_gtls_asn2err (result); |
160 | } | 160 | } |
161 | 161 | ||
162 | result = asn1_der_decoding_startEnd (dn, cert->raw.data, cert->raw.size, | 162 | result = asn1_der_decoding_startEnd (dn, cert->raw.data, cert->raw.size, |
@@ -167,7 +167,7 @@ _gnutls_cert_get_issuer_dn (gnutls_cert * cert, gnutls_datum_t * odn) | |||
167 | /* couldn't decode DER */ | 167 | /* couldn't decode DER */ |
168 | gnutls_assert (); | 168 | gnutls_assert (); |
169 | asn1_delete_structure (&dn); | 169 | asn1_delete_structure (&dn); |
170 | return _gnutls_asn2err (result); | 170 | return mhd_gtls_asn2err (result); |
171 | } | 171 | } |
172 | asn1_delete_structure (&dn); | 172 | asn1_delete_structure (&dn); |
173 | 173 | ||
@@ -613,7 +613,7 @@ cleanup: | |||
613 | */ | 613 | */ |
614 | 614 | ||
615 | int | 615 | int |
616 | _gnutls_gen_x509_crt (mhd_gtls_session_t session, opaque ** data) | 616 | mhd_gtls_gen_x509_crt (mhd_gtls_session_t session, opaque ** data) |
617 | { | 617 | { |
618 | int ret, i; | 618 | int ret, i; |
619 | opaque *pdata; | 619 | opaque *pdata; |
@@ -671,7 +671,7 @@ enum PGPKeyDescriptorType | |||
671 | { PGP_KEY_FINGERPRINT, PGP_KEY }; | 671 | { PGP_KEY_FINGERPRINT, PGP_KEY }; |
672 | 672 | ||
673 | int | 673 | int |
674 | _gnutls_gen_openpgp_certificate (mhd_gtls_session_t session, opaque ** data) | 674 | mhd_gtls_gen_openpgp_certificate (mhd_gtls_session_t session, opaque ** data) |
675 | { | 675 | { |
676 | int ret; | 676 | int ret; |
677 | opaque *pdata; | 677 | opaque *pdata; |
@@ -720,7 +720,7 @@ _gnutls_gen_openpgp_certificate (mhd_gtls_session_t session, opaque ** data) | |||
720 | } | 720 | } |
721 | 721 | ||
722 | int | 722 | int |
723 | _gnutls_gen_openpgp_certificate_fpr (mhd_gtls_session_t session, opaque ** data) | 723 | mhd_gtls_gen_openpgp_certificate_fpr (mhd_gtls_session_t session, opaque ** data) |
724 | { | 724 | { |
725 | int ret, packet_size; | 725 | int ret, packet_size; |
726 | size_t fpr_size; | 726 | size_t fpr_size; |
@@ -745,7 +745,7 @@ _gnutls_gen_openpgp_certificate_fpr (mhd_gtls_session_t session, opaque ** data) | |||
745 | if (apr_cert_list_length > 0 && apr_cert_list[0].version == 4) | 745 | if (apr_cert_list_length > 0 && apr_cert_list[0].version == 4) |
746 | packet_size += 20 + 1; | 746 | packet_size += 20 + 1; |
747 | else /* empty certificate case */ | 747 | else /* empty certificate case */ |
748 | return _gnutls_gen_openpgp_certificate (session, data); | 748 | return mhd_gtls_gen_openpgp_certificate (session, data); |
749 | 749 | ||
750 | (*data) = gnutls_malloc (packet_size); | 750 | (*data) = gnutls_malloc (packet_size); |
751 | pdata = (*data); | 751 | pdata = (*data); |
@@ -793,12 +793,12 @@ mhd_gtls_gen_cert_client_certificate (mhd_gtls_session_t session, opaque ** data | |||
793 | { | 793 | { |
794 | case MHD_GNUTLS_CRT_OPENPGP: | 794 | case MHD_GNUTLS_CRT_OPENPGP: |
795 | if (mhd_gtls_openpgp_send_fingerprint (session) == 0) | 795 | if (mhd_gtls_openpgp_send_fingerprint (session) == 0) |
796 | return _gnutls_gen_openpgp_certificate (session, data); | 796 | return mhd_gtls_gen_openpgp_certificate (session, data); |
797 | else | 797 | else |
798 | return _gnutls_gen_openpgp_certificate_fpr (session, data); | 798 | return mhd_gtls_gen_openpgp_certificate_fpr (session, data); |
799 | 799 | ||
800 | case MHD_GNUTLS_CRT_X509: | 800 | case MHD_GNUTLS_CRT_X509: |
801 | return _gnutls_gen_x509_crt (session, data); | 801 | return mhd_gtls_gen_x509_crt (session, data); |
802 | 802 | ||
803 | default: | 803 | default: |
804 | gnutls_assert (); | 804 | gnutls_assert (); |
@@ -812,9 +812,9 @@ mhd_gtls_gen_cert_server_certificate (mhd_gtls_session_t session, opaque ** data | |||
812 | switch (session->security_parameters.cert_type) | 812 | switch (session->security_parameters.cert_type) |
813 | { | 813 | { |
814 | case MHD_GNUTLS_CRT_OPENPGP: | 814 | case MHD_GNUTLS_CRT_OPENPGP: |
815 | return _gnutls_gen_openpgp_certificate (session, data); | 815 | return mhd_gtls_gen_openpgp_certificate (session, data); |
816 | case MHD_GNUTLS_CRT_X509: | 816 | case MHD_GNUTLS_CRT_X509: |
817 | return _gnutls_gen_x509_crt (session, data); | 817 | return mhd_gtls_gen_x509_crt (session, data); |
818 | default: | 818 | default: |
819 | gnutls_assert (); | 819 | gnutls_assert (); |
820 | return GNUTLS_E_INTERNAL_ERROR; | 820 | return GNUTLS_E_INTERNAL_ERROR; |
@@ -826,7 +826,7 @@ mhd_gtls_gen_cert_server_certificate (mhd_gtls_session_t session, opaque ** data | |||
826 | 826 | ||
827 | #define CLEAR_CERTS for(x=0;x<peer_certificate_list_size;x++) mhd_gtls_gcert_deinit(&peer_certificate_list[x]) | 827 | #define CLEAR_CERTS for(x=0;x<peer_certificate_list_size;x++) mhd_gtls_gcert_deinit(&peer_certificate_list[x]) |
828 | int | 828 | int |
829 | _gnutls_proc_x509_server_certificate (mhd_gtls_session_t session, | 829 | mhd_gtls_proc_x509_server_certificate (mhd_gtls_session_t session, |
830 | opaque * data, size_t data_size) | 830 | opaque * data, size_t data_size) |
831 | { | 831 | { |
832 | int size, len, ret; | 832 | int size, len, ret; |
@@ -968,7 +968,7 @@ cleanup: | |||
968 | 968 | ||
969 | #define CLEAR_CERTS for(x=0;x<peer_certificate_list_size;x++) mhd_gtls_gcert_deinit(&peer_certificate_list[x]) | 969 | #define CLEAR_CERTS for(x=0;x<peer_certificate_list_size;x++) mhd_gtls_gcert_deinit(&peer_certificate_list[x]) |
970 | int | 970 | int |
971 | _gnutls_proc_openpgp_server_certificate (mhd_gtls_session_t session, | 971 | mhd_gtls_proc_openpgp_server_certificate (mhd_gtls_session_t session, |
972 | opaque * data, size_t data_size) | 972 | opaque * data, size_t data_size) |
973 | { | 973 | { |
974 | int size, ret, len; | 974 | int size, ret, len; |
@@ -1153,10 +1153,10 @@ mhd_gtls_proc_cert_server_certificate (mhd_gtls_session_t session, | |||
1153 | switch (session->security_parameters.cert_type) | 1153 | switch (session->security_parameters.cert_type) |
1154 | { | 1154 | { |
1155 | case MHD_GNUTLS_CRT_OPENPGP: | 1155 | case MHD_GNUTLS_CRT_OPENPGP: |
1156 | return _gnutls_proc_openpgp_server_certificate (session, | 1156 | return mhd_gtls_proc_openpgp_server_certificate (session, |
1157 | data, data_size); | 1157 | data, data_size); |
1158 | case MHD_GNUTLS_CRT_X509: | 1158 | case MHD_GNUTLS_CRT_X509: |
1159 | return _gnutls_proc_x509_server_certificate (session, data, data_size); | 1159 | return mhd_gtls_proc_x509_server_certificate (session, data, data_size); |
1160 | default: | 1160 | default: |
1161 | gnutls_assert (); | 1161 | gnutls_assert (); |
1162 | return GNUTLS_E_INTERNAL_ERROR; | 1162 | return GNUTLS_E_INTERNAL_ERROR; |
diff --git a/src/daemon/https/tls/auth_cert.h b/src/daemon/https/tls/auth_cert.h index 979a698a..aa529b7e 100644 --- a/src/daemon/https/tls/auth_cert.h +++ b/src/daemon/https/tls/auth_cert.h | |||
@@ -98,7 +98,7 @@ typedef struct mhd_gtls_certificate_credentials_st | |||
98 | 98 | ||
99 | gnutls_certificate_client_retrieve_function *client_get_cert_callback; | 99 | gnutls_certificate_client_retrieve_function *client_get_cert_callback; |
100 | gnutls_certificate_server_retrieve_function *server_get_cert_callback; | 100 | gnutls_certificate_server_retrieve_function *server_get_cert_callback; |
101 | } certificate_credentials_st; | 101 | } mhd_gtls_cert_credentials_st; |
102 | 102 | ||
103 | typedef struct mhd_gtls_rsa_info_st | 103 | typedef struct mhd_gtls_rsa_info_st |
104 | { | 104 | { |
@@ -115,14 +115,14 @@ typedef struct mhd_gtls_cert_auth_info_st | |||
115 | /* These (dh/rsa) are just copies from the credentials_t structure. | 115 | /* These (dh/rsa) are just copies from the credentials_t structure. |
116 | * They must be freed. | 116 | * They must be freed. |
117 | */ | 117 | */ |
118 | dh_info_st dh; | 118 | mhd_gtls_dh_info_st dh; |
119 | rsa_info_st rsa_export; | 119 | rsa_info_st rsa_export; |
120 | 120 | ||
121 | gnutls_datum_t *raw_certificate_list; /* holds the raw certificate of the | 121 | gnutls_datum_t *raw_certificate_list; /* holds the raw certificate of the |
122 | * peer. | 122 | * peer. |
123 | */ | 123 | */ |
124 | unsigned int ncerts; /* holds the size of the list above */ | 124 | unsigned int ncerts; /* holds the size of the list above */ |
125 | } *cert_auth_info_t; | 125 | } * cert_auth_info_t; |
126 | 126 | ||
127 | typedef struct mhd_gtls_cert_auth_info_st cert_auth_info_st; | 127 | typedef struct mhd_gtls_cert_auth_info_st cert_auth_info_st; |
128 | 128 | ||
diff --git a/src/daemon/https/tls/auth_dh_common.c b/src/daemon/https/tls/auth_dh_common.c index 13e7987b..85f4a187 100644 --- a/src/daemon/https/tls/auth_dh_common.c +++ b/src/daemon/https/tls/auth_dh_common.c | |||
@@ -39,10 +39,10 @@ | |||
39 | #include <auth_dh_common.h> | 39 | #include <auth_dh_common.h> |
40 | #include <gnutls_algorithms.h> | 40 | #include <gnutls_algorithms.h> |
41 | 41 | ||
42 | /* Frees the dh_info_st structure. | 42 | /* Frees the mhd_gtls_dh_info_st structure. |
43 | */ | 43 | */ |
44 | void | 44 | void |
45 | mhd_gtls_free_dh_info (dh_info_st * dh) | 45 | mhd_gtls_free_dh_info (mhd_gtls_dh_info_st * dh) |
46 | { | 46 | { |
47 | dh->secret_bits = 0; | 47 | dh->secret_bits = 0; |
48 | _gnutls_free_datum (&dh->prime); | 48 | _gnutls_free_datum (&dh->prime); |
diff --git a/src/daemon/https/tls/auth_dh_common.h b/src/daemon/https/tls/auth_dh_common.h index 9d2d994a..440ab5b4 100644 --- a/src/daemon/https/tls/auth_dh_common.h +++ b/src/daemon/https/tls/auth_dh_common.h | |||
@@ -32,9 +32,9 @@ typedef struct | |||
32 | gnutls_datum_t prime; | 32 | gnutls_datum_t prime; |
33 | gnutls_datum_t generator; | 33 | gnutls_datum_t generator; |
34 | gnutls_datum_t public_key; | 34 | gnutls_datum_t public_key; |
35 | } dh_info_st; | 35 | } mhd_gtls_dh_info_st; |
36 | 36 | ||
37 | void mhd_gtls_free_dh_info (dh_info_st * dh); | 37 | void mhd_gtls_free_dh_info (mhd_gtls_dh_info_st * dh); |
38 | int mhd_gtls_gen_dh_common_client_kx (mhd_gtls_session_t, opaque **); | 38 | int mhd_gtls_gen_dh_common_client_kx (mhd_gtls_session_t, opaque **); |
39 | int mhd_gtls_proc_dh_common_client_kx (mhd_gtls_session_t session, | 39 | int mhd_gtls_proc_dh_common_client_kx (mhd_gtls_session_t session, |
40 | opaque * data, size_t _data_size, | 40 | opaque * data, size_t _data_size, |
diff --git a/src/daemon/https/tls/auth_dhe.c b/src/daemon/https/tls/auth_dhe.c index ada5efe2..9cfdbb99 100644 --- a/src/daemon/https/tls/auth_dhe.c +++ b/src/daemon/https/tls/auth_dhe.c | |||
@@ -43,7 +43,7 @@ static int gen_dhe_server_kx (mhd_gtls_session_t, opaque **); | |||
43 | static int proc_dhe_server_kx (mhd_gtls_session_t, opaque *, size_t); | 43 | static int proc_dhe_server_kx (mhd_gtls_session_t, opaque *, size_t); |
44 | static int proc_dhe_client_kx (mhd_gtls_session_t, opaque *, size_t); | 44 | static int proc_dhe_client_kx (mhd_gtls_session_t, opaque *, size_t); |
45 | 45 | ||
46 | const mhd_gtls_mod_auth_st dhe_rsa_auth_struct = { | 46 | const mhd_gtls_mod_auth_st mhd_gtls_dhe_rsa_auth_struct = { |
47 | "DHE_RSA", | 47 | "DHE_RSA", |
48 | mhd_gtls_gen_cert_server_certificate, | 48 | mhd_gtls_gen_cert_server_certificate, |
49 | mhd_gtls_gen_cert_client_certificate, | 49 | mhd_gtls_gen_cert_client_certificate, |
@@ -60,7 +60,7 @@ const mhd_gtls_mod_auth_st dhe_rsa_auth_struct = { | |||
60 | mhd_gtls_proc_cert_cert_req /* proc server cert request */ | 60 | mhd_gtls_proc_cert_cert_req /* proc server cert request */ |
61 | }; | 61 | }; |
62 | 62 | ||
63 | const mhd_gtls_mod_auth_st dhe_dss_auth_struct = { | 63 | const mhd_gtls_mod_auth_st mhd_gtls_dhe_dss_auth_struct = { |
64 | "DHE_DSS", | 64 | "DHE_DSS", |
65 | mhd_gtls_gen_cert_server_certificate, | 65 | mhd_gtls_gen_cert_server_certificate, |
66 | mhd_gtls_gen_cert_client_certificate, | 66 | mhd_gtls_gen_cert_client_certificate, |
diff --git a/src/daemon/https/tls/auth_rsa.c b/src/daemon/https/tls/auth_rsa.c index 40d1913f..556d3df1 100644 --- a/src/daemon/https/tls/auth_rsa.c +++ b/src/daemon/https/tls/auth_rsa.c | |||
@@ -45,7 +45,7 @@ | |||
45 | int _gnutls_gen_rsa_client_kx (mhd_gtls_session_t, opaque **); | 45 | int _gnutls_gen_rsa_client_kx (mhd_gtls_session_t, opaque **); |
46 | int _gnutls_proc_rsa_client_kx (mhd_gtls_session_t, opaque *, size_t); | 46 | int _gnutls_proc_rsa_client_kx (mhd_gtls_session_t, opaque *, size_t); |
47 | 47 | ||
48 | const mhd_gtls_mod_auth_st rsa_auth_struct = { | 48 | const mhd_gtls_mod_auth_st mhd_gtls_rsa_auth_struct = { |
49 | "RSA", | 49 | "RSA", |
50 | mhd_gtls_gen_cert_server_certificate, | 50 | mhd_gtls_gen_cert_server_certificate, |
51 | mhd_gtls_gen_cert_client_certificate, | 51 | mhd_gtls_gen_cert_client_certificate, |
diff --git a/src/daemon/https/tls/ext_cert_type.c b/src/daemon/https/tls/ext_cert_type.c index fbbbab79..8d37abae 100644 --- a/src/daemon/https/tls/ext_cert_type.c +++ b/src/daemon/https/tls/ext_cert_type.c | |||
@@ -52,6 +52,7 @@ mhd_gtls_cert_type_recv_params (mhd_gtls_session_t session, | |||
52 | int new_type = -1, ret, i; | 52 | int new_type = -1, ret, i; |
53 | ssize_t data_size = _data_size; | 53 | ssize_t data_size = _data_size; |
54 | 54 | ||
55 | #if MHD_DEBUG_TLS | ||
55 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 56 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
56 | { | 57 | { |
57 | if (data_size > 0) | 58 | if (data_size > 0) |
@@ -82,6 +83,7 @@ mhd_gtls_cert_type_recv_params (mhd_gtls_session_t session, | |||
82 | } | 83 | } |
83 | } | 84 | } |
84 | else | 85 | else |
86 | #endif | ||
85 | { /* SERVER SIDE - we must check if the sent cert type is the right one | 87 | { /* SERVER SIDE - we must check if the sent cert type is the right one |
86 | */ | 88 | */ |
87 | if (data_size > 1) | 89 | if (data_size > 1) |
@@ -147,6 +149,7 @@ mhd_gtls_cert_type_send_params (mhd_gtls_session_t session, opaque * data, | |||
147 | unsigned len, i; | 149 | unsigned len, i; |
148 | 150 | ||
149 | /* this function sends the client extension data (dnsname) */ | 151 | /* this function sends the client extension data (dnsname) */ |
152 | #if MHD_DEBUG_TLS | ||
150 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 153 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
151 | { | 154 | { |
152 | 155 | ||
@@ -186,6 +189,7 @@ mhd_gtls_cert_type_send_params (mhd_gtls_session_t session, opaque * data, | |||
186 | 189 | ||
187 | } | 190 | } |
188 | else | 191 | else |
192 | #endif | ||
189 | { /* server side */ | 193 | { /* server side */ |
190 | if (session->security_parameters.cert_type != DEFAULT_CERT_TYPE) | 194 | if (session->security_parameters.cert_type != DEFAULT_CERT_TYPE) |
191 | { | 195 | { |
diff --git a/src/daemon/https/tls/ext_inner_application.c b/src/daemon/https/tls/ext_inner_application.c index a2276589..2652c289 100644 --- a/src/daemon/https/tls/ext_inner_application.c +++ b/src/daemon/https/tls/ext_inner_application.c | |||
@@ -73,7 +73,7 @@ mhd_gtls_inner_app_send_params (mhd_gtls_session_t session, | |||
73 | 73 | ||
74 | /* Set ext->gnutls_ia_enable depending on whether we have a TLS/IA | 74 | /* Set ext->gnutls_ia_enable depending on whether we have a TLS/IA |
75 | credential in the session. */ | 75 | credential in the session. */ |
76 | 76 | #if MHD_DEBUG_TLS | |
77 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 77 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
78 | { | 78 | { |
79 | gnutls_ia_client_credentials_t cred = (gnutls_ia_client_credentials_t) | 79 | gnutls_ia_client_credentials_t cred = (gnutls_ia_client_credentials_t) |
@@ -83,6 +83,7 @@ mhd_gtls_inner_app_send_params (mhd_gtls_session_t session, | |||
83 | ext->gnutls_ia_enable = 1; | 83 | ext->gnutls_ia_enable = 1; |
84 | } | 84 | } |
85 | else | 85 | else |
86 | #endif | ||
86 | { | 87 | { |
87 | gnutls_ia_server_credentials_t cred = (gnutls_ia_server_credentials_t) | 88 | gnutls_ia_server_credentials_t cred = (gnutls_ia_server_credentials_t) |
88 | mhd_gtls_get_cred (session->key, MHD_GNUTLS_CRD_IA, NULL); | 89 | mhd_gtls_get_cred (session->key, MHD_GNUTLS_CRD_IA, NULL); |
@@ -114,6 +115,7 @@ mhd_gtls_inner_app_send_params (mhd_gtls_session_t session, | |||
114 | 115 | ||
115 | *data = YES; | 116 | *data = YES; |
116 | 117 | ||
118 | #if MHD_DEBUG_TLS | ||
117 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 119 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
118 | { | 120 | { |
119 | 121 | ||
@@ -123,6 +125,7 @@ mhd_gtls_inner_app_send_params (mhd_gtls_session_t session, | |||
123 | *data = NO; | 125 | *data = NO; |
124 | } | 126 | } |
125 | else | 127 | else |
128 | #endif | ||
126 | { | 129 | { |
127 | 130 | ||
128 | /* Server: value follows local setting and client's setting, but only | 131 | /* Server: value follows local setting and client's setting, but only |
diff --git a/src/daemon/https/tls/ext_max_record.c b/src/daemon/https/tls/ext_max_record.c index 3f4ac68a..8c3de8f8 100644 --- a/src/daemon/https/tls/ext_max_record.c +++ b/src/daemon/https/tls/ext_max_record.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include "gnutls_num.h" | 30 | #include "gnutls_num.h" |
31 | #include <ext_max_record.h> | 31 | #include <ext_max_record.h> |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * In case of a server: if a MAX_RECORD_SIZE extension type is received then it stores | 34 | * In case of a server: if a MAX_RECORD_SIZE extension type is received then it stores |
35 | * into the session the new value. The server may use gnutls_get_max_record_size(), | 35 | * into the session the new value. The server may use gnutls_get_max_record_size(), |
36 | * in order to access it. | 36 | * in order to access it. |
@@ -66,7 +66,7 @@ mhd_gtls_max_record_recv_params (mhd_gtls_session_t session, | |||
66 | } | 66 | } |
67 | } | 67 | } |
68 | else | 68 | else |
69 | { /* CLIENT SIDE - we must check if the sent record size is the right one | 69 | { /* CLIENT SIDE - we must check if the sent record size is the right one |
70 | */ | 70 | */ |
71 | if (data_size > 0) | 71 | if (data_size > 0) |
72 | { | 72 | { |
@@ -107,6 +107,7 @@ mhd_gtls_max_record_send_params (mhd_gtls_session_t session, opaque * data, | |||
107 | { | 107 | { |
108 | uint16_t len; | 108 | uint16_t len; |
109 | /* this function sends the client extension data (dnsname) */ | 109 | /* this function sends the client extension data (dnsname) */ |
110 | #if MHD_DEBUG_TLS | ||
110 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 111 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
111 | { | 112 | { |
112 | 113 | ||
@@ -127,6 +128,7 @@ mhd_gtls_max_record_send_params (mhd_gtls_session_t session, opaque * data, | |||
127 | 128 | ||
128 | } | 129 | } |
129 | else | 130 | else |
131 | #endif | ||
130 | { /* server side */ | 132 | { /* server side */ |
131 | 133 | ||
132 | if (session->security_parameters.max_record_recv_size != | 134 | if (session->security_parameters.max_record_recv_size != |
diff --git a/src/daemon/https/tls/ext_oprfi.c b/src/daemon/https/tls/ext_oprfi.c index f8bd4953..67a5bcb2 100644 --- a/src/daemon/https/tls/ext_oprfi.c +++ b/src/daemon/https/tls/ext_oprfi.c | |||
@@ -114,9 +114,11 @@ int | |||
114 | mhd_gtls_oprfi_recv_params (mhd_gtls_session_t session, | 114 | mhd_gtls_oprfi_recv_params (mhd_gtls_session_t session, |
115 | const opaque * data, size_t data_size) | 115 | const opaque * data, size_t data_size) |
116 | { | 116 | { |
117 | #if MHD_DEBUG_TLS | ||
117 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 118 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
118 | return oprfi_recv_client (session, data, data_size); | 119 | return oprfi_recv_client (session, data, data_size); |
119 | else | 120 | else |
121 | #endif | ||
120 | return oprfi_recv_server (session, data, data_size); | 122 | return oprfi_recv_server (session, data, data_size); |
121 | } | 123 | } |
122 | 124 | ||
@@ -194,9 +196,6 @@ int | |||
194 | mhd_gtls_oprfi_send_params (mhd_gtls_session_t session, | 196 | mhd_gtls_oprfi_send_params (mhd_gtls_session_t session, |
195 | opaque * data, size_t data_size) | 197 | opaque * data, size_t data_size) |
196 | { | 198 | { |
197 | if (session->security_parameters.entity == GNUTLS_CLIENT) | ||
198 | return oprfi_send_client (session, data, data_size); | ||
199 | else | ||
200 | return oprfi_send_server (session, data, data_size); | 199 | return oprfi_send_server (session, data, data_size); |
201 | } | 200 | } |
202 | 201 | ||
diff --git a/src/daemon/https/tls/ext_server_name.c b/src/daemon/https/tls/ext_server_name.c index 9dc1f3bb..e0816259 100644 --- a/src/daemon/https/tls/ext_server_name.c +++ b/src/daemon/https/tls/ext_server_name.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "gnutls_num.h" | 28 | #include "gnutls_num.h" |
29 | #include <ext_server_name.h> | 29 | #include <ext_server_name.h> |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * In case of a server: if a NAME_DNS extension type is received then it stores | 32 | * In case of a server: if a NAME_DNS extension type is received then it stores |
33 | * into the session the value of NAME_DNS. The server may use gnutls_ext_get_server_name(), | 33 | * into the session the value of NAME_DNS. The server may use gnutls_ext_get_server_name(), |
34 | * in order to access it. | 34 | * in order to access it. |
@@ -133,34 +133,34 @@ mhd_gtls_server_name_send_params (mhd_gtls_session_t session, | |||
133 | ssize_t data_size = _data_size; | 133 | ssize_t data_size = _data_size; |
134 | int total_size = 0; | 134 | int total_size = 0; |
135 | 135 | ||
136 | /* this function sends the client extension data (dnsname) | 136 | /* this function sends the client extension data (dnsname) */ |
137 | */ | 137 | #if MHD_DEBUG_TLS |
138 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 138 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
139 | { | 139 | { |
140 | 140 | ||
141 | if (session->security_parameters.extensions.server_names_size == 0) | 141 | if (session->security_parameters.extensions.server_names_size == 0) |
142 | return 0; | 142 | return 0; |
143 | 143 | ||
144 | /* uint16_t | 144 | /* uint16_t |
145 | */ | 145 | */ |
146 | total_size = 2; | 146 | total_size = 2; |
147 | for (i = 0; | 147 | for (i = 0; |
148 | i < session->security_parameters.extensions.server_names_size; i++) | 148 | i < session->security_parameters.extensions.server_names_size; i++) |
149 | { | 149 | { |
150 | /* count the total size | 150 | /* count the total size |
151 | */ | 151 | */ |
152 | len = | 152 | len = |
153 | session->security_parameters.extensions.server_names[i]. | 153 | session->security_parameters.extensions.server_names[i]. |
154 | name_length; | 154 | name_length; |
155 | 155 | ||
156 | /* uint8_t + uint16_t + size | 156 | /* uint8_t + uint16_t + size |
157 | */ | 157 | */ |
158 | total_size += 1 + 2 + len; | 158 | total_size += 1 + 2 + len; |
159 | } | 159 | } |
160 | 160 | ||
161 | p = data; | 161 | p = data; |
162 | 162 | ||
163 | /* UINT16: write total size of all names | 163 | /* UINT16: write total size of all names |
164 | */ | 164 | */ |
165 | DECR_LENGTH_RET (data_size, 2, GNUTLS_E_SHORT_MEMORY_BUFFER); | 165 | DECR_LENGTH_RET (data_size, 2, GNUTLS_E_SHORT_MEMORY_BUFFER); |
166 | mhd_gtls_write_uint16 (total_size - 2, p); | 166 | mhd_gtls_write_uint16 (total_size - 2, p); |
@@ -205,7 +205,7 @@ mhd_gtls_server_name_send_params (mhd_gtls_session_t session, | |||
205 | } | 205 | } |
206 | } | 206 | } |
207 | } | 207 | } |
208 | 208 | #endif | |
209 | return total_size; | 209 | return total_size; |
210 | } | 210 | } |
211 | 211 | ||
@@ -238,13 +238,13 @@ MHD_gnutls_server_name_get (mhd_gtls_session_t session, void *data, | |||
238 | unsigned int *type, unsigned int indx) | 238 | unsigned int *type, unsigned int indx) |
239 | { | 239 | { |
240 | char *_data = data; | 240 | char *_data = data; |
241 | 241 | #if MHD_DEBUG_TLS | |
242 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 242 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
243 | { | 243 | { |
244 | gnutls_assert (); | 244 | gnutls_assert (); |
245 | return GNUTLS_E_INVALID_REQUEST; | 245 | return GNUTLS_E_INVALID_REQUEST; |
246 | } | 246 | } |
247 | 247 | #endif | |
248 | if (indx + 1 > session->security_parameters.extensions.server_names_size) | 248 | if (indx + 1 > session->security_parameters.extensions.server_names_size) |
249 | { | 249 | { |
250 | return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; | 250 | return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; |
@@ -284,13 +284,13 @@ MHD_gnutls_server_name_get (mhd_gtls_session_t session, void *data, | |||
284 | * @name: is a string that contains the server name. | 284 | * @name: is a string that contains the server name. |
285 | * @name_length: holds the length of name | 285 | * @name_length: holds the length of name |
286 | * | 286 | * |
287 | * This function is to be used by clients that want to inform | 287 | * This function is to be used by clients that want to inform |
288 | * (via a TLS extension mechanism) the server of the name they | 288 | * (via a TLS extension mechanism) the server of the name they |
289 | * connected to. This should be used by clients that connect | 289 | * connected to. This should be used by clients that connect |
290 | * to servers that do virtual hosting. | 290 | * to servers that do virtual hosting. |
291 | * | 291 | * |
292 | * The value of @name depends on the @ind type. In case of GNUTLS_NAME_DNS, | 292 | * The value of @name depends on the @ind type. In case of GNUTLS_NAME_DNS, |
293 | * an ASCII or UTF-8 null terminated string, without the trailing dot, is expected. | 293 | * an ASCII or UTF-8 null terminated string, without the trailing dot, is expected. |
294 | * IPv4 or IPv6 addresses are not permitted. | 294 | * IPv4 or IPv6 addresses are not permitted. |
295 | * | 295 | * |
296 | **/ | 296 | **/ |
diff --git a/src/daemon/https/tls/gnutls_alert.c b/src/daemon/https/tls/gnutls_alert.c index 3a97365f..cbea7b09 100644 --- a/src/daemon/https/tls/gnutls_alert.c +++ b/src/daemon/https/tls/gnutls_alert.c | |||
@@ -33,7 +33,7 @@ typedef struct | |||
33 | const char *desc; | 33 | const char *desc; |
34 | } gnutls_alert_entry; | 34 | } gnutls_alert_entry; |
35 | 35 | ||
36 | static const gnutls_alert_entry sup_alerts[] = { | 36 | static const gnutls_alert_entry mhd_gtls_sup_alerts[] = { |
37 | {GNUTLS_A_CLOSE_NOTIFY, "Close notify"}, | 37 | {GNUTLS_A_CLOSE_NOTIFY, "Close notify"}, |
38 | {GNUTLS_A_UNEXPECTED_MESSAGE, "Unexpected message"}, | 38 | {GNUTLS_A_UNEXPECTED_MESSAGE, "Unexpected message"}, |
39 | {GNUTLS_A_BAD_RECORD_MAC, "Bad record MAC"}, | 39 | {GNUTLS_A_BAD_RECORD_MAC, "Bad record MAC"}, |
@@ -73,7 +73,7 @@ static const gnutls_alert_entry sup_alerts[] = { | |||
73 | 73 | ||
74 | #define GNUTLS_ALERT_LOOP(b) \ | 74 | #define GNUTLS_ALERT_LOOP(b) \ |
75 | const gnutls_alert_entry *p; \ | 75 | const gnutls_alert_entry *p; \ |
76 | for(p = sup_alerts; p->desc != NULL; p++) { b ; } | 76 | for(p = mhd_gtls_sup_alerts; p->desc != NULL; p++) { b ; } |
77 | 77 | ||
78 | #define GNUTLS_ALERT_ID_LOOP(a) \ | 78 | #define GNUTLS_ALERT_ID_LOOP(a) \ |
79 | GNUTLS_ALERT_LOOP( if(p->alert == alert) { a; break; }) | 79 | GNUTLS_ALERT_LOOP( if(p->alert == alert) { a; break; }) |
diff --git a/src/daemon/https/tls/gnutls_algorithms.c b/src/daemon/https/tls/gnutls_algorithms.c index 6f7fd8ce..5f0eb4cb 100644 --- a/src/daemon/https/tls/gnutls_algorithms.c +++ b/src/daemon/https/tls/gnutls_algorithms.c | |||
@@ -41,7 +41,7 @@ typedef struct | |||
41 | * needs to set */ | 41 | * needs to set */ |
42 | } gnutls_cred_map; | 42 | } gnutls_cred_map; |
43 | 43 | ||
44 | static const gnutls_cred_map cred_mappings[] = { | 44 | static const gnutls_cred_map mhd_gtls_cred_mappings[] = { |
45 | {MHD_GNUTLS_KX_ANON_DH, | 45 | {MHD_GNUTLS_KX_ANON_DH, |
46 | MHD_GNUTLS_CRD_ANON, | 46 | MHD_GNUTLS_CRD_ANON, |
47 | MHD_GNUTLS_CRD_ANON}, | 47 | MHD_GNUTLS_CRD_ANON}, |
@@ -73,7 +73,7 @@ static const gnutls_cred_map cred_mappings[] = { | |||
73 | 73 | ||
74 | #define GNUTLS_KX_MAP_LOOP(b) \ | 74 | #define GNUTLS_KX_MAP_LOOP(b) \ |
75 | const gnutls_cred_map *p; \ | 75 | const gnutls_cred_map *p; \ |
76 | for(p = cred_mappings; p->algorithm != 0; p++) { b ; } | 76 | for(p = mhd_gtls_cred_mappings; p->algorithm != 0; p++) { b ; } |
77 | 77 | ||
78 | #define GNUTLS_KX_MAP_ALG_LOOP_SERVER(a) \ | 78 | #define GNUTLS_KX_MAP_ALG_LOOP_SERVER(a) \ |
79 | GNUTLS_KX_MAP_LOOP( if(p->server_type == type) { a; break; }) | 79 | GNUTLS_KX_MAP_LOOP( if(p->server_type == type) { a; break; }) |
@@ -100,7 +100,7 @@ typedef struct | |||
100 | * RSA algorithm in the certificate then we can | 100 | * RSA algorithm in the certificate then we can |
101 | * use GNUTLS_KX_RSA or GNUTLS_KX_DHE_RSA. | 101 | * use GNUTLS_KX_RSA or GNUTLS_KX_DHE_RSA. |
102 | */ | 102 | */ |
103 | static const gnutls_pk_map pk_mappings[] = { | 103 | static const gnutls_pk_map mhd_gtls_pk_mappings[] = { |
104 | {MHD_GNUTLS_KX_RSA, | 104 | {MHD_GNUTLS_KX_RSA, |
105 | MHD_GNUTLS_PK_RSA, | 105 | MHD_GNUTLS_PK_RSA, |
106 | CIPHER_ENCRYPT}, | 106 | CIPHER_ENCRYPT}, |
@@ -120,7 +120,7 @@ static const gnutls_pk_map pk_mappings[] = { | |||
120 | 120 | ||
121 | #define GNUTLS_PK_MAP_LOOP(b) \ | 121 | #define GNUTLS_PK_MAP_LOOP(b) \ |
122 | const gnutls_pk_map *p; \ | 122 | const gnutls_pk_map *p; \ |
123 | for(p = pk_mappings; p->kx_algorithm != 0; p++) { b } | 123 | for(p = mhd_gtls_pk_mappings; p->kx_algorithm != 0; p++) { b } |
124 | 124 | ||
125 | #define GNUTLS_PK_MAP_ALG_LOOP(a) \ | 125 | #define GNUTLS_PK_MAP_ALG_LOOP(a) \ |
126 | GNUTLS_PK_MAP_LOOP( if(p->kx_algorithm == kx_algorithm) { a; break; }) | 126 | GNUTLS_PK_MAP_LOOP( if(p->kx_algorithm == kx_algorithm) { a; break; }) |
@@ -136,7 +136,7 @@ typedef struct | |||
136 | int supported; /* 0 not supported, > 0 is supported */ | 136 | int supported; /* 0 not supported, > 0 is supported */ |
137 | } gnutls_version_entry; | 137 | } gnutls_version_entry; |
138 | 138 | ||
139 | static const gnutls_version_entry sup_versions[] = { | 139 | static const gnutls_version_entry mhd_gtls_sup_versions[] = { |
140 | {"SSL3.0", | 140 | {"SSL3.0", |
141 | MHD_GNUTLS_SSL3, | 141 | MHD_GNUTLS_SSL3, |
142 | 3, | 142 | 3, |
@@ -165,7 +165,7 @@ static const gnutls_version_entry sup_versions[] = { | |||
165 | }; | 165 | }; |
166 | 166 | ||
167 | /* Keep the contents of this struct the same as the previous one. */ | 167 | /* Keep the contents of this struct the same as the previous one. */ |
168 | static const gnutls_protocol_t supported_protocols[] = { MHD_GNUTLS_SSL3, | 168 | static const gnutls_protocol_t mhd_gtls_supported_protocols[] = { MHD_GNUTLS_SSL3, |
169 | MHD_GNUTLS_TLS1_0, | 169 | MHD_GNUTLS_TLS1_0, |
170 | MHD_GNUTLS_TLS1_1, | 170 | MHD_GNUTLS_TLS1_1, |
171 | MHD_GNUTLS_TLS1_2, | 171 | MHD_GNUTLS_TLS1_2, |
@@ -174,7 +174,7 @@ static const gnutls_protocol_t supported_protocols[] = { MHD_GNUTLS_SSL3, | |||
174 | 174 | ||
175 | #define GNUTLS_VERSION_LOOP(b) \ | 175 | #define GNUTLS_VERSION_LOOP(b) \ |
176 | const gnutls_version_entry *p; \ | 176 | const gnutls_version_entry *p; \ |
177 | for(p = sup_versions; p->name != NULL; p++) { b ; } | 177 | for(p = mhd_gtls_sup_versions; p->name != NULL; p++) { b ; } |
178 | 178 | ||
179 | #define GNUTLS_VERSION_ALG_LOOP(a) \ | 179 | #define GNUTLS_VERSION_ALG_LOOP(a) \ |
180 | GNUTLS_VERSION_LOOP( if(p->id == version) { a; break; }) | 180 | GNUTLS_VERSION_LOOP( if(p->id == version) { a; break; }) |
@@ -196,7 +196,7 @@ typedef struct gnutls_cipher_entry gnutls_cipher_entry; | |||
196 | * View first: "The order of encryption and authentication for | 196 | * View first: "The order of encryption and authentication for |
197 | * protecting communications" by Hugo Krawczyk - CRYPTO 2001 | 197 | * protecting communications" by Hugo Krawczyk - CRYPTO 2001 |
198 | */ | 198 | */ |
199 | static const gnutls_cipher_entry algorithms[] = { | 199 | static const gnutls_cipher_entry mhd_gtls_algorithms[] = { |
200 | {"AES-256-CBC", | 200 | {"AES-256-CBC", |
201 | MHD_GNUTLS_CIPHER_AES_256_CBC, | 201 | MHD_GNUTLS_CIPHER_AES_256_CBC, |
202 | 16, | 202 | 16, |
@@ -271,7 +271,7 @@ static const gnutls_cipher_entry algorithms[] = { | |||
271 | }; | 271 | }; |
272 | 272 | ||
273 | /* Keep the contents of this struct the same as the previous one. */ | 273 | /* Keep the contents of this struct the same as the previous one. */ |
274 | static const gnutls_cipher_algorithm_t supported_ciphers[] = | 274 | static const gnutls_cipher_algorithm_t mhd_gtls_supported_ciphers[] = |
275 | { MHD_GNUTLS_CIPHER_AES_256_CBC, | 275 | { MHD_GNUTLS_CIPHER_AES_256_CBC, |
276 | MHD_GNUTLS_CIPHER_AES_128_CBC, | 276 | MHD_GNUTLS_CIPHER_AES_128_CBC, |
277 | MHD_GNUTLS_CIPHER_3DES_CBC, | 277 | MHD_GNUTLS_CIPHER_3DES_CBC, |
@@ -289,7 +289,7 @@ static const gnutls_cipher_algorithm_t supported_ciphers[] = | |||
289 | 289 | ||
290 | #define GNUTLS_LOOP(b) \ | 290 | #define GNUTLS_LOOP(b) \ |
291 | const gnutls_cipher_entry *p; \ | 291 | const gnutls_cipher_entry *p; \ |
292 | for(p = algorithms; p->name != NULL; p++) { b ; } | 292 | for(p = mhd_gtls_algorithms; p->name != NULL; p++) { b ; } |
293 | 293 | ||
294 | #define GNUTLS_ALG_LOOP(a) \ | 294 | #define GNUTLS_ALG_LOOP(a) \ |
295 | GNUTLS_LOOP( if(p->id == algorithm) { a; break; } ) | 295 | GNUTLS_LOOP( if(p->id == algorithm) { a; break; } ) |
@@ -303,7 +303,7 @@ struct gnutls_hash_entry | |||
303 | }; | 303 | }; |
304 | typedef struct gnutls_hash_entry gnutls_hash_entry; | 304 | typedef struct gnutls_hash_entry gnutls_hash_entry; |
305 | 305 | ||
306 | static const gnutls_hash_entry hash_algorithms[] = { | 306 | static const gnutls_hash_entry mhd_gtls_hash_algorithms[] = { |
307 | {"SHA1", | 307 | {"SHA1", |
308 | HASH_OID_SHA1, | 308 | HASH_OID_SHA1, |
309 | MHD_GNUTLS_MAC_SHA1, | 309 | MHD_GNUTLS_MAC_SHA1, |
@@ -327,7 +327,7 @@ static const gnutls_hash_entry hash_algorithms[] = { | |||
327 | }; | 327 | }; |
328 | 328 | ||
329 | /* Keep the contents of this struct the same as the previous one. */ | 329 | /* Keep the contents of this struct the same as the previous one. */ |
330 | static const gnutls_mac_algorithm_t supported_macs[] = { MHD_GNUTLS_MAC_SHA1, | 330 | static const gnutls_mac_algorithm_t mhd_gtls_supported_macs[] = { MHD_GNUTLS_MAC_SHA1, |
331 | MHD_GNUTLS_MAC_MD5, | 331 | MHD_GNUTLS_MAC_MD5, |
332 | MHD_GNUTLS_MAC_SHA256, | 332 | MHD_GNUTLS_MAC_SHA256, |
333 | MHD_GNUTLS_MAC_NULL, | 333 | MHD_GNUTLS_MAC_NULL, |
@@ -336,7 +336,7 @@ static const gnutls_mac_algorithm_t supported_macs[] = { MHD_GNUTLS_MAC_SHA1, | |||
336 | 336 | ||
337 | #define GNUTLS_HASH_LOOP(b) \ | 337 | #define GNUTLS_HASH_LOOP(b) \ |
338 | const gnutls_hash_entry *p; \ | 338 | const gnutls_hash_entry *p; \ |
339 | for(p = hash_algorithms; p->name != NULL; p++) { b ; } | 339 | for(p = mhd_gtls_hash_algorithms; p->name != NULL; p++) { b ; } |
340 | 340 | ||
341 | #define GNUTLS_HASH_ALG_LOOP(a) \ | 341 | #define GNUTLS_HASH_ALG_LOOP(a) \ |
342 | GNUTLS_HASH_LOOP( if(p->id == algorithm) { a; break; } ) | 342 | GNUTLS_HASH_LOOP( if(p->id == algorithm) { a; break; } ) |
@@ -364,7 +364,7 @@ gnutls_compression_entry _gnutls_compression_algorithms[MAX_COMP_METHODS] = | |||
364 | 0} | 364 | 0} |
365 | }; | 365 | }; |
366 | 366 | ||
367 | static const gnutls_compression_method_t supported_compressions[] = { | 367 | static const gnutls_compression_method_t mhd_gtls_supported_compressions[] = { |
368 | #ifdef HAVE_LIBZ | 368 | #ifdef HAVE_LIBZ |
369 | MHD_GNUTLS_COMP_DEFLATE, | 369 | MHD_GNUTLS_COMP_DEFLATE, |
370 | #endif | 370 | #endif |
@@ -381,11 +381,11 @@ static const gnutls_compression_method_t supported_compressions[] = { | |||
381 | GNUTLS_COMPRESSION_LOOP( if(p->num == num) { a; break; } ) | 381 | GNUTLS_COMPRESSION_LOOP( if(p->num == num) { a; break; } ) |
382 | 382 | ||
383 | /* Key Exchange Section */ | 383 | /* Key Exchange Section */ |
384 | extern mhd_gtls_mod_auth_st rsa_auth_struct; | 384 | extern mhd_gtls_mod_auth_st mhd_gtls_rsa_auth_struct; |
385 | extern mhd_gtls_mod_auth_st rsa_export_auth_struct; | 385 | extern mhd_gtls_mod_auth_st rsa_export_auth_struct; |
386 | extern mhd_gtls_mod_auth_st dhe_rsa_auth_struct; | 386 | extern mhd_gtls_mod_auth_st mhd_gtls_dhe_rsa_auth_struct; |
387 | extern mhd_gtls_mod_auth_st dhe_dss_auth_struct; | 387 | extern mhd_gtls_mod_auth_st mhd_gtls_dhe_dss_auth_struct; |
388 | extern mhd_gtls_mod_auth_st anon_auth_struct; | 388 | extern mhd_gtls_mod_auth_st mhd_gtls_anon_auth_struct; |
389 | extern mhd_gtls_mod_auth_st srp_auth_struct; | 389 | extern mhd_gtls_mod_auth_st srp_auth_struct; |
390 | extern mhd_gtls_mod_auth_st psk_auth_struct; | 390 | extern mhd_gtls_mod_auth_st psk_auth_struct; |
391 | extern mhd_gtls_mod_auth_st dhe_psk_auth_struct; | 391 | extern mhd_gtls_mod_auth_st dhe_psk_auth_struct; |
@@ -403,11 +403,11 @@ typedef struct mhd_gtls_kx_algo_entry | |||
403 | 403 | ||
404 | static const mhd_gtls_kx_algo_entry_t mhd_gtls_kx_algorithms[] = { | 404 | static const mhd_gtls_kx_algo_entry_t mhd_gtls_kx_algorithms[] = { |
405 | #ifdef ENABLE_ANON | 405 | #ifdef ENABLE_ANON |
406 | {"ANON-DH", MHD_GNUTLS_KX_ANON_DH, &anon_auth_struct, 1, 0}, | 406 | {"ANON-DH", MHD_GNUTLS_KX_ANON_DH, &mhd_gtls_anon_auth_struct, 1, 0}, |
407 | #endif | 407 | #endif |
408 | {"RSA", | 408 | {"RSA", |
409 | MHD_GNUTLS_KX_RSA, | 409 | MHD_GNUTLS_KX_RSA, |
410 | &rsa_auth_struct, | 410 | &mhd_gtls_rsa_auth_struct, |
411 | 0, | 411 | 0, |
412 | 0}, | 412 | 0}, |
413 | {"RSA-EXPORT", | 413 | {"RSA-EXPORT", |
@@ -417,12 +417,12 @@ static const mhd_gtls_kx_algo_entry_t mhd_gtls_kx_algorithms[] = { | |||
417 | 1 /* needs RSA params */ }, | 417 | 1 /* needs RSA params */ }, |
418 | {"DHE-RSA", | 418 | {"DHE-RSA", |
419 | MHD_GNUTLS_KX_DHE_RSA, | 419 | MHD_GNUTLS_KX_DHE_RSA, |
420 | &dhe_rsa_auth_struct, | 420 | &mhd_gtls_dhe_rsa_auth_struct, |
421 | 1, | 421 | 1, |
422 | 0}, | 422 | 0}, |
423 | {"DHE-DSS", | 423 | {"DHE-DSS", |
424 | MHD_GNUTLS_KX_DHE_DSS, | 424 | MHD_GNUTLS_KX_DHE_DSS, |
425 | &dhe_dss_auth_struct, | 425 | &mhd_gtls_dhe_dss_auth_struct, |
426 | 1, | 426 | 1, |
427 | 0}, | 427 | 0}, |
428 | 428 | ||
@@ -444,7 +444,7 @@ static const mhd_gtls_kx_algo_entry_t mhd_gtls_kx_algorithms[] = { | |||
444 | }; | 444 | }; |
445 | 445 | ||
446 | /* Keep the contents of this struct the same as the previous one. */ | 446 | /* Keep the contents of this struct the same as the previous one. */ |
447 | static const gnutls_kx_algorithm_t supported_kxs[] = { | 447 | static const gnutls_kx_algorithm_t mhd_gtls_supported_kxs[] = { |
448 | #ifdef ENABLE_ANON | 448 | #ifdef ENABLE_ANON |
449 | MHD_GNUTLS_KX_ANON_DH, | 449 | MHD_GNUTLS_KX_ANON_DH, |
450 | #endif | 450 | #endif |
@@ -485,7 +485,7 @@ typedef struct | |||
485 | gnutls_protocol_t version; /* this cipher suite is supported | 485 | gnutls_protocol_t version; /* this cipher suite is supported |
486 | * from 'version' and above; | 486 | * from 'version' and above; |
487 | */ | 487 | */ |
488 | } gnutls_cipher_suite_entry; | 488 | } mhd_gtls_cipher_suite_entry; |
489 | 489 | ||
490 | /* RSA with NULL cipher and MD5 MAC | 490 | /* RSA with NULL cipher and MD5 MAC |
491 | * for test purposes. | 491 | * for test purposes. |
@@ -581,9 +581,9 @@ typedef struct | |||
581 | #define GNUTLS_DHE_RSA_CAMELLIA_128_CBC_SHA1 { 0x00,0x45 } | 581 | #define GNUTLS_DHE_RSA_CAMELLIA_128_CBC_SHA1 { 0x00,0x45 } |
582 | #define GNUTLS_DHE_RSA_CAMELLIA_256_CBC_SHA1 { 0x00,0x88 } | 582 | #define GNUTLS_DHE_RSA_CAMELLIA_256_CBC_SHA1 { 0x00,0x88 } |
583 | 583 | ||
584 | #define CIPHER_SUITES_COUNT sizeof(cs_algorithms)/sizeof(gnutls_cipher_suite_entry)-1 | 584 | #define CIPHER_SUITES_COUNT sizeof(mhd_gtls_cs_algorithms)/sizeof(mhd_gtls_cipher_suite_entry)-1 |
585 | 585 | ||
586 | static const gnutls_cipher_suite_entry cs_algorithms[] = { | 586 | static const mhd_gtls_cipher_suite_entry mhd_gtls_cs_algorithms[] = { |
587 | /* ANON_DH */ | 587 | /* ANON_DH */ |
588 | GNUTLS_CIPHER_SUITE_ENTRY (GNUTLS_ANON_DH_ARCFOUR_MD5, | 588 | GNUTLS_CIPHER_SUITE_ENTRY (GNUTLS_ANON_DH_ARCFOUR_MD5, |
589 | MHD_GNUTLS_CIPHER_ARCFOUR_128, | 589 | MHD_GNUTLS_CIPHER_ARCFOUR_128, |
@@ -753,8 +753,8 @@ static const gnutls_cipher_suite_entry cs_algorithms[] = { | |||
753 | }; | 753 | }; |
754 | 754 | ||
755 | #define GNUTLS_CIPHER_SUITE_LOOP(b) \ | 755 | #define GNUTLS_CIPHER_SUITE_LOOP(b) \ |
756 | const gnutls_cipher_suite_entry *p; \ | 756 | const mhd_gtls_cipher_suite_entry *p; \ |
757 | for(p = cs_algorithms; p->name != NULL; p++) { b ; } | 757 | for(p = mhd_gtls_cs_algorithms; p->name != NULL; p++) { b ; } |
758 | 758 | ||
759 | #define GNUTLS_CIPHER_SUITE_ALG_LOOP(a) \ | 759 | #define GNUTLS_CIPHER_SUITE_ALG_LOOP(a) \ |
760 | GNUTLS_CIPHER_SUITE_LOOP( if( (p->id.suite[0] == suite->suite[0]) && (p->id.suite[1] == suite->suite[1])) { a; break; } ) | 760 | GNUTLS_CIPHER_SUITE_LOOP( if( (p->id.suite[0] == suite->suite[0]) && (p->id.suite[1] == suite->suite[1])) { a; break; } ) |
@@ -844,7 +844,7 @@ MHD_gnutls_mac_get_key_size (gnutls_mac_algorithm_t algorithm) | |||
844 | const gnutls_mac_algorithm_t * | 844 | const gnutls_mac_algorithm_t * |
845 | MHD_gtls_mac_list (void) | 845 | MHD_gtls_mac_list (void) |
846 | { | 846 | { |
847 | return supported_macs; | 847 | return mhd_gtls_supported_macs; |
848 | } | 848 | } |
849 | 849 | ||
850 | const char * | 850 | const char * |
@@ -955,7 +955,7 @@ MHD_gtls_compression_get_id (const char *name) | |||
955 | const gnutls_compression_method_t * | 955 | const gnutls_compression_method_t * |
956 | MHD_gtls_compression_list (void) | 956 | MHD_gtls_compression_list (void) |
957 | { | 957 | { |
958 | return supported_compressions; | 958 | return mhd_gtls_supported_compressions; |
959 | } | 959 | } |
960 | 960 | ||
961 | /* return the tls number of the specified algorithm */ | 961 | /* return the tls number of the specified algorithm */ |
@@ -1145,7 +1145,7 @@ MHD_gtls_cipher_get_id (const char *name) | |||
1145 | const gnutls_cipher_algorithm_t * | 1145 | const gnutls_cipher_algorithm_t * |
1146 | MHD_gtls_cipher_list (void) | 1146 | MHD_gtls_cipher_list (void) |
1147 | { | 1147 | { |
1148 | return supported_ciphers; | 1148 | return mhd_gtls_supported_ciphers; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | int | 1151 | int |
@@ -1232,7 +1232,7 @@ MHD_gtls_kx_get_id (const char *name) | |||
1232 | const gnutls_kx_algorithm_t * | 1232 | const gnutls_kx_algorithm_t * |
1233 | MHD_gtls_kx_list (void) | 1233 | MHD_gtls_kx_list (void) |
1234 | { | 1234 | { |
1235 | return supported_kxs; | 1235 | return mhd_gtls_supported_kxs; |
1236 | } | 1236 | } |
1237 | 1237 | ||
1238 | int | 1238 | int |
@@ -1376,7 +1376,7 @@ MHD_gtls_protocol_get_id (const char *name) | |||
1376 | const gnutls_protocol_t * | 1376 | const gnutls_protocol_t * |
1377 | MHD_gtls_protocol_list (void) | 1377 | MHD_gtls_protocol_list (void) |
1378 | { | 1378 | { |
1379 | return supported_protocols; | 1379 | return mhd_gtls_supported_protocols; |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | int | 1382 | int |
@@ -1739,7 +1739,7 @@ mhd_gtls_supported_ciphersuites (mhd_gtls_session_t session, | |||
1739 | 1739 | ||
1740 | for (i = 0; i < count; i++) | 1740 | for (i = 0; i < count; i++) |
1741 | { | 1741 | { |
1742 | memcpy (&tmp_ciphers[i], &cs_algorithms[i].id, | 1742 | memcpy (&tmp_ciphers[i], &mhd_gtls_cs_algorithms[i].id, |
1743 | sizeof (cipher_suite_st)); | 1743 | sizeof (cipher_suite_st)); |
1744 | } | 1744 | } |
1745 | 1745 | ||
@@ -1894,7 +1894,7 @@ MHD_gtls_certificate_type_get_id (const char *name) | |||
1894 | return ret; | 1894 | return ret; |
1895 | } | 1895 | } |
1896 | 1896 | ||
1897 | static const gnutls_certificate_type_t supported_certificate_types[] = | 1897 | static const gnutls_certificate_type_t mhd_gtls_supported_certificate_types[] = |
1898 | { MHD_GNUTLS_CRT_X509, | 1898 | { MHD_GNUTLS_CRT_X509, |
1899 | MHD_GNUTLS_CRT_OPENPGP, | 1899 | MHD_GNUTLS_CRT_OPENPGP, |
1900 | 0 | 1900 | 0 |
@@ -1914,7 +1914,7 @@ static const gnutls_certificate_type_t supported_certificate_types[] = | |||
1914 | const gnutls_certificate_type_t * | 1914 | const gnutls_certificate_type_t * |
1915 | MHD_gtls_certificate_type_list (void) | 1915 | MHD_gtls_certificate_type_list (void) |
1916 | { | 1916 | { |
1917 | return supported_certificate_types; | 1917 | return mhd_gtls_supported_certificate_types; |
1918 | } | 1918 | } |
1919 | 1919 | ||
1920 | /* returns the gnutls_pk_algorithm_t which is compatible with | 1920 | /* returns the gnutls_pk_algorithm_t which is compatible with |
@@ -1953,7 +1953,7 @@ struct gnutls_sign_entry | |||
1953 | }; | 1953 | }; |
1954 | typedef struct gnutls_sign_entry gnutls_sign_entry; | 1954 | typedef struct gnutls_sign_entry gnutls_sign_entry; |
1955 | 1955 | ||
1956 | static const gnutls_sign_entry sign_algorithms[] = { | 1956 | static const gnutls_sign_entry mhd_gtls_sign_algorithms[] = { |
1957 | {"RSA-SHA", | 1957 | {"RSA-SHA", |
1958 | SIG_RSA_SHA1_OID, | 1958 | SIG_RSA_SHA1_OID, |
1959 | GNUTLS_SIGN_RSA_SHA1, | 1959 | GNUTLS_SIGN_RSA_SHA1, |
@@ -1989,7 +1989,7 @@ static const gnutls_sign_entry sign_algorithms[] = { | |||
1989 | #define GNUTLS_SIGN_LOOP(b) \ | 1989 | #define GNUTLS_SIGN_LOOP(b) \ |
1990 | do { \ | 1990 | do { \ |
1991 | const gnutls_sign_entry *p; \ | 1991 | const gnutls_sign_entry *p; \ |
1992 | for(p = sign_algorithms; p->name != NULL; p++) { b ; } \ | 1992 | for(p = mhd_gtls_sign_algorithms; p->name != NULL; p++) { b ; } \ |
1993 | } while (0) | 1993 | } while (0) |
1994 | 1994 | ||
1995 | #define GNUTLS_SIGN_ALG_LOOP(a) \ | 1995 | #define GNUTLS_SIGN_ALG_LOOP(a) \ |
@@ -2053,7 +2053,7 @@ struct gnutls_pk_entry | |||
2053 | }; | 2053 | }; |
2054 | typedef struct gnutls_pk_entry gnutls_pk_entry; | 2054 | typedef struct gnutls_pk_entry gnutls_pk_entry; |
2055 | 2055 | ||
2056 | static const gnutls_pk_entry pk_algorithms[] = { | 2056 | static const gnutls_pk_entry mhd_gtls_pk_algorithms[] = { |
2057 | {"RSA", | 2057 | {"RSA", |
2058 | PK_PKIX1_RSA_OID, | 2058 | PK_PKIX1_RSA_OID, |
2059 | MHD_GNUTLS_PK_RSA}, | 2059 | MHD_GNUTLS_PK_RSA}, |
@@ -2074,7 +2074,7 @@ mhd_gtls_x509_oid2pk_algorithm (const char *oid) | |||
2074 | gnutls_pk_algorithm_t ret = MHD_GNUTLS_PK_UNKNOWN; | 2074 | gnutls_pk_algorithm_t ret = MHD_GNUTLS_PK_UNKNOWN; |
2075 | const gnutls_pk_entry *p; | 2075 | const gnutls_pk_entry *p; |
2076 | 2076 | ||
2077 | for (p = pk_algorithms; p->name != NULL; p++) | 2077 | for (p = mhd_gtls_pk_algorithms; p->name != NULL; p++) |
2078 | if (strcmp (p->oid, oid) == 0) | 2078 | if (strcmp (p->oid, oid) == 0) |
2079 | { | 2079 | { |
2080 | ret = p->id; | 2080 | ret = p->id; |
@@ -2090,7 +2090,7 @@ mhd_gtls_x509_pk_to_oid (gnutls_pk_algorithm_t algorithm) | |||
2090 | const char *ret = NULL; | 2090 | const char *ret = NULL; |
2091 | const gnutls_pk_entry *p; | 2091 | const gnutls_pk_entry *p; |
2092 | 2092 | ||
2093 | for (p = pk_algorithms; p->name != NULL; p++) | 2093 | for (p = mhd_gtls_pk_algorithms; p->name != NULL; p++) |
2094 | if (p->id == algorithm) | 2094 | if (p->id == algorithm) |
2095 | { | 2095 | { |
2096 | ret = p->oid; | 2096 | ret = p->oid; |
diff --git a/src/daemon/https/tls/gnutls_auth.c b/src/daemon/https/tls/gnutls_auth.c index cb2f42e0..b517c285 100644 --- a/src/daemon/https/tls/gnutls_auth.c +++ b/src/daemon/https/tls/gnutls_auth.c | |||
@@ -286,7 +286,7 @@ mhd_gtls_get_auth_info (mhd_gtls_session_t session) | |||
286 | void | 286 | void |
287 | mhd_gtls_free_auth_info (mhd_gtls_session_t session) | 287 | mhd_gtls_free_auth_info (mhd_gtls_session_t session) |
288 | { | 288 | { |
289 | dh_info_st *dh_info; | 289 | mhd_gtls_dh_info_st *dh_info; |
290 | rsa_info_st *rsa_info; | 290 | rsa_info_st *rsa_info; |
291 | 291 | ||
292 | if (session == NULL || session->key == NULL) | 292 | if (session == NULL || session->key == NULL) |
diff --git a/src/daemon/https/tls/gnutls_cert.c b/src/daemon/https/tls/gnutls_cert.c index ee169a75..d63628e3 100644 --- a/src/daemon/https/tls/gnutls_cert.c +++ b/src/daemon/https/tls/gnutls_cert.c | |||
@@ -216,7 +216,7 @@ int | |||
216 | MHD_gnutls_certificate_allocate_credentials (mhd_gtls_cert_credentials_t * | 216 | MHD_gnutls_certificate_allocate_credentials (mhd_gtls_cert_credentials_t * |
217 | res) | 217 | res) |
218 | { | 218 | { |
219 | *res = gnutls_calloc (1, sizeof (certificate_credentials_st)); | 219 | *res = gnutls_calloc (1, sizeof (mhd_gtls_cert_credentials_st)); |
220 | 220 | ||
221 | if (*res == NULL) | 221 | if (*res == NULL) |
222 | return GNUTLS_E_MEMORY_ERROR; | 222 | return GNUTLS_E_MEMORY_ERROR; |
diff --git a/src/daemon/https/tls/gnutls_constate.c b/src/daemon/https/tls/gnutls_constate.c index 4e683de7..f2bbca43 100644 --- a/src/daemon/https/tls/gnutls_constate.c +++ b/src/daemon/https/tls/gnutls_constate.c | |||
@@ -50,7 +50,7 @@ static const int servwrite_length = sizeof (servwrite) - 1; | |||
50 | #define EXPORT_FINAL_KEY_SIZE 16 | 50 | #define EXPORT_FINAL_KEY_SIZE 16 |
51 | 51 | ||
52 | /* This function is to be called after handshake, when master_secret, | 52 | /* This function is to be called after handshake, when master_secret, |
53 | * client_random and server_random have been initialized. | 53 | * client_random and server_random have been initialized. |
54 | * This function creates the keys and stores them into pending session. | 54 | * This function creates the keys and stores them into pending session. |
55 | * (session->cipher_specs) | 55 | * (session->cipher_specs) |
56 | */ | 56 | */ |
@@ -475,7 +475,7 @@ mhd_gtls_connection_state_init (mhd_gtls_session_t session) | |||
475 | { | 475 | { |
476 | int ret; | 476 | int ret; |
477 | 477 | ||
478 | /* Setup the master secret | 478 | /* Setup the master secret |
479 | */ | 479 | */ |
480 | if ((ret = mhd_gtls_generate_master (session, 0), 0) < 0) | 480 | if ((ret = mhd_gtls_generate_master (session, 0), 0) < 0) |
481 | { | 481 | { |
@@ -621,7 +621,7 @@ mhd_gtls_read_connection_state_init (mhd_gtls_session_t session) | |||
621 | } | 621 | } |
622 | 622 | ||
623 | break; | 623 | break; |
624 | 624 | #if MHD_DEBUG_TLS | |
625 | case GNUTLS_CLIENT: | 625 | case GNUTLS_CLIENT: |
626 | session->connection_state.read_cipher_state = | 626 | session->connection_state.read_cipher_state = |
627 | mhd_gtls_cipher_init (session->security_parameters. | 627 | mhd_gtls_cipher_init (session->security_parameters. |
@@ -657,7 +657,7 @@ mhd_gtls_read_connection_state_init (mhd_gtls_session_t session) | |||
657 | } | 657 | } |
658 | 658 | ||
659 | break; | 659 | break; |
660 | 660 | #endif | |
661 | default: /* this check is useless */ | 661 | default: /* this check is useless */ |
662 | gnutls_assert (); | 662 | gnutls_assert (); |
663 | return GNUTLS_E_INTERNAL_ERROR; | 663 | return GNUTLS_E_INTERNAL_ERROR; |
@@ -815,7 +815,7 @@ mhd_gtls_write_connection_state_init (mhd_gtls_session_t session) | |||
815 | 815 | ||
816 | 816 | ||
817 | break; | 817 | break; |
818 | 818 | #if MHD_DEBUG_TLS | |
819 | case GNUTLS_CLIENT: | 819 | case GNUTLS_CLIENT: |
820 | session->connection_state.write_cipher_state = | 820 | session->connection_state.write_cipher_state = |
821 | mhd_gtls_cipher_init (session->security_parameters. | 821 | mhd_gtls_cipher_init (session->security_parameters. |
@@ -850,7 +850,7 @@ mhd_gtls_write_connection_state_init (mhd_gtls_session_t session) | |||
850 | } | 850 | } |
851 | 851 | ||
852 | break; | 852 | break; |
853 | 853 | #endif | |
854 | default: | 854 | default: |
855 | gnutls_assert (); | 855 | gnutls_assert (); |
856 | return GNUTLS_E_INTERNAL_ERROR; | 856 | return GNUTLS_E_INTERNAL_ERROR; |
@@ -870,7 +870,7 @@ mhd_gtls_write_connection_state_init (mhd_gtls_session_t session) | |||
870 | return 0; | 870 | return 0; |
871 | } | 871 | } |
872 | 872 | ||
873 | /* Sets the specified cipher into the pending session | 873 | /* Sets the specified cipher into the pending session |
874 | */ | 874 | */ |
875 | int | 875 | int |
876 | mhd_gtls_set_read_cipher (mhd_gtls_session_t session, | 876 | mhd_gtls_set_read_cipher (mhd_gtls_session_t session, |
@@ -925,7 +925,7 @@ mhd_gtls_set_write_cipher (mhd_gtls_session_t session, | |||
925 | } | 925 | } |
926 | 926 | ||
927 | 927 | ||
928 | /* Sets the specified algorithm into pending compression session | 928 | /* Sets the specified algorithm into pending compression session |
929 | */ | 929 | */ |
930 | int | 930 | int |
931 | mhd_gtls_set_read_compression (mhd_gtls_session_t session, | 931 | mhd_gtls_set_read_compression (mhd_gtls_session_t session, |
@@ -963,7 +963,7 @@ mhd_gtls_set_write_compression (mhd_gtls_session_t session, | |||
963 | 963 | ||
964 | } | 964 | } |
965 | 965 | ||
966 | /* Sets the specified kx algorithm into pending session | 966 | /* Sets the specified kx algorithm into pending session |
967 | */ | 967 | */ |
968 | int | 968 | int |
969 | mhd_gtls_set_kx (mhd_gtls_session_t session, gnutls_kx_algorithm_t algo) | 969 | mhd_gtls_set_kx (mhd_gtls_session_t session, gnutls_kx_algorithm_t algo) |
diff --git a/src/daemon/https/tls/gnutls_errors.c b/src/daemon/https/tls/gnutls_errors.c index 9ebf67df..f4436ece 100644 --- a/src/daemon/https/tls/gnutls_errors.c +++ b/src/daemon/https/tls/gnutls_errors.c | |||
@@ -48,7 +48,7 @@ struct gnutls_error_entry | |||
48 | }; | 48 | }; |
49 | typedef struct gnutls_error_entry gnutls_error_entry; | 49 | typedef struct gnutls_error_entry gnutls_error_entry; |
50 | 50 | ||
51 | static const gnutls_error_entry error_algorithms[] = { | 51 | static const gnutls_error_entry mhd_gtls_error_algorithms[] = { |
52 | /* "Short Description", Error code define, critical (0,1) -- 1 in most cases */ | 52 | /* "Short Description", Error code define, critical (0,1) -- 1 in most cases */ |
53 | ERROR_ENTRY (N_("Success."), GNUTLS_E_SUCCESS, 0), | 53 | ERROR_ENTRY (N_("Success."), GNUTLS_E_SUCCESS, 0), |
54 | ERROR_ENTRY (N_("Could not negotiate a supported cipher suite."), | 54 | ERROR_ENTRY (N_("Could not negotiate a supported cipher suite."), |
@@ -255,7 +255,7 @@ static const gnutls_error_entry error_algorithms[] = { | |||
255 | 255 | ||
256 | #define GNUTLS_ERROR_LOOP(b) \ | 256 | #define GNUTLS_ERROR_LOOP(b) \ |
257 | const gnutls_error_entry *p; \ | 257 | const gnutls_error_entry *p; \ |
258 | for(p = error_algorithms; p->desc != NULL; p++) { b ; } | 258 | for(p = mhd_gtls_error_algorithms; p->desc != NULL; p++) { b ; } |
259 | 259 | ||
260 | #define GNUTLS_ERROR_ALG_LOOP(a) \ | 260 | #define GNUTLS_ERROR_ALG_LOOP(a) \ |
261 | GNUTLS_ERROR_LOOP( if(p->number == error) { a; break; } ) | 261 | GNUTLS_ERROR_LOOP( if(p->number == error) { a; break; } ) |
@@ -348,7 +348,7 @@ _gnutls_strerror (int error) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | int | 350 | int |
351 | _gnutls_asn2err (int asn_err) | 351 | mhd_gtls_asn2err (int asn_err) |
352 | { | 352 | { |
353 | switch (asn_err) | 353 | switch (asn_err) |
354 | { | 354 | { |
@@ -390,7 +390,7 @@ _gnutls_asn2err (int asn_err) | |||
390 | * caller provided function | 390 | * caller provided function |
391 | */ | 391 | */ |
392 | void | 392 | void |
393 | _gnutls_log (int level, const char *fmt, ...) | 393 | mhd_gtls_log (int level, const char *fmt, ...) |
394 | { | 394 | { |
395 | va_list args; | 395 | va_list args; |
396 | char str[MAX_LOG_SIZE]; | 396 | char str[MAX_LOG_SIZE]; |
diff --git a/src/daemon/https/tls/gnutls_errors.h b/src/daemon/https/tls/gnutls_errors.h index 667bd62b..fcfc4c63 100644 --- a/src/daemon/https/tls/gnutls_errors.h +++ b/src/daemon/https/tls/gnutls_errors.h | |||
@@ -36,17 +36,17 @@ | |||
36 | # define gnutls_assert() | 36 | # define gnutls_assert() |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | int _gnutls_asn2err (int asn_err); | 39 | int mhd_gtls_asn2err (int asn_err); |
40 | void _gnutls_log (int, const char *fmt, ...); | 40 | void mhd_gtls_log (int, const char *fmt, ...); |
41 | 41 | ||
42 | extern int _gnutls_log_level; | 42 | extern int _gnutls_log_level; |
43 | 43 | ||
44 | #ifdef C99_MACROS | 44 | #ifdef C99_MACROS |
45 | #define LEVEL(l, ...) if (_gnutls_log_level >= l || _gnutls_log_level > 9) \ | 45 | #define LEVEL(l, ...) if (_gnutls_log_level >= l || _gnutls_log_level > 9) \ |
46 | _gnutls_log( l, __VA_ARGS__) | 46 | mhd_gtls_log( l, __VA_ARGS__) |
47 | 47 | ||
48 | #define LEVEL_EQ(l, ...) if (_gnutls_log_level == l || _gnutls_log_level > 9) \ | 48 | #define LEVEL_EQ(l, ...) if (_gnutls_log_level == l || _gnutls_log_level > 9) \ |
49 | _gnutls_log( l, __VA_ARGS__) | 49 | mhd_gtls_log( l, __VA_ARGS__) |
50 | 50 | ||
51 | # define _gnutls_debug_log(...) LEVEL(2, __VA_ARGS__) | 51 | # define _gnutls_debug_log(...) LEVEL(2, __VA_ARGS__) |
52 | # define _gnutls_handshake_log(...) LEVEL(3, __VA_ARGS__) | 52 | # define _gnutls_handshake_log(...) LEVEL(3, __VA_ARGS__) |
diff --git a/src/daemon/https/tls/gnutls_extensions.c b/src/daemon/https/tls/gnutls_extensions.c index 5e09c911..6b2f00c8 100644 --- a/src/daemon/https/tls/gnutls_extensions.c +++ b/src/daemon/https/tls/gnutls_extensions.c | |||
@@ -119,12 +119,13 @@ mhd_gtls_extension_get_name (uint16_t type) | |||
119 | return ret; | 119 | return ret; |
120 | } | 120 | } |
121 | 121 | ||
122 | /* Checks if the extension we just received is one of the | 122 | /* Checks if the extension we just received is one of the |
123 | * requested ones. Otherwise it's a fatal error. | 123 | * requested ones. Otherwise it's a fatal error. |
124 | */ | 124 | */ |
125 | static int | 125 | static int |
126 | _gnutls_extension_list_check (mhd_gtls_session_t session, uint16_t type) | 126 | _gnutls_extension_list_check (mhd_gtls_session_t session, uint16_t type) |
127 | { | 127 | { |
128 | #if MHD_DEBUG_TLS | ||
128 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 129 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
129 | { | 130 | { |
130 | int i; | 131 | int i; |
@@ -135,7 +136,7 @@ _gnutls_extension_list_check (mhd_gtls_session_t session, uint16_t type) | |||
135 | } | 136 | } |
136 | return GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION; | 137 | return GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION; |
137 | } | 138 | } |
138 | 139 | #endif | |
139 | return 0; | 140 | return 0; |
140 | } | 141 | } |
141 | 142 | ||
@@ -153,7 +154,6 @@ mhd_gtls_parse_extensions (mhd_gtls_session_t session, | |||
153 | 154 | ||
154 | #ifdef DEBUG | 155 | #ifdef DEBUG |
155 | int i; | 156 | int i; |
156 | |||
157 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 157 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
158 | for (i = 0; i < session->internals.extensions_sent_size; i++) | 158 | for (i = 0; i < session->internals.extensions_sent_size; i++) |
159 | { | 159 | { |
@@ -217,7 +217,7 @@ mhd_gtls_parse_extensions (mhd_gtls_session_t session, | |||
217 | static void | 217 | static void |
218 | _gnutls_extension_list_add (mhd_gtls_session_t session, uint16_t type) | 218 | _gnutls_extension_list_add (mhd_gtls_session_t session, uint16_t type) |
219 | { | 219 | { |
220 | 220 | #if MHD_DEBUG_TLS | |
221 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 221 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
222 | { | 222 | { |
223 | if (session->internals.extensions_sent_size < MAX_EXT_TYPES) | 223 | if (session->internals.extensions_sent_size < MAX_EXT_TYPES) |
@@ -231,6 +231,7 @@ _gnutls_extension_list_add (mhd_gtls_session_t session, uint16_t type) | |||
231 | _gnutls_debug_log ("extensions: Increase MAX_EXT_TYPES\n"); | 231 | _gnutls_debug_log ("extensions: Increase MAX_EXT_TYPES\n"); |
232 | } | 232 | } |
233 | } | 233 | } |
234 | #endif | ||
234 | } | 235 | } |
235 | 236 | ||
236 | int | 237 | int |
diff --git a/src/daemon/https/tls/gnutls_global.c b/src/daemon/https/tls/gnutls_global.c index 916e8117..87f92239 100644 --- a/src/daemon/https/tls/gnutls_global.c +++ b/src/daemon/https/tls/gnutls_global.c | |||
@@ -159,7 +159,7 @@ static void | |||
159 | _gnutls_gcry_log_handler (void *dummy, int level, | 159 | _gnutls_gcry_log_handler (void *dummy, int level, |
160 | const char *fmt, va_list list) | 160 | const char *fmt, va_list list) |
161 | { | 161 | { |
162 | _gnutls_log (level, fmt, list); | 162 | mhd_gtls_log (level, fmt, list); |
163 | } | 163 | } |
164 | #endif | 164 | #endif |
165 | 165 | ||
@@ -288,7 +288,7 @@ MHD_gnutls_global_init (void) | |||
288 | res = asn1_array2tree (pkix_asn1_tab, &_gnutls_pkix1_asn, NULL); | 288 | res = asn1_array2tree (pkix_asn1_tab, &_gnutls_pkix1_asn, NULL); |
289 | if (res != ASN1_SUCCESS) | 289 | if (res != ASN1_SUCCESS) |
290 | { | 290 | { |
291 | result = _gnutls_asn2err (res); | 291 | result = mhd_gtls_asn2err (res); |
292 | return result; | 292 | return result; |
293 | } | 293 | } |
294 | 294 | ||
@@ -296,7 +296,7 @@ MHD_gnutls_global_init (void) | |||
296 | if (res != ASN1_SUCCESS) | 296 | if (res != ASN1_SUCCESS) |
297 | { | 297 | { |
298 | asn1_delete_structure (&_gnutls_pkix1_asn); | 298 | asn1_delete_structure (&_gnutls_pkix1_asn); |
299 | result = _gnutls_asn2err (res); | 299 | result = mhd_gtls_asn2err (res); |
300 | return result; | 300 | return result; |
301 | } | 301 | } |
302 | 302 | ||
diff --git a/src/daemon/https/tls/gnutls_handshake.c b/src/daemon/https/tls/gnutls_handshake.c index 882b43e2..cbab8156 100644 --- a/src/daemon/https/tls/gnutls_handshake.c +++ b/src/daemon/https/tls/gnutls_handshake.c | |||
@@ -58,7 +58,7 @@ | |||
58 | #define TRUE 1 | 58 | #define TRUE 1 |
59 | #define FALSE 0 | 59 | #define FALSE 0 |
60 | 60 | ||
61 | int _gnutls_server_select_comp_method (mhd_gtls_session_t session, | 61 | static int _gnutls_server_select_comp_method (mhd_gtls_session_t session, |
62 | opaque * data, int datalen); | 62 | opaque * data, int datalen); |
63 | 63 | ||
64 | 64 | ||
@@ -186,7 +186,7 @@ _gnutls_ssl3_finished (mhd_gtls_session_t session, int type, opaque * ret) | |||
186 | #define SERVER_MSG "server finished" | 186 | #define SERVER_MSG "server finished" |
187 | #define CLIENT_MSG "client finished" | 187 | #define CLIENT_MSG "client finished" |
188 | #define TLS_MSG_LEN 15 | 188 | #define TLS_MSG_LEN 15 |
189 | int | 189 | static int |
190 | _gnutls_finished (mhd_gtls_session_t session, int type, void *ret) | 190 | _gnutls_finished (mhd_gtls_session_t session, int type, void *ret) |
191 | { | 191 | { |
192 | const int siz = TLS_MSG_LEN; | 192 | const int siz = TLS_MSG_LEN; |
@@ -332,7 +332,7 @@ mhd_gtls_user_hello_func (gnutls_session session, | |||
332 | * or version 2.0 client hello (only for compatibility | 332 | * or version 2.0 client hello (only for compatibility |
333 | * since SSL version 2.0 is not supported). | 333 | * since SSL version 2.0 is not supported). |
334 | */ | 334 | */ |
335 | int | 335 | static int |
336 | _gnutls_read_client_hello (mhd_gtls_session_t session, opaque * data, | 336 | _gnutls_read_client_hello (mhd_gtls_session_t session, opaque * data, |
337 | int datalen) | 337 | int datalen) |
338 | { | 338 | { |
@@ -509,7 +509,7 @@ _gnutls_handshake_hash_pending (mhd_gtls_session_t session) | |||
509 | * and initializing encryption. This is the first encrypted message | 509 | * and initializing encryption. This is the first encrypted message |
510 | * we send. | 510 | * we send. |
511 | */ | 511 | */ |
512 | int | 512 | static int |
513 | _gnutls_send_finished (mhd_gtls_session_t session, int again) | 513 | _gnutls_send_finished (mhd_gtls_session_t session, int again) |
514 | { | 514 | { |
515 | uint8_t data[36]; | 515 | uint8_t data[36]; |
@@ -562,7 +562,7 @@ _gnutls_send_finished (mhd_gtls_session_t session, int again) | |||
562 | /* This is to be called after sending our finished message. If everything | 562 | /* This is to be called after sending our finished message. If everything |
563 | * went fine we have negotiated a secure connection | 563 | * went fine we have negotiated a secure connection |
564 | */ | 564 | */ |
565 | int | 565 | static int |
566 | _gnutls_recv_finished (mhd_gtls_session_t session) | 566 | _gnutls_recv_finished (mhd_gtls_session_t session) |
567 | { | 567 | { |
568 | uint8_t data[36], *vrfy; | 568 | uint8_t data[36], *vrfy; |
@@ -796,7 +796,7 @@ finish: | |||
796 | 796 | ||
797 | /* This selects the best supported compression method from the ones provided | 797 | /* This selects the best supported compression method from the ones provided |
798 | */ | 798 | */ |
799 | int | 799 | static int |
800 | _gnutls_server_select_comp_method (mhd_gtls_session_t session, | 800 | _gnutls_server_select_comp_method (mhd_gtls_session_t session, |
801 | opaque * data, int datalen) | 801 | opaque * data, int datalen) |
802 | { | 802 | { |
@@ -850,7 +850,7 @@ _gnutls_server_select_comp_method (mhd_gtls_session_t session, | |||
850 | * GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED, then it must be called again | 850 | * GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED, then it must be called again |
851 | * (until it returns ok), with NULL parameters. | 851 | * (until it returns ok), with NULL parameters. |
852 | */ | 852 | */ |
853 | int | 853 | static int |
854 | _gnutls_send_empty_handshake (mhd_gtls_session_t session, | 854 | _gnutls_send_empty_handshake (mhd_gtls_session_t session, |
855 | gnutls_handshake_description_t type, int again) | 855 | gnutls_handshake_description_t type, int again) |
856 | { | 856 | { |
@@ -1964,13 +1964,14 @@ int | |||
1964 | mhd_gtls_send_hello (mhd_gtls_session_t session, int again) | 1964 | mhd_gtls_send_hello (mhd_gtls_session_t session, int again) |
1965 | { | 1965 | { |
1966 | int ret; | 1966 | int ret; |
1967 | 1967 | #if MHD_DEBUG_TLS | |
1968 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 1968 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
1969 | { | 1969 | { |
1970 | ret = _gnutls_send_client_hello (session, again); | 1970 | ret = _gnutls_send_client_hello (session, again); |
1971 | 1971 | ||
1972 | } | 1972 | } |
1973 | else | 1973 | else |
1974 | #endif | ||
1974 | { /* SERVER */ | 1975 | { /* SERVER */ |
1975 | ret = _gnutls_send_server_hello (session, again); | 1976 | ret = _gnutls_send_server_hello (session, again); |
1976 | } | 1977 | } |
@@ -1986,7 +1987,7 @@ int | |||
1986 | mhd_gtls_recv_hello (mhd_gtls_session_t session, opaque * data, int datalen) | 1987 | mhd_gtls_recv_hello (mhd_gtls_session_t session, opaque * data, int datalen) |
1987 | { | 1988 | { |
1988 | int ret; | 1989 | int ret; |
1989 | 1990 | #if MHD_DEBUG_TLS | |
1990 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 1991 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
1991 | { | 1992 | { |
1992 | ret = _gnutls_read_server_hello (session, data, datalen); | 1993 | ret = _gnutls_read_server_hello (session, data, datalen); |
@@ -1997,6 +1998,7 @@ mhd_gtls_recv_hello (mhd_gtls_session_t session, opaque * data, int datalen) | |||
1997 | } | 1998 | } |
1998 | } | 1999 | } |
1999 | else | 2000 | else |
2001 | #endif | ||
2000 | { /* Server side reading a client hello */ | 2002 | { /* Server side reading a client hello */ |
2001 | 2003 | ||
2002 | ret = _gnutls_read_client_hello (session, data, datalen); | 2004 | ret = _gnutls_read_client_hello (session, data, datalen); |
@@ -2126,7 +2128,7 @@ _gnutls_handshake_hash_init (mhd_gtls_session_t session) | |||
2126 | return 0; | 2128 | return 0; |
2127 | } | 2129 | } |
2128 | 2130 | ||
2129 | int | 2131 | static int |
2130 | _gnutls_send_supplemental (mhd_gtls_session_t session, int again) | 2132 | _gnutls_send_supplemental (mhd_gtls_session_t session, int again) |
2131 | { | 2133 | { |
2132 | int ret = 0; | 2134 | int ret = 0; |
@@ -2156,7 +2158,7 @@ _gnutls_send_supplemental (mhd_gtls_session_t session, int again) | |||
2156 | return ret; | 2158 | return ret; |
2157 | } | 2159 | } |
2158 | 2160 | ||
2159 | int | 2161 | static int |
2160 | _gnutls_recv_supplemental (mhd_gtls_session_t session) | 2162 | _gnutls_recv_supplemental (mhd_gtls_session_t session) |
2161 | { | 2163 | { |
2162 | uint8_t *data = NULL; | 2164 | uint8_t *data = NULL; |
@@ -2223,12 +2225,13 @@ MHD_gnutls_handshake (mhd_gtls_session_t session) | |||
2223 | gnutls_assert (); | 2225 | gnutls_assert (); |
2224 | return ret; | 2226 | return ret; |
2225 | } | 2227 | } |
2226 | 2228 | #if MHD_DEBUG_TLS | |
2227 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 2229 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
2228 | { | 2230 | { |
2229 | ret = mhd_gtls_handshake_client (session); | 2231 | ret = mhd_gtls_handshake_client (session); |
2230 | } | 2232 | } |
2231 | else | 2233 | else |
2234 | #endif | ||
2232 | { | 2235 | { |
2233 | ret = mhd_gtls_handshake_server (session); | 2236 | ret = mhd_gtls_handshake_server (session); |
2234 | } | 2237 | } |
diff --git a/src/daemon/https/tls/gnutls_handshake.h b/src/daemon/https/tls/gnutls_handshake.h index 9917fdc7..4651d7fb 100644 --- a/src/daemon/https/tls/gnutls_handshake.h +++ b/src/daemon/https/tls/gnutls_handshake.h | |||
@@ -37,7 +37,6 @@ int mhd_gtls_recv_handshake (mhd_gtls_session_t session, uint8_t **, int *, | |||
37 | Optional optional); | 37 | Optional optional); |
38 | int mhd_gtls_generate_session_id (opaque * session_id, uint8_t * len); | 38 | int mhd_gtls_generate_session_id (opaque * session_id, uint8_t * len); |
39 | int mhd_gtls_handshake_common (mhd_gtls_session_t session); | 39 | int mhd_gtls_handshake_common (mhd_gtls_session_t session); |
40 | int mhd_gtls_handshake_client (mhd_gtls_session_t session); | ||
41 | int mhd_gtls_handshake_server (mhd_gtls_session_t session); | 40 | int mhd_gtls_handshake_server (mhd_gtls_session_t session); |
42 | void mhd_gtls_set_server_random (mhd_gtls_session_t session, uint8_t * rnd); | 41 | void mhd_gtls_set_server_random (mhd_gtls_session_t session, uint8_t * rnd); |
43 | void mhd_gtls_set_client_random (mhd_gtls_session_t session, uint8_t * rnd); | 42 | void mhd_gtls_set_client_random (mhd_gtls_session_t session, uint8_t * rnd); |
@@ -53,6 +52,10 @@ int mhd_gtls_server_select_suite (mhd_gtls_session_t session, opaque * data, | |||
53 | int mhd_gtls_negotiate_version( mhd_gtls_session_t session, gnutls_protocol_t adv_version); | 52 | int mhd_gtls_negotiate_version( mhd_gtls_session_t session, gnutls_protocol_t adv_version); |
54 | int mhd_gtls_user_hello_func( gnutls_session, gnutls_protocol_t adv_version); | 53 | int mhd_gtls_user_hello_func( gnutls_session, gnutls_protocol_t adv_version); |
55 | 54 | ||
55 | #if MHD_DEBUG_TLS | ||
56 | int mhd_gtls_handshake_client (mhd_gtls_session_t session); | ||
57 | #endif | ||
58 | |||
56 | #define STATE session->internals.handshake_state | 59 | #define STATE session->internals.handshake_state |
57 | /* This returns true if we have got there | 60 | /* This returns true if we have got there |
58 | * before (and not finished due to an interrupt). | 61 | * before (and not finished due to an interrupt). |
diff --git a/src/daemon/https/tls/gnutls_mpi.c b/src/daemon/https/tls/gnutls_mpi.c index 6e2b5c4f..250c9c77 100644 --- a/src/daemon/https/tls/gnutls_mpi.c +++ b/src/daemon/https/tls/gnutls_mpi.c | |||
@@ -206,7 +206,7 @@ _gnutls_x509_read_int (ASN1_TYPE node, const char *value, mpi_t * ret_mpi) | |||
206 | if (result != ASN1_MEM_ERROR) | 206 | if (result != ASN1_MEM_ERROR) |
207 | { | 207 | { |
208 | gnutls_assert (); | 208 | gnutls_assert (); |
209 | return _gnutls_asn2err (result); | 209 | return mhd_gtls_asn2err (result); |
210 | } | 210 | } |
211 | 211 | ||
212 | tmpstr = gnutls_alloca (tmpstr_size); | 212 | tmpstr = gnutls_alloca (tmpstr_size); |
@@ -221,7 +221,7 @@ _gnutls_x509_read_int (ASN1_TYPE node, const char *value, mpi_t * ret_mpi) | |||
221 | { | 221 | { |
222 | gnutls_assert (); | 222 | gnutls_assert (); |
223 | gnutls_afree (tmpstr); | 223 | gnutls_afree (tmpstr); |
224 | return _gnutls_asn2err (result); | 224 | return mhd_gtls_asn2err (result); |
225 | } | 225 | } |
226 | 226 | ||
227 | s_len = tmpstr_size; | 227 | s_len = tmpstr_size; |
@@ -278,7 +278,7 @@ _gnutls_x509_write_int (ASN1_TYPE node, const char *value, mpi_t mpi, int lz) | |||
278 | if (result != ASN1_SUCCESS) | 278 | if (result != ASN1_SUCCESS) |
279 | { | 279 | { |
280 | gnutls_assert (); | 280 | gnutls_assert (); |
281 | return _gnutls_asn2err (result); | 281 | return mhd_gtls_asn2err (result); |
282 | } | 282 | } |
283 | 283 | ||
284 | return 0; | 284 | return 0; |
diff --git a/src/daemon/https/tls/gnutls_pk.c b/src/daemon/https/tls/gnutls_pk.c index 2e748bab..b1361c0b 100644 --- a/src/daemon/https/tls/gnutls_pk.c +++ b/src/daemon/https/tls/gnutls_pk.c | |||
@@ -395,7 +395,7 @@ encode_ber_rs (gnutls_datum_t * sig_value, mpi_t r, mpi_t s) | |||
395 | &sig)) != ASN1_SUCCESS) | 395 | &sig)) != ASN1_SUCCESS) |
396 | { | 396 | { |
397 | gnutls_assert (); | 397 | gnutls_assert (); |
398 | return _gnutls_asn2err (result); | 398 | return mhd_gtls_asn2err (result); |
399 | } | 399 | } |
400 | 400 | ||
401 | result = _gnutls_x509_write_int (sig, "r", r, 1); | 401 | result = _gnutls_x509_write_int (sig, "r", r, 1); |
@@ -493,7 +493,7 @@ decode_ber_rs (const gnutls_datum_t * sig_value, mpi_t * r, mpi_t * s) | |||
493 | &sig)) != ASN1_SUCCESS) | 493 | &sig)) != ASN1_SUCCESS) |
494 | { | 494 | { |
495 | gnutls_assert (); | 495 | gnutls_assert (); |
496 | return _gnutls_asn2err (result); | 496 | return mhd_gtls_asn2err (result); |
497 | } | 497 | } |
498 | 498 | ||
499 | result = asn1_der_decoding (&sig, sig_value->data, sig_value->size, NULL); | 499 | result = asn1_der_decoding (&sig, sig_value->data, sig_value->size, NULL); |
@@ -501,7 +501,7 @@ decode_ber_rs (const gnutls_datum_t * sig_value, mpi_t * r, mpi_t * s) | |||
501 | { | 501 | { |
502 | gnutls_assert (); | 502 | gnutls_assert (); |
503 | asn1_delete_structure (&sig); | 503 | asn1_delete_structure (&sig); |
504 | return _gnutls_asn2err (result); | 504 | return mhd_gtls_asn2err (result); |
505 | } | 505 | } |
506 | 506 | ||
507 | result = _gnutls_x509_read_int (sig, "r", r); | 507 | result = _gnutls_x509_read_int (sig, "r", r); |
diff --git a/src/daemon/https/tls/gnutls_priority.c b/src/daemon/https/tls/gnutls_priority.c index e865fd27..c36f898a 100644 --- a/src/daemon/https/tls/gnutls_priority.c +++ b/src/daemon/https/tls/gnutls_priority.c | |||
@@ -208,30 +208,30 @@ MHD_gnutls_certificate_type_set_priority (mhd_gtls_session_t session, | |||
208 | #endif | 208 | #endif |
209 | } | 209 | } |
210 | 210 | ||
211 | static const int protocol_priority[] = { MHD_GNUTLS_TLS1_1, | 211 | static const int mhd_gtls_protocol_priority[] = { MHD_GNUTLS_TLS1_1, |
212 | MHD_GNUTLS_TLS1_0, | 212 | MHD_GNUTLS_TLS1_0, |
213 | MHD_GNUTLS_SSL3, | 213 | MHD_GNUTLS_SSL3, |
214 | 0 | 214 | 0 |
215 | }; | 215 | }; |
216 | 216 | ||
217 | static const int cipher_priority_secure256[] = | 217 | static const int mhd_gtls_cipher_priority_secure256[] = |
218 | { MHD_GNUTLS_CIPHER_AES_256_CBC, | 218 | { MHD_GNUTLS_CIPHER_AES_256_CBC, |
219 | 0 | 219 | 0 |
220 | }; | 220 | }; |
221 | 221 | ||
222 | static const int kx_priority_secure[] = { MHD_GNUTLS_KX_RSA, | 222 | static const int mhd_gtls_kx_priority_secure[] = { MHD_GNUTLS_KX_RSA, |
223 | 0 | 223 | 0 |
224 | }; | 224 | }; |
225 | 225 | ||
226 | static const int mac_priority_secure[] = { MHD_GNUTLS_MAC_SHA1, | 226 | static const int mhd_gtls_mac_priority_secure[] = { MHD_GNUTLS_MAC_SHA1, |
227 | 0 | 227 | 0 |
228 | }; | 228 | }; |
229 | 229 | ||
230 | static int cert_type_priority[] = { MHD_GNUTLS_CRT_X509, | 230 | static int mhd_gtls_cert_type_priority[] = { MHD_GNUTLS_CRT_X509, |
231 | 0 | 231 | 0 |
232 | }; | 232 | }; |
233 | 233 | ||
234 | static const int comp_priority[] = { MHD_GNUTLS_COMP_NULL, | 234 | static const int mhd_gtls_comp_priority[] = { MHD_GNUTLS_COMP_NULL, |
235 | 0 | 235 | 0 |
236 | }; | 236 | }; |
237 | 237 | ||
@@ -340,12 +340,12 @@ MHD_tls_set_default_priority (gnutls_priority_t * priority_cache, | |||
340 | } | 340 | } |
341 | 341 | ||
342 | /* set mode to "SECURE256" */ | 342 | /* set mode to "SECURE256" */ |
343 | _set_priority (&(*priority_cache)->protocol, protocol_priority); | 343 | _set_priority (&(*priority_cache)->protocol, mhd_gtls_protocol_priority); |
344 | _set_priority (&(*priority_cache)->cipher, cipher_priority_secure256); | 344 | _set_priority (&(*priority_cache)->cipher, mhd_gtls_cipher_priority_secure256); |
345 | _set_priority (&(*priority_cache)->kx, kx_priority_secure); | 345 | _set_priority (&(*priority_cache)->kx, mhd_gtls_kx_priority_secure); |
346 | _set_priority (&(*priority_cache)->mac, mac_priority_secure); | 346 | _set_priority (&(*priority_cache)->mac, mhd_gtls_mac_priority_secure); |
347 | _set_priority (&(*priority_cache)->cert_type, cert_type_priority); | 347 | _set_priority (&(*priority_cache)->cert_type, mhd_gtls_cert_type_priority); |
348 | _set_priority (&(*priority_cache)->compression, comp_priority); | 348 | _set_priority (&(*priority_cache)->compression, mhd_gtls_comp_priority); |
349 | 349 | ||
350 | (*priority_cache)->no_padding = 0; | 350 | (*priority_cache)->no_padding = 0; |
351 | return 0; | 351 | return 0; |
diff --git a/src/daemon/https/tls/gnutls_session.c b/src/daemon/https/tls/gnutls_session.c index 94c7405b..afc00966 100644 --- a/src/daemon/https/tls/gnutls_session.c +++ b/src/daemon/https/tls/gnutls_session.c | |||
@@ -55,7 +55,7 @@ | |||
55 | // | 55 | // |
56 | // psession.data = session_data; | 56 | // psession.data = session_data; |
57 | // | 57 | // |
58 | // ret = _gnutls_session_pack (session, &psession); | 58 | // ret = mhd_gtls_session_pack (session, &psession); |
59 | // if (ret < 0) | 59 | // if (ret < 0) |
60 | // { | 60 | // { |
61 | // gnutls_assert (); | 61 | // gnutls_assert (); |
@@ -106,7 +106,7 @@ | |||
106 | // if (session->internals.resumable == RESUME_FALSE) | 106 | // if (session->internals.resumable == RESUME_FALSE) |
107 | // return GNUTLS_E_INVALID_SESSION; | 107 | // return GNUTLS_E_INVALID_SESSION; |
108 | // | 108 | // |
109 | // ret = _gnutls_session_pack (session, data); | 109 | // ret = mhd_gtls_session_pack (session, data); |
110 | // if (ret < 0) | 110 | // if (ret < 0) |
111 | // { | 111 | // { |
112 | // gnutls_assert (); | 112 | // gnutls_assert (); |
@@ -190,7 +190,7 @@ MHD_gtls_session_get_id (mhd_gtls_session_t session, | |||
190 | // gnutls_assert (); | 190 | // gnutls_assert (); |
191 | // return GNUTLS_E_INVALID_REQUEST; | 191 | // return GNUTLS_E_INVALID_REQUEST; |
192 | // } | 192 | // } |
193 | // ret = _gnutls_session_unpack (session, &psession); | 193 | // ret = mhd_gtls_session_unpack (session, &psession); |
194 | // if (ret < 0) | 194 | // if (ret < 0) |
195 | // { | 195 | // { |
196 | // gnutls_assert (); | 196 | // gnutls_assert (); |
diff --git a/src/daemon/https/tls/gnutls_session_pack.c b/src/daemon/https/tls/gnutls_session_pack.c index c11f6d77..545e4a0c 100644 --- a/src/daemon/https/tls/gnutls_session_pack.c +++ b/src/daemon/https/tls/gnutls_session_pack.c | |||
@@ -227,7 +227,7 @@ error: | |||
227 | * The data will be in a platform independent format. | 227 | * The data will be in a platform independent format. |
228 | */ | 228 | */ |
229 | int | 229 | int |
230 | _gnutls_session_pack (mhd_gtls_session_t session, | 230 | mhd_gtls_session_pack (mhd_gtls_session_t session, |
231 | gnutls_datum_t * packed_session) | 231 | gnutls_datum_t * packed_session) |
232 | { | 232 | { |
233 | int ret; | 233 | int ret; |
@@ -302,7 +302,7 @@ _gnutls_session_pack (mhd_gtls_session_t session, | |||
302 | /* Load session data from a buffer. | 302 | /* Load session data from a buffer. |
303 | */ | 303 | */ |
304 | int | 304 | int |
305 | _gnutls_session_unpack (mhd_gtls_session_t session, | 305 | mhd_gtls_session_unpack (mhd_gtls_session_t session, |
306 | const gnutls_datum_t * packed_session) | 306 | const gnutls_datum_t * packed_session) |
307 | { | 307 | { |
308 | int ret; | 308 | int ret; |
diff --git a/src/daemon/https/tls/gnutls_session_pack.h b/src/daemon/https/tls/gnutls_session_pack.h index abc3fe46..fa47f9e1 100644 --- a/src/daemon/https/tls/gnutls_session_pack.h +++ b/src/daemon/https/tls/gnutls_session_pack.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | int _gnutls_session_pack (mhd_gtls_session_t session, | 25 | int mhd_gtls_session_pack (mhd_gtls_session_t session, |
26 | gnutls_datum_t * packed_session); | 26 | gnutls_datum_t * packed_session); |
27 | int _gnutls_session_unpack (mhd_gtls_session_t session, | 27 | int mhd_gtls_session_unpack (mhd_gtls_session_t session, |
28 | const gnutls_datum_t * packed_session); | 28 | const gnutls_datum_t * packed_session); |
diff --git a/src/daemon/https/tls/gnutls_state.c b/src/daemon/https/tls/gnutls_state.c index bb5b8390..02d87e05 100644 --- a/src/daemon/https/tls/gnutls_state.c +++ b/src/daemon/https/tls/gnutls_state.c | |||
@@ -429,7 +429,7 @@ mhd_gtls_dh_get_allowed_prime_bits (mhd_gtls_session_t session) | |||
429 | int | 429 | int |
430 | mhd_gtls_dh_set_peer_public (mhd_gtls_session_t session, mpi_t public) | 430 | mhd_gtls_dh_set_peer_public (mhd_gtls_session_t session, mpi_t public) |
431 | { | 431 | { |
432 | dh_info_st *dh; | 432 | mhd_gtls_dh_info_st *dh; |
433 | int ret; | 433 | int ret; |
434 | 434 | ||
435 | switch (MHD_gtls_auth_get_type (session)) | 435 | switch (MHD_gtls_auth_get_type (session)) |
@@ -540,7 +540,7 @@ mhd_gtls_rsa_export_set_pubkey (mhd_gtls_session_t session, | |||
540 | int | 540 | int |
541 | mhd_gtls_dh_set_group (mhd_gtls_session_t session, mpi_t gen, mpi_t prime) | 541 | mhd_gtls_dh_set_group (mhd_gtls_session_t session, mpi_t gen, mpi_t prime) |
542 | { | 542 | { |
543 | dh_info_st *dh; | 543 | mhd_gtls_dh_info_st *dh; |
544 | int ret; | 544 | int ret; |
545 | 545 | ||
546 | switch (MHD_gtls_auth_get_type (session)) | 546 | switch (MHD_gtls_auth_get_type (session)) |
@@ -1060,6 +1060,7 @@ MHD_gtls_session_get_master_secret (mhd_gtls_session_t session) | |||
1060 | int | 1060 | int |
1061 | MHD_gtls_session_is_resumed (mhd_gtls_session_t session) | 1061 | MHD_gtls_session_is_resumed (mhd_gtls_session_t session) |
1062 | { | 1062 | { |
1063 | #if MHD_DEBUG_TLS | ||
1063 | if (session->security_parameters.entity == GNUTLS_CLIENT) | 1064 | if (session->security_parameters.entity == GNUTLS_CLIENT) |
1064 | { | 1065 | { |
1065 | if (session->security_parameters.session_id_size > 0 | 1066 | if (session->security_parameters.session_id_size > 0 |
@@ -1072,6 +1073,7 @@ MHD_gtls_session_is_resumed (mhd_gtls_session_t session) | |||
1072 | return 1; | 1073 | return 1; |
1073 | } | 1074 | } |
1074 | else | 1075 | else |
1076 | #endif | ||
1075 | { | 1077 | { |
1076 | if (session->internals.resumed == RESUME_TRUE) | 1078 | if (session->internals.resumed == RESUME_TRUE) |
1077 | return 1; | 1079 | return 1; |
diff --git a/src/daemon/https/tls/gnutls_ui.c b/src/daemon/https/tls/gnutls_ui.c index b5b0fbee..8a4d9c11 100644 --- a/src/daemon/https/tls/gnutls_ui.c +++ b/src/daemon/https/tls/gnutls_ui.c | |||
@@ -76,7 +76,7 @@ int | |||
76 | MHD_gnutls_dh_get_group (mhd_gtls_session_t session, | 76 | MHD_gnutls_dh_get_group (mhd_gtls_session_t session, |
77 | gnutls_datum_t * raw_gen, gnutls_datum_t * raw_prime) | 77 | gnutls_datum_t * raw_gen, gnutls_datum_t * raw_prime) |
78 | { | 78 | { |
79 | dh_info_st *dh; | 79 | mhd_gtls_dh_info_st *dh; |
80 | int ret; | 80 | int ret; |
81 | mhd_anon_auth_info_t anon_info; | 81 | mhd_anon_auth_info_t anon_info; |
82 | cert_auth_info_t cert_info; | 82 | cert_auth_info_t cert_info; |
@@ -133,7 +133,7 @@ MHD_gnutls_dh_get_group (mhd_gtls_session_t session, | |||
133 | int | 133 | int |
134 | MHD_gnutls_dh_get_pubkey (mhd_gtls_session_t session, gnutls_datum_t * raw_key) | 134 | MHD_gnutls_dh_get_pubkey (mhd_gtls_session_t session, gnutls_datum_t * raw_key) |
135 | { | 135 | { |
136 | dh_info_st *dh; | 136 | mhd_gtls_dh_info_st *dh; |
137 | mhd_anon_auth_info_t anon_info; | 137 | mhd_anon_auth_info_t anon_info; |
138 | cert_auth_info_t cert_info; | 138 | cert_auth_info_t cert_info; |
139 | cert_auth_info_t psk_info; | 139 | cert_auth_info_t psk_info; |
@@ -275,7 +275,7 @@ MHD_gnutls_dh_get_secret_bits (mhd_gtls_session_t session) | |||
275 | int | 275 | int |
276 | MHD_gnutls_dh_get_prime_bits (mhd_gtls_session_t session) | 276 | MHD_gnutls_dh_get_prime_bits (mhd_gtls_session_t session) |
277 | { | 277 | { |
278 | dh_info_st *dh; | 278 | mhd_gtls_dh_info_st *dh; |
279 | 279 | ||
280 | switch (MHD_gtls_auth_get_type (session)) | 280 | switch (MHD_gtls_auth_get_type (session)) |
281 | { | 281 | { |
@@ -342,7 +342,7 @@ MHD_gtls_rsa_export_get_modulus_bits (mhd_gtls_session_t session) | |||
342 | int | 342 | int |
343 | MHD_gnutls_dh_get_peers_public_bits (mhd_gtls_session_t session) | 343 | MHD_gnutls_dh_get_peers_public_bits (mhd_gtls_session_t session) |
344 | { | 344 | { |
345 | dh_info_st *dh; | 345 | mhd_gtls_dh_info_st *dh; |
346 | 346 | ||
347 | switch (MHD_gtls_auth_get_type (session)) | 347 | switch (MHD_gtls_auth_get_type (session)) |
348 | { | 348 | { |
diff --git a/src/daemon/https/x509/common.c b/src/daemon/https/x509/common.c index b31edcec..f3dde1d1 100644 --- a/src/daemon/https/x509/common.c +++ b/src/daemon/https/x509/common.c | |||
@@ -295,7 +295,7 @@ _gnutls_x509_oid_data2string (const char *oid, | |||
295 | &tmpasn)) != ASN1_SUCCESS) | 295 | &tmpasn)) != ASN1_SUCCESS) |
296 | { | 296 | { |
297 | gnutls_assert (); | 297 | gnutls_assert (); |
298 | return _gnutls_asn2err (result); | 298 | return mhd_gtls_asn2err (result); |
299 | } | 299 | } |
300 | 300 | ||
301 | if ((result = asn1_der_decoding (&tmpasn, value, value_size, asn1_err)) | 301 | if ((result = asn1_der_decoding (&tmpasn, value, value_size, asn1_err)) |
@@ -304,7 +304,7 @@ _gnutls_x509_oid_data2string (const char *oid, | |||
304 | gnutls_assert (); | 304 | gnutls_assert (); |
305 | _gnutls_x509_log ("asn1_der_decoding: %s:%s\n", str, asn1_err); | 305 | _gnutls_x509_log ("asn1_der_decoding: %s:%s\n", str, asn1_err); |
306 | asn1_delete_structure (&tmpasn); | 306 | asn1_delete_structure (&tmpasn); |
307 | return _gnutls_asn2err (result); | 307 | return mhd_gtls_asn2err (result); |
308 | } | 308 | } |
309 | 309 | ||
310 | /* If this is a choice then we read the choice. Otherwise it | 310 | /* If this is a choice then we read the choice. Otherwise it |
@@ -315,7 +315,7 @@ _gnutls_x509_oid_data2string (const char *oid, | |||
315 | { /* CHOICE */ | 315 | { /* CHOICE */ |
316 | gnutls_assert (); | 316 | gnutls_assert (); |
317 | asn1_delete_structure (&tmpasn); | 317 | asn1_delete_structure (&tmpasn); |
318 | return _gnutls_asn2err (result); | 318 | return mhd_gtls_asn2err (result); |
319 | } | 319 | } |
320 | 320 | ||
321 | if (CHOICE == 0) | 321 | if (CHOICE == 0) |
@@ -352,7 +352,7 @@ _gnutls_x509_oid_data2string (const char *oid, | |||
352 | != ASN1_SUCCESS) | 352 | != ASN1_SUCCESS) |
353 | { | 353 | { |
354 | asn1_delete_structure (&tmpasn); | 354 | asn1_delete_structure (&tmpasn); |
355 | return _gnutls_asn2err (result); | 355 | return mhd_gtls_asn2err (result); |
356 | } | 356 | } |
357 | 357 | ||
358 | asn1_delete_structure (&tmpasn); | 358 | asn1_delete_structure (&tmpasn); |
@@ -750,7 +750,7 @@ _gnutls_x509_set_time (ASN1_TYPE c2, const char *where, time_t tim) | |||
750 | if ((result = asn1_write_value (c2, name, "utcTime", 1)) < 0) | 750 | if ((result = asn1_write_value (c2, name, "utcTime", 1)) < 0) |
751 | { | 751 | { |
752 | gnutls_assert (); | 752 | gnutls_assert (); |
753 | return _gnutls_asn2err (result); | 753 | return mhd_gtls_asn2err (result); |
754 | } | 754 | } |
755 | 755 | ||
756 | result = _gnutls_x509_gtime2utcTime (tim, str_time, sizeof (str_time)); | 756 | result = _gnutls_x509_gtime2utcTime (tim, str_time, sizeof (str_time)); |
@@ -767,7 +767,7 @@ _gnutls_x509_set_time (ASN1_TYPE c2, const char *where, time_t tim) | |||
767 | if (result != ASN1_SUCCESS) | 767 | if (result != ASN1_SUCCESS) |
768 | { | 768 | { |
769 | gnutls_assert (); | 769 | gnutls_assert (); |
770 | return _gnutls_asn2err (result); | 770 | return mhd_gtls_asn2err (result); |
771 | } | 771 | } |
772 | 772 | ||
773 | return 0; | 773 | return 0; |
@@ -820,7 +820,7 @@ _gnutls_x509_export_int (ASN1_TYPE asn1_data, | |||
820 | return GNUTLS_E_SHORT_MEMORY_BUFFER; | 820 | return GNUTLS_E_SHORT_MEMORY_BUFFER; |
821 | } | 821 | } |
822 | gnutls_assert (); | 822 | gnutls_assert (); |
823 | return _gnutls_asn2err (result); | 823 | return mhd_gtls_asn2err (result); |
824 | } | 824 | } |
825 | 825 | ||
826 | *output_data_size = len; | 826 | *output_data_size = len; |
@@ -906,7 +906,7 @@ _gnutls_x509_decode_octet_string (const char *string_type, | |||
906 | &c2)) != ASN1_SUCCESS) | 906 | &c2)) != ASN1_SUCCESS) |
907 | { | 907 | { |
908 | gnutls_assert (); | 908 | gnutls_assert (); |
909 | result = _gnutls_asn2err (result); | 909 | result = mhd_gtls_asn2err (result); |
910 | goto cleanup; | 910 | goto cleanup; |
911 | } | 911 | } |
912 | 912 | ||
@@ -914,7 +914,7 @@ _gnutls_x509_decode_octet_string (const char *string_type, | |||
914 | if (result != ASN1_SUCCESS) | 914 | if (result != ASN1_SUCCESS) |
915 | { | 915 | { |
916 | gnutls_assert (); | 916 | gnutls_assert (); |
917 | result = _gnutls_asn2err (result); | 917 | result = mhd_gtls_asn2err (result); |
918 | goto cleanup; | 918 | goto cleanup; |
919 | } | 919 | } |
920 | 920 | ||
@@ -925,7 +925,7 @@ _gnutls_x509_decode_octet_string (const char *string_type, | |||
925 | if (result != ASN1_SUCCESS) | 925 | if (result != ASN1_SUCCESS) |
926 | { | 926 | { |
927 | gnutls_assert (); | 927 | gnutls_assert (); |
928 | result = _gnutls_asn2err (result); | 928 | result = mhd_gtls_asn2err (result); |
929 | goto cleanup; | 929 | goto cleanup; |
930 | } | 930 | } |
931 | 931 | ||
@@ -955,7 +955,7 @@ _gnutls_x509_read_value (ASN1_TYPE c, | |||
955 | if (result != ASN1_MEM_ERROR) | 955 | if (result != ASN1_MEM_ERROR) |
956 | { | 956 | { |
957 | gnutls_assert (); | 957 | gnutls_assert (); |
958 | result = _gnutls_asn2err (result); | 958 | result = mhd_gtls_asn2err (result); |
959 | return result; | 959 | return result; |
960 | } | 960 | } |
961 | 961 | ||
@@ -974,7 +974,7 @@ _gnutls_x509_read_value (ASN1_TYPE c, | |||
974 | if (result != ASN1_SUCCESS) | 974 | if (result != ASN1_SUCCESS) |
975 | { | 975 | { |
976 | gnutls_assert (); | 976 | gnutls_assert (); |
977 | result = _gnutls_asn2err (result); | 977 | result = mhd_gtls_asn2err (result); |
978 | goto cleanup; | 978 | goto cleanup; |
979 | } | 979 | } |
980 | 980 | ||
@@ -1024,7 +1024,7 @@ _gnutls_x509_der_encode (ASN1_TYPE src, | |||
1024 | if (result != ASN1_MEM_ERROR) | 1024 | if (result != ASN1_MEM_ERROR) |
1025 | { | 1025 | { |
1026 | gnutls_assert (); | 1026 | gnutls_assert (); |
1027 | result = _gnutls_asn2err (result); | 1027 | result = mhd_gtls_asn2err (result); |
1028 | goto cleanup; | 1028 | goto cleanup; |
1029 | } | 1029 | } |
1030 | 1030 | ||
@@ -1047,7 +1047,7 @@ _gnutls_x509_der_encode (ASN1_TYPE src, | |||
1047 | if (result != ASN1_SUCCESS) | 1047 | if (result != ASN1_SUCCESS) |
1048 | { | 1048 | { |
1049 | gnutls_assert (); | 1049 | gnutls_assert (); |
1050 | result = _gnutls_asn2err (result); | 1050 | result = mhd_gtls_asn2err (result); |
1051 | goto cleanup; | 1051 | goto cleanup; |
1052 | } | 1052 | } |
1053 | 1053 | ||
@@ -1058,7 +1058,7 @@ _gnutls_x509_der_encode (ASN1_TYPE src, | |||
1058 | &c2)) != ASN1_SUCCESS) | 1058 | &c2)) != ASN1_SUCCESS) |
1059 | { | 1059 | { |
1060 | gnutls_assert (); | 1060 | gnutls_assert (); |
1061 | result = _gnutls_asn2err (result); | 1061 | result = mhd_gtls_asn2err (result); |
1062 | goto cleanup; | 1062 | goto cleanup; |
1063 | } | 1063 | } |
1064 | 1064 | ||
@@ -1066,7 +1066,7 @@ _gnutls_x509_der_encode (ASN1_TYPE src, | |||
1066 | if (result != ASN1_SUCCESS) | 1066 | if (result != ASN1_SUCCESS) |
1067 | { | 1067 | { |
1068 | gnutls_assert (); | 1068 | gnutls_assert (); |
1069 | result = _gnutls_asn2err (result); | 1069 | result = mhd_gtls_asn2err (result); |
1070 | goto cleanup; | 1070 | goto cleanup; |
1071 | } | 1071 | } |
1072 | 1072 | ||
@@ -1074,7 +1074,7 @@ _gnutls_x509_der_encode (ASN1_TYPE src, | |||
1074 | if (result != ASN1_SUCCESS) | 1074 | if (result != ASN1_SUCCESS) |
1075 | { | 1075 | { |
1076 | gnutls_assert (); | 1076 | gnutls_assert (); |
1077 | result = _gnutls_asn2err (result); | 1077 | result = mhd_gtls_asn2err (result); |
1078 | goto cleanup; | 1078 | goto cleanup; |
1079 | } | 1079 | } |
1080 | 1080 | ||
@@ -1124,7 +1124,7 @@ _gnutls_x509_der_encode_and_copy (ASN1_TYPE src, | |||
1124 | if (result != ASN1_SUCCESS) | 1124 | if (result != ASN1_SUCCESS) |
1125 | { | 1125 | { |
1126 | gnutls_assert (); | 1126 | gnutls_assert (); |
1127 | return _gnutls_asn2err (result); | 1127 | return mhd_gtls_asn2err (result); |
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | return 0; | 1130 | return 0; |
@@ -1162,7 +1162,7 @@ _gnutls_x509_write_value (ASN1_TYPE c, | |||
1162 | &c2)) != ASN1_SUCCESS) | 1162 | &c2)) != ASN1_SUCCESS) |
1163 | { | 1163 | { |
1164 | gnutls_assert (); | 1164 | gnutls_assert (); |
1165 | result = _gnutls_asn2err (result); | 1165 | result = mhd_gtls_asn2err (result); |
1166 | goto cleanup; | 1166 | goto cleanup; |
1167 | } | 1167 | } |
1168 | 1168 | ||
@@ -1170,7 +1170,7 @@ _gnutls_x509_write_value (ASN1_TYPE c, | |||
1170 | if (result != ASN1_SUCCESS) | 1170 | if (result != ASN1_SUCCESS) |
1171 | { | 1171 | { |
1172 | gnutls_assert (); | 1172 | gnutls_assert (); |
1173 | result = _gnutls_asn2err (result); | 1173 | result = mhd_gtls_asn2err (result); |
1174 | goto cleanup; | 1174 | goto cleanup; |
1175 | } | 1175 | } |
1176 | 1176 | ||
@@ -1198,7 +1198,7 @@ _gnutls_x509_write_value (ASN1_TYPE c, | |||
1198 | if (result != ASN1_SUCCESS) | 1198 | if (result != ASN1_SUCCESS) |
1199 | { | 1199 | { |
1200 | gnutls_assert (); | 1200 | gnutls_assert (); |
1201 | return _gnutls_asn2err (result); | 1201 | return mhd_gtls_asn2err (result); |
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | return 0; | 1204 | return 0; |
@@ -1241,7 +1241,7 @@ _gnutls_x509_encode_and_copy_PKI_params (ASN1_TYPE dst, | |||
1241 | if (result != ASN1_SUCCESS) | 1241 | if (result != ASN1_SUCCESS) |
1242 | { | 1242 | { |
1243 | gnutls_assert (); | 1243 | gnutls_assert (); |
1244 | return _gnutls_asn2err (result); | 1244 | return mhd_gtls_asn2err (result); |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | if (pk_algorithm == MHD_GNUTLS_PK_RSA) | 1247 | if (pk_algorithm == MHD_GNUTLS_PK_RSA) |
@@ -1254,7 +1254,7 @@ _gnutls_x509_encode_and_copy_PKI_params (ASN1_TYPE dst, | |||
1254 | if (result != ASN1_SUCCESS) | 1254 | if (result != ASN1_SUCCESS) |
1255 | { | 1255 | { |
1256 | gnutls_assert (); | 1256 | gnutls_assert (); |
1257 | return _gnutls_asn2err (result); | 1257 | return mhd_gtls_asn2err (result); |
1258 | } | 1258 | } |
1259 | 1259 | ||
1260 | result = _gnutls_x509_write_rsa_params (params, params_size, &der); | 1260 | result = _gnutls_x509_write_rsa_params (params, params_size, &der); |
@@ -1275,7 +1275,7 @@ _gnutls_x509_encode_and_copy_PKI_params (ASN1_TYPE dst, | |||
1275 | if (result != ASN1_SUCCESS) | 1275 | if (result != ASN1_SUCCESS) |
1276 | { | 1276 | { |
1277 | gnutls_assert (); | 1277 | gnutls_assert (); |
1278 | return _gnutls_asn2err (result); | 1278 | return mhd_gtls_asn2err (result); |
1279 | } | 1279 | } |
1280 | } | 1280 | } |
1281 | else | 1281 | else |
@@ -1308,7 +1308,7 @@ _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, | |||
1308 | if (result != ASN1_SUCCESS) | 1308 | if (result != ASN1_SUCCESS) |
1309 | { | 1309 | { |
1310 | gnutls_assert (); | 1310 | gnutls_assert (); |
1311 | return _gnutls_asn2err (result); | 1311 | return mhd_gtls_asn2err (result); |
1312 | } | 1312 | } |
1313 | 1313 | ||
1314 | algo = mhd_gtls_x509_oid2pk_algorithm (oid); | 1314 | algo = mhd_gtls_x509_oid2pk_algorithm (oid); |
@@ -1329,7 +1329,7 @@ _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, | |||
1329 | if (result != ASN1_MEM_ERROR) | 1329 | if (result != ASN1_MEM_ERROR) |
1330 | { | 1330 | { |
1331 | gnutls_assert (); | 1331 | gnutls_assert (); |
1332 | return _gnutls_asn2err (result); | 1332 | return mhd_gtls_asn2err (result); |
1333 | } | 1333 | } |
1334 | 1334 | ||
1335 | if (len % 8 != 0) | 1335 | if (len % 8 != 0) |
@@ -1356,7 +1356,7 @@ _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, | |||
1356 | { | 1356 | { |
1357 | gnutls_assert (); | 1357 | gnutls_assert (); |
1358 | gnutls_free (str); | 1358 | gnutls_free (str); |
1359 | return _gnutls_asn2err (result); | 1359 | return mhd_gtls_asn2err (result); |
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | len /= 8; | 1362 | len /= 8; |
@@ -1410,7 +1410,7 @@ _gnutls_x509_get_signed_data (ASN1_TYPE src, | |||
1410 | &start, &end); | 1410 | &start, &end); |
1411 | if (result != ASN1_SUCCESS) | 1411 | if (result != ASN1_SUCCESS) |
1412 | { | 1412 | { |
1413 | result = _gnutls_asn2err (result); | 1413 | result = mhd_gtls_asn2err (result); |
1414 | gnutls_assert (); | 1414 | gnutls_assert (); |
1415 | goto cleanup; | 1415 | goto cleanup; |
1416 | } | 1416 | } |
@@ -1449,7 +1449,7 @@ _gnutls_x509_get_signature (ASN1_TYPE src, | |||
1449 | 1449 | ||
1450 | if (result != ASN1_MEM_ERROR) | 1450 | if (result != ASN1_MEM_ERROR) |
1451 | { | 1451 | { |
1452 | result = _gnutls_asn2err (result); | 1452 | result = mhd_gtls_asn2err (result); |
1453 | gnutls_assert (); | 1453 | gnutls_assert (); |
1454 | goto cleanup; | 1454 | goto cleanup; |
1455 | } | 1455 | } |
@@ -1478,7 +1478,7 @@ _gnutls_x509_get_signature (ASN1_TYPE src, | |||
1478 | 1478 | ||
1479 | if (result != ASN1_SUCCESS) | 1479 | if (result != ASN1_SUCCESS) |
1480 | { | 1480 | { |
1481 | result = _gnutls_asn2err (result); | 1481 | result = mhd_gtls_asn2err (result); |
1482 | gnutls_assert (); | 1482 | gnutls_assert (); |
1483 | goto cleanup; | 1483 | goto cleanup; |
1484 | } | 1484 | } |
diff --git a/src/daemon/https/x509/crl.c b/src/daemon/https/x509/crl.c index 80dd6f9e..98eb4806 100644 --- a/src/daemon/https/x509/crl.c +++ b/src/daemon/https/x509/crl.c | |||
@@ -62,7 +62,7 @@ gnutls_x509_crl_init (gnutls_x509_crl_t * crl) | |||
62 | { | 62 | { |
63 | gnutls_assert (); | 63 | gnutls_assert (); |
64 | gnutls_free (*crl); | 64 | gnutls_free (*crl); |
65 | return _gnutls_asn2err (result); | 65 | return mhd_gtls_asn2err (result); |
66 | } | 66 | } |
67 | return 0; /* success */ | 67 | return 0; /* success */ |
68 | } | 68 | } |
@@ -145,7 +145,7 @@ gnutls_x509_crl_import (gnutls_x509_crl_t crl, | |||
145 | result = asn1_der_decoding (&crl->crl, _data.data, _data.size, NULL); | 145 | result = asn1_der_decoding (&crl->crl, _data.data, _data.size, NULL); |
146 | if (result != ASN1_SUCCESS) | 146 | if (result != ASN1_SUCCESS) |
147 | { | 147 | { |
148 | result = _gnutls_asn2err (result); | 148 | result = mhd_gtls_asn2err (result); |
149 | gnutls_assert (); | 149 | gnutls_assert (); |
150 | goto cleanup; | 150 | goto cleanup; |
151 | } | 151 | } |
@@ -340,7 +340,7 @@ gnutls_x509_crl_get_signature (gnutls_x509_crl_t crl, | |||
340 | if (result != ASN1_MEM_ERROR) | 340 | if (result != ASN1_MEM_ERROR) |
341 | { | 341 | { |
342 | gnutls_assert (); | 342 | gnutls_assert (); |
343 | return _gnutls_asn2err (result); | 343 | return mhd_gtls_asn2err (result); |
344 | } | 344 | } |
345 | 345 | ||
346 | if (bits % 8 != 0) | 346 | if (bits % 8 != 0) |
@@ -361,7 +361,7 @@ gnutls_x509_crl_get_signature (gnutls_x509_crl_t crl, | |||
361 | if (result != ASN1_SUCCESS) | 361 | if (result != ASN1_SUCCESS) |
362 | { | 362 | { |
363 | gnutls_assert (); | 363 | gnutls_assert (); |
364 | return _gnutls_asn2err (result); | 364 | return mhd_gtls_asn2err (result); |
365 | } | 365 | } |
366 | 366 | ||
367 | return 0; | 367 | return 0; |
@@ -394,7 +394,7 @@ gnutls_x509_crl_get_version (gnutls_x509_crl_t crl) | |||
394 | &len)) != ASN1_SUCCESS) | 394 | &len)) != ASN1_SUCCESS) |
395 | { | 395 | { |
396 | gnutls_assert (); | 396 | gnutls_assert (); |
397 | return _gnutls_asn2err (result); | 397 | return mhd_gtls_asn2err (result); |
398 | } | 398 | } |
399 | 399 | ||
400 | return (int) version[0] + 1; | 400 | return (int) version[0] + 1; |
@@ -523,7 +523,7 @@ gnutls_x509_crl_get_crt_serial (gnutls_x509_crl_t crl, int indx, | |||
523 | gnutls_assert (); | 523 | gnutls_assert (); |
524 | if (result == ASN1_ELEMENT_NOT_FOUND) | 524 | if (result == ASN1_ELEMENT_NOT_FOUND) |
525 | return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; | 525 | return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; |
526 | return _gnutls_asn2err (result); | 526 | return mhd_gtls_asn2err (result); |
527 | } | 527 | } |
528 | 528 | ||
529 | if (t) | 529 | if (t) |
@@ -567,7 +567,7 @@ _gnutls_x509_crl_get_raw_issuer_dn (gnutls_x509_crl_t crl, | |||
567 | &c2)) != ASN1_SUCCESS) | 567 | &c2)) != ASN1_SUCCESS) |
568 | { | 568 | { |
569 | gnutls_assert (); | 569 | gnutls_assert (); |
570 | return _gnutls_asn2err (result); | 570 | return mhd_gtls_asn2err (result); |
571 | } | 571 | } |
572 | 572 | ||
573 | result = | 573 | result = |
@@ -585,7 +585,7 @@ _gnutls_x509_crl_get_raw_issuer_dn (gnutls_x509_crl_t crl, | |||
585 | /* couldn't decode DER */ | 585 | /* couldn't decode DER */ |
586 | gnutls_assert (); | 586 | gnutls_assert (); |
587 | asn1_delete_structure (&c2); | 587 | asn1_delete_structure (&c2); |
588 | result = _gnutls_asn2err (result); | 588 | result = mhd_gtls_asn2err (result); |
589 | goto cleanup; | 589 | goto cleanup; |
590 | } | 590 | } |
591 | 591 | ||
@@ -597,7 +597,7 @@ _gnutls_x509_crl_get_raw_issuer_dn (gnutls_x509_crl_t crl, | |||
597 | if (result != ASN1_SUCCESS) | 597 | if (result != ASN1_SUCCESS) |
598 | { | 598 | { |
599 | gnutls_assert (); | 599 | gnutls_assert (); |
600 | result = _gnutls_asn2err (result); | 600 | result = mhd_gtls_asn2err (result); |
601 | goto cleanup; | 601 | goto cleanup; |
602 | } | 602 | } |
603 | 603 | ||
diff --git a/src/daemon/https/x509/crl_write.c b/src/daemon/https/x509/crl_write.c index 465f1782..7f4e246a 100644 --- a/src/daemon/https/x509/crl_write.c +++ b/src/daemon/https/x509/crl_write.c | |||
@@ -76,7 +76,7 @@ gnutls_x509_crl_set_version (gnutls_x509_crl_t crl, unsigned int version) | |||
76 | if (result != ASN1_SUCCESS) | 76 | if (result != ASN1_SUCCESS) |
77 | { | 77 | { |
78 | gnutls_assert (); | 78 | gnutls_assert (); |
79 | return _gnutls_asn2err (result); | 79 | return mhd_gtls_asn2err (result); |
80 | } | 80 | } |
81 | 81 | ||
82 | return 0; | 82 | return 0; |
@@ -220,7 +220,7 @@ gnutls_x509_crl_set_crt_serial (gnutls_x509_crl_t crl, | |||
220 | if (ret != ASN1_SUCCESS) | 220 | if (ret != ASN1_SUCCESS) |
221 | { | 221 | { |
222 | gnutls_assert (); | 222 | gnutls_assert (); |
223 | return _gnutls_asn2err (ret); | 223 | return mhd_gtls_asn2err (ret); |
224 | } | 224 | } |
225 | 225 | ||
226 | ret = | 226 | ret = |
@@ -230,7 +230,7 @@ gnutls_x509_crl_set_crt_serial (gnutls_x509_crl_t crl, | |||
230 | if (ret != ASN1_SUCCESS) | 230 | if (ret != ASN1_SUCCESS) |
231 | { | 231 | { |
232 | gnutls_assert (); | 232 | gnutls_assert (); |
233 | return _gnutls_asn2err (ret); | 233 | return mhd_gtls_asn2err (ret); |
234 | } | 234 | } |
235 | 235 | ||
236 | ret = | 236 | ret = |
@@ -250,7 +250,7 @@ gnutls_x509_crl_set_crt_serial (gnutls_x509_crl_t crl, | |||
250 | if (ret != ASN1_SUCCESS) | 250 | if (ret != ASN1_SUCCESS) |
251 | { | 251 | { |
252 | gnutls_assert (); | 252 | gnutls_assert (); |
253 | return _gnutls_asn2err (ret); | 253 | return mhd_gtls_asn2err (ret); |
254 | } | 254 | } |
255 | 255 | ||
256 | return 0; | 256 | return 0; |
@@ -295,7 +295,7 @@ gnutls_x509_crl_set_crt (gnutls_x509_crl_t crl, gnutls_x509_crt_t crt, | |||
295 | if (ret < 0) | 295 | if (ret < 0) |
296 | { | 296 | { |
297 | gnutls_assert (); | 297 | gnutls_assert (); |
298 | return _gnutls_asn2err (ret); | 298 | return mhd_gtls_asn2err (ret); |
299 | } | 299 | } |
300 | 300 | ||
301 | return 0; | 301 | return 0; |
diff --git a/src/daemon/https/x509/crq.c b/src/daemon/https/x509/crq.c index 6ce01583..5efbd5cc 100644 --- a/src/daemon/https/x509/crq.c +++ b/src/daemon/https/x509/crq.c | |||
@@ -65,7 +65,7 @@ gnutls_x509_crq_init (gnutls_x509_crq_t * crq) | |||
65 | { | 65 | { |
66 | gnutls_assert (); | 66 | gnutls_assert (); |
67 | gnutls_free (*crq); | 67 | gnutls_free (*crq); |
68 | return _gnutls_asn2err (result); | 68 | return mhd_gtls_asn2err (result); |
69 | } | 69 | } |
70 | return 0; /* success */ | 70 | return 0; /* success */ |
71 | } | 71 | } |
@@ -155,7 +155,7 @@ gnutls_x509_crq_import (gnutls_x509_crq_t crq, | |||
155 | result = asn1_der_decoding (&crq->crq, _data.data, _data.size, NULL); | 155 | result = asn1_der_decoding (&crq->crq, _data.data, _data.size, NULL); |
156 | if (result != ASN1_SUCCESS) | 156 | if (result != ASN1_SUCCESS) |
157 | { | 157 | { |
158 | result = _gnutls_asn2err (result); | 158 | result = mhd_gtls_asn2err (result); |
159 | gnutls_assert (); | 159 | gnutls_assert (); |
160 | goto cleanup; | 160 | goto cleanup; |
161 | } | 161 | } |
@@ -330,7 +330,7 @@ parse_attribute (ASN1_TYPE asn1_struct, | |||
330 | if (result != ASN1_VALUE_NOT_FOUND) | 330 | if (result != ASN1_VALUE_NOT_FOUND) |
331 | { | 331 | { |
332 | gnutls_assert (); | 332 | gnutls_assert (); |
333 | result = _gnutls_asn2err (result); | 333 | result = mhd_gtls_asn2err (result); |
334 | goto cleanup; | 334 | goto cleanup; |
335 | } | 335 | } |
336 | 336 | ||
@@ -349,7 +349,7 @@ parse_attribute (ASN1_TYPE asn1_struct, | |||
349 | else if (result != ASN1_SUCCESS) | 349 | else if (result != ASN1_SUCCESS) |
350 | { | 350 | { |
351 | gnutls_assert (); | 351 | gnutls_assert (); |
352 | result = _gnutls_asn2err (result); | 352 | result = mhd_gtls_asn2err (result); |
353 | goto cleanup; | 353 | goto cleanup; |
354 | } | 354 | } |
355 | 355 | ||
@@ -367,7 +367,7 @@ parse_attribute (ASN1_TYPE asn1_struct, | |||
367 | if (result != ASN1_SUCCESS) | 367 | if (result != ASN1_SUCCESS) |
368 | { | 368 | { |
369 | gnutls_assert (); | 369 | gnutls_assert (); |
370 | result = _gnutls_asn2err (result); | 370 | result = mhd_gtls_asn2err (result); |
371 | goto cleanup; | 371 | goto cleanup; |
372 | } | 372 | } |
373 | 373 | ||
@@ -480,7 +480,7 @@ gnutls_x509_crq_set_attribute_by_oid (gnutls_x509_crq_t crq, | |||
480 | if (result != ASN1_SUCCESS) | 480 | if (result != ASN1_SUCCESS) |
481 | { | 481 | { |
482 | gnutls_assert (); | 482 | gnutls_assert (); |
483 | return _gnutls_asn2err (result); | 483 | return mhd_gtls_asn2err (result); |
484 | } | 484 | } |
485 | 485 | ||
486 | result = | 486 | result = |
@@ -594,7 +594,7 @@ gnutls_x509_crq_set_version (gnutls_x509_crq_t crq, unsigned int version) | |||
594 | if (result != ASN1_SUCCESS) | 594 | if (result != ASN1_SUCCESS) |
595 | { | 595 | { |
596 | gnutls_assert (); | 596 | gnutls_assert (); |
597 | return _gnutls_asn2err (result); | 597 | return mhd_gtls_asn2err (result); |
598 | } | 598 | } |
599 | 599 | ||
600 | return 0; | 600 | return 0; |
@@ -630,7 +630,7 @@ gnutls_x509_crq_get_version (gnutls_x509_crq_t crq) | |||
630 | if (result == ASN1_ELEMENT_NOT_FOUND) | 630 | if (result == ASN1_ELEMENT_NOT_FOUND) |
631 | return 1; /* the DEFAULT version */ | 631 | return 1; /* the DEFAULT version */ |
632 | gnutls_assert (); | 632 | gnutls_assert (); |
633 | return _gnutls_asn2err (result); | 633 | return mhd_gtls_asn2err (result); |
634 | } | 634 | } |
635 | 635 | ||
636 | return (int) version[0] + 1; | 636 | return (int) version[0] + 1; |
@@ -703,7 +703,7 @@ gnutls_x509_crq_set_challenge_password (gnutls_x509_crq_t crq, | |||
703 | if (result != ASN1_SUCCESS) | 703 | if (result != ASN1_SUCCESS) |
704 | { | 704 | { |
705 | gnutls_assert (); | 705 | gnutls_assert (); |
706 | return _gnutls_asn2err (result); | 706 | return mhd_gtls_asn2err (result); |
707 | } | 707 | } |
708 | 708 | ||
709 | result = | 709 | result = |
@@ -774,7 +774,7 @@ gnutls_x509_crq_sign2 (gnutls_x509_crq_t crq, gnutls_x509_privkey_t key, | |||
774 | if (result != ASN1_SUCCESS) | 774 | if (result != ASN1_SUCCESS) |
775 | { | 775 | { |
776 | gnutls_assert (); | 776 | gnutls_assert (); |
777 | return _gnutls_asn2err (result); | 777 | return mhd_gtls_asn2err (result); |
778 | } | 778 | } |
779 | 779 | ||
780 | /* Step 3. Write the signatureAlgorithm field. | 780 | /* Step 3. Write the signatureAlgorithm field. |
diff --git a/src/daemon/https/x509/dn.c b/src/daemon/https/x509/dn.c index 57f71330..784ac4a7 100644 --- a/src/daemon/https/x509/dn.c +++ b/src/daemon/https/x509/dn.c | |||
@@ -141,7 +141,7 @@ _gnutls_x509_parse_dn (ASN1_TYPE asn1_struct, | |||
141 | if (result != ASN1_VALUE_NOT_FOUND) | 141 | if (result != ASN1_VALUE_NOT_FOUND) |
142 | { | 142 | { |
143 | gnutls_assert (); | 143 | gnutls_assert (); |
144 | result = _gnutls_asn2err (result); | 144 | result = mhd_gtls_asn2err (result); |
145 | goto cleanup; | 145 | goto cleanup; |
146 | } | 146 | } |
147 | 147 | ||
@@ -169,7 +169,7 @@ _gnutls_x509_parse_dn (ASN1_TYPE asn1_struct, | |||
169 | if (result != ASN1_VALUE_NOT_FOUND) | 169 | if (result != ASN1_VALUE_NOT_FOUND) |
170 | { | 170 | { |
171 | gnutls_assert (); | 171 | gnutls_assert (); |
172 | result = _gnutls_asn2err (result); | 172 | result = mhd_gtls_asn2err (result); |
173 | goto cleanup; | 173 | goto cleanup; |
174 | } | 174 | } |
175 | 175 | ||
@@ -186,7 +186,7 @@ _gnutls_x509_parse_dn (ASN1_TYPE asn1_struct, | |||
186 | else if (result != ASN1_SUCCESS) | 186 | else if (result != ASN1_SUCCESS) |
187 | { | 187 | { |
188 | gnutls_assert (); | 188 | gnutls_assert (); |
189 | result = _gnutls_asn2err (result); | 189 | result = mhd_gtls_asn2err (result); |
190 | goto cleanup; | 190 | goto cleanup; |
191 | } | 191 | } |
192 | 192 | ||
@@ -211,7 +211,7 @@ _gnutls_x509_parse_dn (ASN1_TYPE asn1_struct, | |||
211 | if (result != ASN1_SUCCESS) | 211 | if (result != ASN1_SUCCESS) |
212 | { | 212 | { |
213 | gnutls_assert (); | 213 | gnutls_assert (); |
214 | result = _gnutls_asn2err (result); | 214 | result = mhd_gtls_asn2err (result); |
215 | goto cleanup; | 215 | goto cleanup; |
216 | } | 216 | } |
217 | #define STR_APPEND(y) if ((result=mhd_gtls_string_append_str( &out_str, y)) < 0) { \ | 217 | #define STR_APPEND(y) if ((result=mhd_gtls_string_append_str( &out_str, y)) < 0) { \ |
@@ -382,7 +382,7 @@ _gnutls_x509_parse_dn_oid (ASN1_TYPE asn1_struct, | |||
382 | if (result != ASN1_VALUE_NOT_FOUND) | 382 | if (result != ASN1_VALUE_NOT_FOUND) |
383 | { | 383 | { |
384 | gnutls_assert (); | 384 | gnutls_assert (); |
385 | result = _gnutls_asn2err (result); | 385 | result = mhd_gtls_asn2err (result); |
386 | goto cleanup; | 386 | goto cleanup; |
387 | } | 387 | } |
388 | 388 | ||
@@ -412,7 +412,7 @@ _gnutls_x509_parse_dn_oid (ASN1_TYPE asn1_struct, | |||
412 | if (result != ASN1_VALUE_NOT_FOUND) | 412 | if (result != ASN1_VALUE_NOT_FOUND) |
413 | { | 413 | { |
414 | gnutls_assert (); | 414 | gnutls_assert (); |
415 | result = _gnutls_asn2err (result); | 415 | result = mhd_gtls_asn2err (result); |
416 | goto cleanup; | 416 | goto cleanup; |
417 | } | 417 | } |
418 | 418 | ||
@@ -429,7 +429,7 @@ _gnutls_x509_parse_dn_oid (ASN1_TYPE asn1_struct, | |||
429 | else if (result != ASN1_SUCCESS) | 429 | else if (result != ASN1_SUCCESS) |
430 | { | 430 | { |
431 | gnutls_assert (); | 431 | gnutls_assert (); |
432 | result = _gnutls_asn2err (result); | 432 | result = mhd_gtls_asn2err (result); |
433 | goto cleanup; | 433 | goto cleanup; |
434 | } | 434 | } |
435 | 435 | ||
@@ -449,7 +449,7 @@ _gnutls_x509_parse_dn_oid (ASN1_TYPE asn1_struct, | |||
449 | gnutls_assert (); | 449 | gnutls_assert (); |
450 | if (result == ASN1_MEM_ERROR) | 450 | if (result == ASN1_MEM_ERROR) |
451 | *sizeof_buf = len; | 451 | *sizeof_buf = len; |
452 | result = _gnutls_asn2err (result); | 452 | result = mhd_gtls_asn2err (result); |
453 | goto cleanup; | 453 | goto cleanup; |
454 | } | 454 | } |
455 | 455 | ||
@@ -551,7 +551,7 @@ _gnutls_x509_get_dn_oid (ASN1_TYPE asn1_struct, | |||
551 | if (result != ASN1_VALUE_NOT_FOUND) | 551 | if (result != ASN1_VALUE_NOT_FOUND) |
552 | { | 552 | { |
553 | gnutls_assert (); | 553 | gnutls_assert (); |
554 | result = _gnutls_asn2err (result); | 554 | result = mhd_gtls_asn2err (result); |
555 | goto cleanup; | 555 | goto cleanup; |
556 | } | 556 | } |
557 | 557 | ||
@@ -581,7 +581,7 @@ _gnutls_x509_get_dn_oid (ASN1_TYPE asn1_struct, | |||
581 | if (result != ASN1_VALUE_NOT_FOUND) | 581 | if (result != ASN1_VALUE_NOT_FOUND) |
582 | { | 582 | { |
583 | gnutls_assert (); | 583 | gnutls_assert (); |
584 | result = _gnutls_asn2err (result); | 584 | result = mhd_gtls_asn2err (result); |
585 | goto cleanup; | 585 | goto cleanup; |
586 | } | 586 | } |
587 | 587 | ||
@@ -598,7 +598,7 @@ _gnutls_x509_get_dn_oid (ASN1_TYPE asn1_struct, | |||
598 | else if (result != ASN1_SUCCESS) | 598 | else if (result != ASN1_SUCCESS) |
599 | { | 599 | { |
600 | gnutls_assert (); | 600 | gnutls_assert (); |
601 | result = _gnutls_asn2err (result); | 601 | result = mhd_gtls_asn2err (result); |
602 | goto cleanup; | 602 | goto cleanup; |
603 | } | 603 | } |
604 | 604 | ||
@@ -667,7 +667,7 @@ _gnutls_x509_encode_and_write_attribute (const char *given_oid, | |||
667 | if (result != ASN1_SUCCESS) | 667 | if (result != ASN1_SUCCESS) |
668 | { | 668 | { |
669 | gnutls_assert (); | 669 | gnutls_assert (); |
670 | return _gnutls_asn2err (result); | 670 | return mhd_gtls_asn2err (result); |
671 | } | 671 | } |
672 | 672 | ||
673 | tmp[0] = 0; | 673 | tmp[0] = 0; |
@@ -699,7 +699,7 @@ _gnutls_x509_encode_and_write_attribute (const char *given_oid, | |||
699 | { | 699 | { |
700 | gnutls_assert (); | 700 | gnutls_assert (); |
701 | asn1_delete_structure (&c2); | 701 | asn1_delete_structure (&c2); |
702 | return _gnutls_asn2err (result); | 702 | return mhd_gtls_asn2err (result); |
703 | } | 703 | } |
704 | 704 | ||
705 | mhd_gtls_str_cpy (tmp, sizeof (tmp), string_type); | 705 | mhd_gtls_str_cpy (tmp, sizeof (tmp), string_type); |
@@ -710,7 +710,7 @@ _gnutls_x509_encode_and_write_attribute (const char *given_oid, | |||
710 | { | 710 | { |
711 | gnutls_assert (); | 711 | gnutls_assert (); |
712 | asn1_delete_structure (&c2); | 712 | asn1_delete_structure (&c2); |
713 | return _gnutls_asn2err (result); | 713 | return mhd_gtls_asn2err (result); |
714 | } | 714 | } |
715 | 715 | ||
716 | 716 | ||
@@ -728,7 +728,7 @@ _gnutls_x509_encode_and_write_attribute (const char *given_oid, | |||
728 | if (result != ASN1_SUCCESS) | 728 | if (result != ASN1_SUCCESS) |
729 | { | 729 | { |
730 | gnutls_assert (); | 730 | gnutls_assert (); |
731 | return _gnutls_asn2err (result); | 731 | return mhd_gtls_asn2err (result); |
732 | } | 732 | } |
733 | 733 | ||
734 | mhd_gtls_str_cat (tmp, sizeof (tmp), ".?LAST"); | 734 | mhd_gtls_str_cat (tmp, sizeof (tmp), ".?LAST"); |
@@ -751,7 +751,7 @@ _gnutls_x509_encode_and_write_attribute (const char *given_oid, | |||
751 | if (result != ASN1_SUCCESS) | 751 | if (result != ASN1_SUCCESS) |
752 | { | 752 | { |
753 | gnutls_assert (); | 753 | gnutls_assert (); |
754 | return _gnutls_asn2err (result); | 754 | return mhd_gtls_asn2err (result); |
755 | } | 755 | } |
756 | 756 | ||
757 | return 0; | 757 | return 0; |
@@ -783,7 +783,7 @@ _gnutls_x509_write_attribute (const char *given_oid, | |||
783 | if (result != ASN1_SUCCESS) | 783 | if (result != ASN1_SUCCESS) |
784 | { | 784 | { |
785 | gnutls_assert (); | 785 | gnutls_assert (); |
786 | return _gnutls_asn2err (result); | 786 | return mhd_gtls_asn2err (result); |
787 | } | 787 | } |
788 | 788 | ||
789 | mhd_gtls_str_cat (tmp, sizeof (tmp), ".?LAST"); | 789 | mhd_gtls_str_cat (tmp, sizeof (tmp), ".?LAST"); |
@@ -794,7 +794,7 @@ _gnutls_x509_write_attribute (const char *given_oid, | |||
794 | if (result < 0) | 794 | if (result < 0) |
795 | { | 795 | { |
796 | gnutls_assert (); | 796 | gnutls_assert (); |
797 | return _gnutls_asn2err (result); | 797 | return mhd_gtls_asn2err (result); |
798 | } | 798 | } |
799 | 799 | ||
800 | /* write the type | 800 | /* write the type |
@@ -806,7 +806,7 @@ _gnutls_x509_write_attribute (const char *given_oid, | |||
806 | if (result != ASN1_SUCCESS) | 806 | if (result != ASN1_SUCCESS) |
807 | { | 807 | { |
808 | gnutls_assert (); | 808 | gnutls_assert (); |
809 | return _gnutls_asn2err (result); | 809 | return mhd_gtls_asn2err (result); |
810 | } | 810 | } |
811 | 811 | ||
812 | return 0; | 812 | return 0; |
@@ -841,7 +841,7 @@ _gnutls_x509_decode_and_read_attribute (ASN1_TYPE asn1_struct, | |||
841 | if (result != ASN1_SUCCESS) | 841 | if (result != ASN1_SUCCESS) |
842 | { | 842 | { |
843 | gnutls_assert (); | 843 | gnutls_assert (); |
844 | result = _gnutls_asn2err (result); | 844 | result = mhd_gtls_asn2err (result); |
845 | return result; | 845 | return result; |
846 | } | 846 | } |
847 | 847 | ||
@@ -893,7 +893,7 @@ _gnutls_x509_set_dn_oid (ASN1_TYPE asn1_struct, | |||
893 | if (result != ASN1_SUCCESS) | 893 | if (result != ASN1_SUCCESS) |
894 | { | 894 | { |
895 | gnutls_assert (); | 895 | gnutls_assert (); |
896 | return _gnutls_asn2err (result); | 896 | return mhd_gtls_asn2err (result); |
897 | } | 897 | } |
898 | 898 | ||
899 | mhd_gtls_str_cpy (asn1_rdn_name, sizeof (asn1_rdn_name), asn1_name); | 899 | mhd_gtls_str_cpy (asn1_rdn_name, sizeof (asn1_rdn_name), asn1_name); |
@@ -905,7 +905,7 @@ _gnutls_x509_set_dn_oid (ASN1_TYPE asn1_struct, | |||
905 | if (result != ASN1_SUCCESS) | 905 | if (result != ASN1_SUCCESS) |
906 | { | 906 | { |
907 | gnutls_assert (); | 907 | gnutls_assert (); |
908 | return _gnutls_asn2err (result); | 908 | return mhd_gtls_asn2err (result); |
909 | } | 909 | } |
910 | 910 | ||
911 | mhd_gtls_str_cpy (tmp, sizeof (tmp), asn1_rdn_name); | 911 | mhd_gtls_str_cpy (tmp, sizeof (tmp), asn1_rdn_name); |
@@ -917,7 +917,7 @@ _gnutls_x509_set_dn_oid (ASN1_TYPE asn1_struct, | |||
917 | if (result != ASN1_SUCCESS) | 917 | if (result != ASN1_SUCCESS) |
918 | { | 918 | { |
919 | gnutls_assert (); | 919 | gnutls_assert (); |
920 | return _gnutls_asn2err (result); | 920 | return mhd_gtls_asn2err (result); |
921 | } | 921 | } |
922 | 922 | ||
923 | 923 | ||
@@ -987,7 +987,7 @@ gnutls_x509_rdn_get (const gnutls_datum_t * idn, | |||
987 | "PKIX1.Name", &dn)) != ASN1_SUCCESS) | 987 | "PKIX1.Name", &dn)) != ASN1_SUCCESS) |
988 | { | 988 | { |
989 | gnutls_assert (); | 989 | gnutls_assert (); |
990 | return _gnutls_asn2err (result); | 990 | return mhd_gtls_asn2err (result); |
991 | } | 991 | } |
992 | 992 | ||
993 | result = asn1_der_decoding (&dn, idn->data, idn->size, NULL); | 993 | result = asn1_der_decoding (&dn, idn->data, idn->size, NULL); |
@@ -996,7 +996,7 @@ gnutls_x509_rdn_get (const gnutls_datum_t * idn, | |||
996 | /* couldn't decode DER */ | 996 | /* couldn't decode DER */ |
997 | gnutls_assert (); | 997 | gnutls_assert (); |
998 | asn1_delete_structure (&dn); | 998 | asn1_delete_structure (&dn); |
999 | return _gnutls_asn2err (result); | 999 | return mhd_gtls_asn2err (result); |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | result = _gnutls_x509_parse_dn (dn, "rdnSequence", buf, sizeof_buf); | 1002 | result = _gnutls_x509_parse_dn (dn, "rdnSequence", buf, sizeof_buf); |
@@ -1042,7 +1042,7 @@ gnutls_x509_rdn_get_by_oid (const gnutls_datum_t * idn, const char *oid, | |||
1042 | "PKIX1.Name", &dn)) != ASN1_SUCCESS) | 1042 | "PKIX1.Name", &dn)) != ASN1_SUCCESS) |
1043 | { | 1043 | { |
1044 | gnutls_assert (); | 1044 | gnutls_assert (); |
1045 | return _gnutls_asn2err (result); | 1045 | return mhd_gtls_asn2err (result); |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | result = asn1_der_decoding (&dn, idn->data, idn->size, NULL); | 1048 | result = asn1_der_decoding (&dn, idn->data, idn->size, NULL); |
@@ -1051,7 +1051,7 @@ gnutls_x509_rdn_get_by_oid (const gnutls_datum_t * idn, const char *oid, | |||
1051 | /* couldn't decode DER */ | 1051 | /* couldn't decode DER */ |
1052 | gnutls_assert (); | 1052 | gnutls_assert (); |
1053 | asn1_delete_structure (&dn); | 1053 | asn1_delete_structure (&dn); |
1054 | return _gnutls_asn2err (result); | 1054 | return mhd_gtls_asn2err (result); |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | result = | 1057 | result = |
@@ -1094,7 +1094,7 @@ gnutls_x509_rdn_get_oid (const gnutls_datum_t * idn, | |||
1094 | "PKIX1.Name", &dn)) != ASN1_SUCCESS) | 1094 | "PKIX1.Name", &dn)) != ASN1_SUCCESS) |
1095 | { | 1095 | { |
1096 | gnutls_assert (); | 1096 | gnutls_assert (); |
1097 | return _gnutls_asn2err (result); | 1097 | return mhd_gtls_asn2err (result); |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | result = asn1_der_decoding (&dn, idn->data, idn->size, NULL); | 1100 | result = asn1_der_decoding (&dn, idn->data, idn->size, NULL); |
@@ -1103,7 +1103,7 @@ gnutls_x509_rdn_get_oid (const gnutls_datum_t * idn, | |||
1103 | /* couldn't decode DER */ | 1103 | /* couldn't decode DER */ |
1104 | gnutls_assert (); | 1104 | gnutls_assert (); |
1105 | asn1_delete_structure (&dn); | 1105 | asn1_delete_structure (&dn); |
1106 | return _gnutls_asn2err (result); | 1106 | return mhd_gtls_asn2err (result); |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | result = _gnutls_x509_get_dn_oid (dn, "rdnSequence", indx, buf, sizeof_buf); | 1109 | result = _gnutls_x509_get_dn_oid (dn, "rdnSequence", indx, buf, sizeof_buf); |
diff --git a/src/daemon/https/x509/extensions.c b/src/daemon/https/x509/extensions.c index ddabd429..ea3891b0 100644 --- a/src/daemon/https/x509/extensions.c +++ b/src/daemon/https/x509/extensions.c | |||
@@ -96,7 +96,7 @@ _gnutls_x509_crt_get_extension (gnutls_x509_crt_t cert, | |||
96 | else if (result != ASN1_SUCCESS) | 96 | else if (result != ASN1_SUCCESS) |
97 | { | 97 | { |
98 | gnutls_assert (); | 98 | gnutls_assert (); |
99 | return _gnutls_asn2err (result); | 99 | return mhd_gtls_asn2err (result); |
100 | } | 100 | } |
101 | 101 | ||
102 | /* Handle Extension | 102 | /* Handle Extension |
@@ -123,7 +123,7 @@ _gnutls_x509_crt_get_extension (gnutls_x509_crt_t cert, | |||
123 | else if (result != ASN1_SUCCESS) | 123 | else if (result != ASN1_SUCCESS) |
124 | { | 124 | { |
125 | gnutls_assert (); | 125 | gnutls_assert (); |
126 | return _gnutls_asn2err (result); | 126 | return mhd_gtls_asn2err (result); |
127 | } | 127 | } |
128 | 128 | ||
129 | if (str_critical[0] == 'T') | 129 | if (str_critical[0] == 'T') |
@@ -165,7 +165,7 @@ _gnutls_x509_crt_get_extension (gnutls_x509_crt_t cert, | |||
165 | else | 165 | else |
166 | { | 166 | { |
167 | gnutls_assert (); | 167 | gnutls_assert (); |
168 | return _gnutls_asn2err (result); | 168 | return mhd_gtls_asn2err (result); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
@@ -220,7 +220,7 @@ _gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert, | |||
220 | else if (result != ASN1_SUCCESS) | 220 | else if (result != ASN1_SUCCESS) |
221 | { | 221 | { |
222 | gnutls_assert (); | 222 | gnutls_assert (); |
223 | return _gnutls_asn2err (result); | 223 | return mhd_gtls_asn2err (result); |
224 | } | 224 | } |
225 | 225 | ||
226 | /* Handle Extension | 226 | /* Handle Extension |
@@ -255,7 +255,7 @@ _gnutls_x509_crt_get_extension_oid (gnutls_x509_crt_t cert, | |||
255 | else | 255 | else |
256 | { | 256 | { |
257 | gnutls_assert (); | 257 | gnutls_assert (); |
258 | return _gnutls_asn2err (result); | 258 | return mhd_gtls_asn2err (result); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | 261 | ||
@@ -277,7 +277,7 @@ set_extension (ASN1_TYPE asn, const char *extension_id, | |||
277 | if (result != ASN1_SUCCESS) | 277 | if (result != ASN1_SUCCESS) |
278 | { | 278 | { |
279 | gnutls_assert (); | 279 | gnutls_assert (); |
280 | return _gnutls_asn2err (result); | 280 | return mhd_gtls_asn2err (result); |
281 | } | 281 | } |
282 | 282 | ||
283 | result = | 283 | result = |
@@ -286,7 +286,7 @@ set_extension (ASN1_TYPE asn, const char *extension_id, | |||
286 | if (result != ASN1_SUCCESS) | 286 | if (result != ASN1_SUCCESS) |
287 | { | 287 | { |
288 | gnutls_assert (); | 288 | gnutls_assert (); |
289 | return _gnutls_asn2err (result); | 289 | return mhd_gtls_asn2err (result); |
290 | } | 290 | } |
291 | 291 | ||
292 | if (critical == 0) | 292 | if (critical == 0) |
@@ -301,7 +301,7 @@ set_extension (ASN1_TYPE asn, const char *extension_id, | |||
301 | if (result != ASN1_SUCCESS) | 301 | if (result != ASN1_SUCCESS) |
302 | { | 302 | { |
303 | gnutls_assert (); | 303 | gnutls_assert (); |
304 | return _gnutls_asn2err (result); | 304 | return mhd_gtls_asn2err (result); |
305 | } | 305 | } |
306 | 306 | ||
307 | result = | 307 | result = |
@@ -342,7 +342,7 @@ overwrite_extension (ASN1_TYPE asn, unsigned int indx, | |||
342 | if (result != ASN1_SUCCESS) | 342 | if (result != ASN1_SUCCESS) |
343 | { | 343 | { |
344 | gnutls_assert (); | 344 | gnutls_assert (); |
345 | return _gnutls_asn2err (result); | 345 | return mhd_gtls_asn2err (result); |
346 | } | 346 | } |
347 | 347 | ||
348 | mhd_gtls_str_cpy (name2, sizeof (name2), name); | 348 | mhd_gtls_str_cpy (name2, sizeof (name2), name); |
@@ -411,7 +411,7 @@ _gnutls_x509_crt_set_extension (gnutls_x509_crt_t cert, | |||
411 | else if (result != ASN1_SUCCESS) | 411 | else if (result != ASN1_SUCCESS) |
412 | { | 412 | { |
413 | gnutls_assert (); | 413 | gnutls_assert (); |
414 | return _gnutls_asn2err (result); | 414 | return mhd_gtls_asn2err (result); |
415 | } | 415 | } |
416 | 416 | ||
417 | /* Handle Extension | 417 | /* Handle Extension |
@@ -436,7 +436,7 @@ _gnutls_x509_crt_set_extension (gnutls_x509_crt_t cert, | |||
436 | else | 436 | else |
437 | { | 437 | { |
438 | gnutls_assert (); | 438 | gnutls_assert (); |
439 | return _gnutls_asn2err (result); | 439 | return mhd_gtls_asn2err (result); |
440 | } | 440 | } |
441 | 441 | ||
442 | 442 | ||
@@ -462,7 +462,7 @@ _gnutls_x509_ext_extract_keyUsage (uint16_t * keyUsage, | |||
462 | (_gnutls_get_pkix (), "PKIX1.KeyUsage", &ext)) != ASN1_SUCCESS) | 462 | (_gnutls_get_pkix (), "PKIX1.KeyUsage", &ext)) != ASN1_SUCCESS) |
463 | { | 463 | { |
464 | gnutls_assert (); | 464 | gnutls_assert (); |
465 | return _gnutls_asn2err (result); | 465 | return mhd_gtls_asn2err (result); |
466 | } | 466 | } |
467 | 467 | ||
468 | result = asn1_der_decoding (&ext, extnValue, extnValueLen, NULL); | 468 | result = asn1_der_decoding (&ext, extnValue, extnValueLen, NULL); |
@@ -471,7 +471,7 @@ _gnutls_x509_ext_extract_keyUsage (uint16_t * keyUsage, | |||
471 | { | 471 | { |
472 | gnutls_assert (); | 472 | gnutls_assert (); |
473 | asn1_delete_structure (&ext); | 473 | asn1_delete_structure (&ext); |
474 | return _gnutls_asn2err (result); | 474 | return mhd_gtls_asn2err (result); |
475 | } | 475 | } |
476 | 476 | ||
477 | len = sizeof (str); | 477 | len = sizeof (str); |
@@ -506,7 +506,7 @@ _gnutls_x509_ext_extract_basicConstraints (int *CA, | |||
506 | (_gnutls_get_pkix (), "PKIX1.BasicConstraints", &ext)) != ASN1_SUCCESS) | 506 | (_gnutls_get_pkix (), "PKIX1.BasicConstraints", &ext)) != ASN1_SUCCESS) |
507 | { | 507 | { |
508 | gnutls_assert (); | 508 | gnutls_assert (); |
509 | return _gnutls_asn2err (result); | 509 | return mhd_gtls_asn2err (result); |
510 | } | 510 | } |
511 | 511 | ||
512 | result = asn1_der_decoding (&ext, extnValue, extnValueLen, NULL); | 512 | result = asn1_der_decoding (&ext, extnValue, extnValueLen, NULL); |
@@ -514,7 +514,7 @@ _gnutls_x509_ext_extract_basicConstraints (int *CA, | |||
514 | { | 514 | { |
515 | gnutls_assert (); | 515 | gnutls_assert (); |
516 | asn1_delete_structure (&ext); | 516 | asn1_delete_structure (&ext); |
517 | return _gnutls_asn2err (result); | 517 | return mhd_gtls_asn2err (result); |
518 | } | 518 | } |
519 | 519 | ||
520 | if (pathLenConstraint) | 520 | if (pathLenConstraint) |
@@ -527,7 +527,7 @@ _gnutls_x509_ext_extract_basicConstraints (int *CA, | |||
527 | { | 527 | { |
528 | gnutls_assert (); | 528 | gnutls_assert (); |
529 | asn1_delete_structure (&ext); | 529 | asn1_delete_structure (&ext); |
530 | return _gnutls_asn2err (result); | 530 | return mhd_gtls_asn2err (result); |
531 | } | 531 | } |
532 | } | 532 | } |
533 | 533 | ||
@@ -569,7 +569,7 @@ _gnutls_x509_ext_gen_basicConstraints (int CA, | |||
569 | if (result != ASN1_SUCCESS) | 569 | if (result != ASN1_SUCCESS) |
570 | { | 570 | { |
571 | gnutls_assert (); | 571 | gnutls_assert (); |
572 | return _gnutls_asn2err (result); | 572 | return mhd_gtls_asn2err (result); |
573 | } | 573 | } |
574 | 574 | ||
575 | result = asn1_write_value (ext, "cA", str, 1); | 575 | result = asn1_write_value (ext, "cA", str, 1); |
@@ -577,14 +577,14 @@ _gnutls_x509_ext_gen_basicConstraints (int CA, | |||
577 | { | 577 | { |
578 | gnutls_assert (); | 578 | gnutls_assert (); |
579 | asn1_delete_structure (&ext); | 579 | asn1_delete_structure (&ext); |
580 | return _gnutls_asn2err (result); | 580 | return mhd_gtls_asn2err (result); |
581 | } | 581 | } |
582 | 582 | ||
583 | if (pathLenConstraint < 0) | 583 | if (pathLenConstraint < 0) |
584 | { | 584 | { |
585 | result = asn1_write_value (ext, "pathLenConstraint", NULL, 0); | 585 | result = asn1_write_value (ext, "pathLenConstraint", NULL, 0); |
586 | if (result < 0) | 586 | if (result < 0) |
587 | result = _gnutls_asn2err (result); | 587 | result = mhd_gtls_asn2err (result); |
588 | } | 588 | } |
589 | else | 589 | else |
590 | result = _gnutls_x509_write_uint32 (ext, "pathLenConstraint", | 590 | result = _gnutls_x509_write_uint32 (ext, "pathLenConstraint", |
@@ -623,7 +623,7 @@ _gnutls_x509_ext_gen_keyUsage (uint16_t usage, gnutls_datum_t * der_ext) | |||
623 | if (result != ASN1_SUCCESS) | 623 | if (result != ASN1_SUCCESS) |
624 | { | 624 | { |
625 | gnutls_assert (); | 625 | gnutls_assert (); |
626 | return _gnutls_asn2err (result); | 626 | return mhd_gtls_asn2err (result); |
627 | } | 627 | } |
628 | 628 | ||
629 | str[0] = usage & 0xff; | 629 | str[0] = usage & 0xff; |
@@ -634,7 +634,7 @@ _gnutls_x509_ext_gen_keyUsage (uint16_t usage, gnutls_datum_t * der_ext) | |||
634 | { | 634 | { |
635 | gnutls_assert (); | 635 | gnutls_assert (); |
636 | asn1_delete_structure (&ext); | 636 | asn1_delete_structure (&ext); |
637 | return _gnutls_asn2err (result); | 637 | return mhd_gtls_asn2err (result); |
638 | } | 638 | } |
639 | 639 | ||
640 | result = _gnutls_x509_der_encode (ext, "", der_ext, 0); | 640 | result = _gnutls_x509_der_encode (ext, "", der_ext, 0); |
@@ -663,7 +663,7 @@ write_new_general_name (ASN1_TYPE ext, const char *ext_name, | |||
663 | if (result != ASN1_SUCCESS) | 663 | if (result != ASN1_SUCCESS) |
664 | { | 664 | { |
665 | gnutls_assert (); | 665 | gnutls_assert (); |
666 | return _gnutls_asn2err (result); | 666 | return mhd_gtls_asn2err (result); |
667 | } | 667 | } |
668 | 668 | ||
669 | switch (type) | 669 | switch (type) |
@@ -699,7 +699,7 @@ write_new_general_name (ASN1_TYPE ext, const char *ext_name, | |||
699 | if (result != ASN1_SUCCESS) | 699 | if (result != ASN1_SUCCESS) |
700 | { | 700 | { |
701 | gnutls_assert (); | 701 | gnutls_assert (); |
702 | return _gnutls_asn2err (result); | 702 | return mhd_gtls_asn2err (result); |
703 | } | 703 | } |
704 | 704 | ||
705 | mhd_gtls_str_cat (name, sizeof (name), "."); | 705 | mhd_gtls_str_cat (name, sizeof (name), "."); |
@@ -710,7 +710,7 @@ write_new_general_name (ASN1_TYPE ext, const char *ext_name, | |||
710 | { | 710 | { |
711 | gnutls_assert (); | 711 | gnutls_assert (); |
712 | asn1_delete_structure (&ext); | 712 | asn1_delete_structure (&ext); |
713 | return _gnutls_asn2err (result); | 713 | return mhd_gtls_asn2err (result); |
714 | } | 714 | } |
715 | 715 | ||
716 | return 0; | 716 | return 0; |
@@ -732,7 +732,7 @@ _gnutls_x509_ext_gen_subject_alt_name (gnutls_x509_subject_alt_name_t | |||
732 | if (result != ASN1_SUCCESS) | 732 | if (result != ASN1_SUCCESS) |
733 | { | 733 | { |
734 | gnutls_assert (); | 734 | gnutls_assert (); |
735 | return _gnutls_asn2err (result); | 735 | return mhd_gtls_asn2err (result); |
736 | } | 736 | } |
737 | 737 | ||
738 | result = write_new_general_name (ext, "", type, data_string); | 738 | result = write_new_general_name (ext, "", type, data_string); |
@@ -771,7 +771,7 @@ _gnutls_x509_ext_gen_key_id (const void *id, size_t id_size, | |||
771 | if (result != ASN1_SUCCESS) | 771 | if (result != ASN1_SUCCESS) |
772 | { | 772 | { |
773 | gnutls_assert (); | 773 | gnutls_assert (); |
774 | return _gnutls_asn2err (result); | 774 | return mhd_gtls_asn2err (result); |
775 | } | 775 | } |
776 | 776 | ||
777 | result = asn1_write_value (ext, "", id, id_size); | 777 | result = asn1_write_value (ext, "", id, id_size); |
@@ -779,7 +779,7 @@ _gnutls_x509_ext_gen_key_id (const void *id, size_t id_size, | |||
779 | { | 779 | { |
780 | gnutls_assert (); | 780 | gnutls_assert (); |
781 | asn1_delete_structure (&ext); | 781 | asn1_delete_structure (&ext); |
782 | return _gnutls_asn2err (result); | 782 | return mhd_gtls_asn2err (result); |
783 | } | 783 | } |
784 | 784 | ||
785 | result = _gnutls_x509_der_encode (ext, "", der_ext, 0); | 785 | result = _gnutls_x509_der_encode (ext, "", der_ext, 0); |
@@ -810,7 +810,7 @@ _gnutls_x509_ext_gen_auth_key_id (const void *id, size_t id_size, | |||
810 | if (result != ASN1_SUCCESS) | 810 | if (result != ASN1_SUCCESS) |
811 | { | 811 | { |
812 | gnutls_assert (); | 812 | gnutls_assert (); |
813 | return _gnutls_asn2err (result); | 813 | return mhd_gtls_asn2err (result); |
814 | } | 814 | } |
815 | 815 | ||
816 | result = asn1_write_value (ext, "keyIdentifier", id, id_size); | 816 | result = asn1_write_value (ext, "keyIdentifier", id, id_size); |
@@ -818,7 +818,7 @@ _gnutls_x509_ext_gen_auth_key_id (const void *id, size_t id_size, | |||
818 | { | 818 | { |
819 | gnutls_assert (); | 819 | gnutls_assert (); |
820 | asn1_delete_structure (&ext); | 820 | asn1_delete_structure (&ext); |
821 | return _gnutls_asn2err (result); | 821 | return mhd_gtls_asn2err (result); |
822 | } | 822 | } |
823 | 823 | ||
824 | asn1_write_value (ext, "authorityCertIssuer", NULL, 0); | 824 | asn1_write_value (ext, "authorityCertIssuer", NULL, 0); |
@@ -863,7 +863,7 @@ _gnutls_x509_ext_gen_crl_dist_points (gnutls_x509_subject_alt_name_t | |||
863 | if (result != ASN1_SUCCESS) | 863 | if (result != ASN1_SUCCESS) |
864 | { | 864 | { |
865 | gnutls_assert (); | 865 | gnutls_assert (); |
866 | result = _gnutls_asn2err (result); | 866 | result = mhd_gtls_asn2err (result); |
867 | goto cleanup; | 867 | goto cleanup; |
868 | } | 868 | } |
869 | 869 | ||
@@ -871,7 +871,7 @@ _gnutls_x509_ext_gen_crl_dist_points (gnutls_x509_subject_alt_name_t | |||
871 | if (result != ASN1_SUCCESS) | 871 | if (result != ASN1_SUCCESS) |
872 | { | 872 | { |
873 | gnutls_assert (); | 873 | gnutls_assert (); |
874 | result = _gnutls_asn2err (result); | 874 | result = mhd_gtls_asn2err (result); |
875 | goto cleanup; | 875 | goto cleanup; |
876 | } | 876 | } |
877 | 877 | ||
@@ -881,7 +881,7 @@ _gnutls_x509_ext_gen_crl_dist_points (gnutls_x509_subject_alt_name_t | |||
881 | if (result != ASN1_SUCCESS) | 881 | if (result != ASN1_SUCCESS) |
882 | { | 882 | { |
883 | gnutls_assert (); | 883 | gnutls_assert (); |
884 | result = _gnutls_asn2err (result); | 884 | result = mhd_gtls_asn2err (result); |
885 | goto cleanup; | 885 | goto cleanup; |
886 | } | 886 | } |
887 | } | 887 | } |
@@ -891,7 +891,7 @@ _gnutls_x509_ext_gen_crl_dist_points (gnutls_x509_subject_alt_name_t | |||
891 | if (result != ASN1_SUCCESS) | 891 | if (result != ASN1_SUCCESS) |
892 | { | 892 | { |
893 | gnutls_assert (); | 893 | gnutls_assert (); |
894 | result = _gnutls_asn2err (result); | 894 | result = mhd_gtls_asn2err (result); |
895 | goto cleanup; | 895 | goto cleanup; |
896 | } | 896 | } |
897 | } | 897 | } |
@@ -900,7 +900,7 @@ _gnutls_x509_ext_gen_crl_dist_points (gnutls_x509_subject_alt_name_t | |||
900 | if (result != ASN1_SUCCESS) | 900 | if (result != ASN1_SUCCESS) |
901 | { | 901 | { |
902 | gnutls_assert (); | 902 | gnutls_assert (); |
903 | result = _gnutls_asn2err (result); | 903 | result = mhd_gtls_asn2err (result); |
904 | goto cleanup; | 904 | goto cleanup; |
905 | } | 905 | } |
906 | 906 | ||
@@ -910,7 +910,7 @@ _gnutls_x509_ext_gen_crl_dist_points (gnutls_x509_subject_alt_name_t | |||
910 | if (result != ASN1_SUCCESS) | 910 | if (result != ASN1_SUCCESS) |
911 | { | 911 | { |
912 | gnutls_assert (); | 912 | gnutls_assert (); |
913 | result = _gnutls_asn2err (result); | 913 | result = mhd_gtls_asn2err (result); |
914 | goto cleanup; | 914 | goto cleanup; |
915 | } | 915 | } |
916 | 916 | ||
@@ -964,7 +964,7 @@ _gnutls_x509_ext_extract_proxyCertInfo (int *pathLenConstraint, | |||
964 | (_gnutls_get_pkix (), "PKIX1.ProxyCertInfo", &ext)) != ASN1_SUCCESS) | 964 | (_gnutls_get_pkix (), "PKIX1.ProxyCertInfo", &ext)) != ASN1_SUCCESS) |
965 | { | 965 | { |
966 | gnutls_assert (); | 966 | gnutls_assert (); |
967 | return _gnutls_asn2err (result); | 967 | return mhd_gtls_asn2err (result); |
968 | } | 968 | } |
969 | 969 | ||
970 | result = asn1_der_decoding (&ext, extnValue, extnValueLen, NULL); | 970 | result = asn1_der_decoding (&ext, extnValue, extnValueLen, NULL); |
@@ -972,7 +972,7 @@ _gnutls_x509_ext_extract_proxyCertInfo (int *pathLenConstraint, | |||
972 | { | 972 | { |
973 | gnutls_assert (); | 973 | gnutls_assert (); |
974 | asn1_delete_structure (&ext); | 974 | asn1_delete_structure (&ext); |
975 | return _gnutls_asn2err (result); | 975 | return mhd_gtls_asn2err (result); |
976 | } | 976 | } |
977 | 977 | ||
978 | if (pathLenConstraint) | 978 | if (pathLenConstraint) |
@@ -984,7 +984,7 @@ _gnutls_x509_ext_extract_proxyCertInfo (int *pathLenConstraint, | |||
984 | else if (result != GNUTLS_E_SUCCESS) | 984 | else if (result != GNUTLS_E_SUCCESS) |
985 | { | 985 | { |
986 | asn1_delete_structure (&ext); | 986 | asn1_delete_structure (&ext); |
987 | return _gnutls_asn2err (result); | 987 | return mhd_gtls_asn2err (result); |
988 | } | 988 | } |
989 | } | 989 | } |
990 | 990 | ||
@@ -1044,14 +1044,14 @@ _gnutls_x509_ext_gen_proxyCertInfo (int pathLenConstraint, | |||
1044 | if (result != ASN1_SUCCESS) | 1044 | if (result != ASN1_SUCCESS) |
1045 | { | 1045 | { |
1046 | gnutls_assert (); | 1046 | gnutls_assert (); |
1047 | return _gnutls_asn2err (result); | 1047 | return mhd_gtls_asn2err (result); |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | if (pathLenConstraint < 0) | 1050 | if (pathLenConstraint < 0) |
1051 | { | 1051 | { |
1052 | result = asn1_write_value (ext, "pCPathLenConstraint", NULL, 0); | 1052 | result = asn1_write_value (ext, "pCPathLenConstraint", NULL, 0); |
1053 | if (result < 0) | 1053 | if (result < 0) |
1054 | result = _gnutls_asn2err (result); | 1054 | result = mhd_gtls_asn2err (result); |
1055 | } | 1055 | } |
1056 | else | 1056 | else |
1057 | result = _gnutls_x509_write_uint32 (ext, "pCPathLenConstraint", | 1057 | result = _gnutls_x509_write_uint32 (ext, "pCPathLenConstraint", |
@@ -1069,7 +1069,7 @@ _gnutls_x509_ext_gen_proxyCertInfo (int pathLenConstraint, | |||
1069 | { | 1069 | { |
1070 | gnutls_assert (); | 1070 | gnutls_assert (); |
1071 | asn1_delete_structure (&ext); | 1071 | asn1_delete_structure (&ext); |
1072 | return _gnutls_asn2err (result); | 1072 | return mhd_gtls_asn2err (result); |
1073 | } | 1073 | } |
1074 | 1074 | ||
1075 | result = asn1_write_value (ext, "proxyPolicy.policy", | 1075 | result = asn1_write_value (ext, "proxyPolicy.policy", |
@@ -1078,7 +1078,7 @@ _gnutls_x509_ext_gen_proxyCertInfo (int pathLenConstraint, | |||
1078 | { | 1078 | { |
1079 | gnutls_assert (); | 1079 | gnutls_assert (); |
1080 | asn1_delete_structure (&ext); | 1080 | asn1_delete_structure (&ext); |
1081 | return _gnutls_asn2err (result); | 1081 | return mhd_gtls_asn2err (result); |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | result = _gnutls_x509_der_encode (ext, "", der_ext, 0); | 1084 | result = _gnutls_x509_der_encode (ext, "", der_ext, 0); |
diff --git a/src/daemon/https/x509/mpi.c b/src/daemon/https/x509/mpi.c index b0ba7393..25a9443d 100644 --- a/src/daemon/https/x509/mpi.c +++ b/src/daemon/https/x509/mpi.c | |||
@@ -48,7 +48,7 @@ _gnutls_x509_read_rsa_params (opaque * der, int dersize, mpi_t * params) | |||
48 | &spk)) != ASN1_SUCCESS) | 48 | &spk)) != ASN1_SUCCESS) |
49 | { | 49 | { |
50 | gnutls_assert (); | 50 | gnutls_assert (); |
51 | return _gnutls_asn2err (result); | 51 | return mhd_gtls_asn2err (result); |
52 | } | 52 | } |
53 | 53 | ||
54 | result = asn1_der_decoding (&spk, der, dersize, NULL); | 54 | result = asn1_der_decoding (&spk, der, dersize, NULL); |
@@ -57,7 +57,7 @@ _gnutls_x509_read_rsa_params (opaque * der, int dersize, mpi_t * params) | |||
57 | { | 57 | { |
58 | gnutls_assert (); | 58 | gnutls_assert (); |
59 | asn1_delete_structure (&spk); | 59 | asn1_delete_structure (&spk); |
60 | return _gnutls_asn2err (result); | 60 | return mhd_gtls_asn2err (result); |
61 | } | 61 | } |
62 | 62 | ||
63 | if ((result = _gnutls_x509_read_int (spk, "modulus", ¶ms[0])) < 0) | 63 | if ((result = _gnutls_x509_read_int (spk, "modulus", ¶ms[0])) < 0) |
@@ -97,7 +97,7 @@ _gnutls_x509_read_dsa_params (opaque * der, int dersize, mpi_t * params) | |||
97 | &spk)) != ASN1_SUCCESS) | 97 | &spk)) != ASN1_SUCCESS) |
98 | { | 98 | { |
99 | gnutls_assert (); | 99 | gnutls_assert (); |
100 | return _gnutls_asn2err (result); | 100 | return mhd_gtls_asn2err (result); |
101 | } | 101 | } |
102 | 102 | ||
103 | result = asn1_der_decoding (&spk, der, dersize, NULL); | 103 | result = asn1_der_decoding (&spk, der, dersize, NULL); |
@@ -106,7 +106,7 @@ _gnutls_x509_read_dsa_params (opaque * der, int dersize, mpi_t * params) | |||
106 | { | 106 | { |
107 | gnutls_assert (); | 107 | gnutls_assert (); |
108 | asn1_delete_structure (&spk); | 108 | asn1_delete_structure (&spk); |
109 | return _gnutls_asn2err (result); | 109 | return mhd_gtls_asn2err (result); |
110 | } | 110 | } |
111 | 111 | ||
112 | /* FIXME: If the parameters are not included in the certificate | 112 | /* FIXME: If the parameters are not included in the certificate |
@@ -165,7 +165,7 @@ _gnutls_x509_read_der_int (opaque * der, int dersize, mpi_t * out) | |||
165 | &spk)) != ASN1_SUCCESS) | 165 | &spk)) != ASN1_SUCCESS) |
166 | { | 166 | { |
167 | gnutls_assert (); | 167 | gnutls_assert (); |
168 | return _gnutls_asn2err (result); | 168 | return mhd_gtls_asn2err (result); |
169 | } | 169 | } |
170 | 170 | ||
171 | result = asn1_der_decoding (&spk, der, dersize, NULL); | 171 | result = asn1_der_decoding (&spk, der, dersize, NULL); |
@@ -174,7 +174,7 @@ _gnutls_x509_read_der_int (opaque * der, int dersize, mpi_t * out) | |||
174 | { | 174 | { |
175 | gnutls_assert (); | 175 | gnutls_assert (); |
176 | asn1_delete_structure (&spk); | 176 | asn1_delete_structure (&spk); |
177 | return _gnutls_asn2err (result); | 177 | return mhd_gtls_asn2err (result); |
178 | } | 178 | } |
179 | 179 | ||
180 | /* Read Y */ | 180 | /* Read Y */ |
@@ -183,7 +183,7 @@ _gnutls_x509_read_der_int (opaque * der, int dersize, mpi_t * out) | |||
183 | { | 183 | { |
184 | gnutls_assert (); | 184 | gnutls_assert (); |
185 | asn1_delete_structure (&spk); | 185 | asn1_delete_structure (&spk); |
186 | return _gnutls_asn2err (result); | 186 | return mhd_gtls_asn2err (result); |
187 | } | 187 | } |
188 | 188 | ||
189 | asn1_delete_structure (&spk); | 189 | asn1_delete_structure (&spk); |
@@ -296,7 +296,7 @@ _gnutls_x509_write_rsa_params (mpi_t * params, | |||
296 | &spk)) != ASN1_SUCCESS) | 296 | &spk)) != ASN1_SUCCESS) |
297 | { | 297 | { |
298 | gnutls_assert (); | 298 | gnutls_assert (); |
299 | return _gnutls_asn2err (result); | 299 | return mhd_gtls_asn2err (result); |
300 | } | 300 | } |
301 | 301 | ||
302 | result = _gnutls_x509_write_int (spk, "modulus", params[0], 0); | 302 | result = _gnutls_x509_write_int (spk, "modulus", params[0], 0); |
@@ -359,7 +359,7 @@ _gnutls_x509_write_sig_params (ASN1_TYPE dst, | |||
359 | if (result != ASN1_SUCCESS) | 359 | if (result != ASN1_SUCCESS) |
360 | { | 360 | { |
361 | gnutls_assert (); | 361 | gnutls_assert (); |
362 | return _gnutls_asn2err (result); | 362 | return mhd_gtls_asn2err (result); |
363 | } | 363 | } |
364 | 364 | ||
365 | mhd_gtls_str_cpy (name, sizeof (name), dst_name); | 365 | mhd_gtls_str_cpy (name, sizeof (name), dst_name); |
@@ -375,7 +375,7 @@ _gnutls_x509_write_sig_params (ASN1_TYPE dst, | |||
375 | * may have been disabled before. | 375 | * may have been disabled before. |
376 | */ | 376 | */ |
377 | gnutls_assert (); | 377 | gnutls_assert (); |
378 | return _gnutls_asn2err (result); | 378 | return mhd_gtls_asn2err (result); |
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
@@ -410,7 +410,7 @@ _gnutls_x509_write_dsa_params (mpi_t * params, | |||
410 | &spk)) != ASN1_SUCCESS) | 410 | &spk)) != ASN1_SUCCESS) |
411 | { | 411 | { |
412 | gnutls_assert (); | 412 | gnutls_assert (); |
413 | return _gnutls_asn2err (result); | 413 | return mhd_gtls_asn2err (result); |
414 | } | 414 | } |
415 | 415 | ||
416 | result = _gnutls_x509_write_int (spk, "p", params[0], 0); | 416 | result = _gnutls_x509_write_int (spk, "p", params[0], 0); |
@@ -475,7 +475,7 @@ _gnutls_x509_write_dsa_public_key (mpi_t * params, | |||
475 | &spk)) != ASN1_SUCCESS) | 475 | &spk)) != ASN1_SUCCESS) |
476 | { | 476 | { |
477 | gnutls_assert (); | 477 | gnutls_assert (); |
478 | return _gnutls_asn2err (result); | 478 | return mhd_gtls_asn2err (result); |
479 | } | 479 | } |
480 | 480 | ||
481 | result = _gnutls_x509_write_int (spk, "", params[3], 0); | 481 | result = _gnutls_x509_write_int (spk, "", params[3], 0); |
@@ -514,7 +514,7 @@ _gnutls_x509_read_uint (ASN1_TYPE node, const char *value, unsigned int *ret) | |||
514 | if (result != ASN1_MEM_ERROR) | 514 | if (result != ASN1_MEM_ERROR) |
515 | { | 515 | { |
516 | gnutls_assert (); | 516 | gnutls_assert (); |
517 | return _gnutls_asn2err (result); | 517 | return mhd_gtls_asn2err (result); |
518 | } | 518 | } |
519 | 519 | ||
520 | tmpstr = gnutls_alloca (len); | 520 | tmpstr = gnutls_alloca (len); |
@@ -530,7 +530,7 @@ _gnutls_x509_read_uint (ASN1_TYPE node, const char *value, unsigned int *ret) | |||
530 | { | 530 | { |
531 | gnutls_assert (); | 531 | gnutls_assert (); |
532 | gnutls_afree (tmpstr); | 532 | gnutls_afree (tmpstr); |
533 | return _gnutls_asn2err (result); | 533 | return mhd_gtls_asn2err (result); |
534 | } | 534 | } |
535 | 535 | ||
536 | if (len == 1) | 536 | if (len == 1) |
@@ -568,7 +568,7 @@ _gnutls_x509_write_uint32 (ASN1_TYPE node, const char *value, uint32_t num) | |||
568 | if (result != ASN1_SUCCESS) | 568 | if (result != ASN1_SUCCESS) |
569 | { | 569 | { |
570 | gnutls_assert (); | 570 | gnutls_assert (); |
571 | return _gnutls_asn2err (result); | 571 | return mhd_gtls_asn2err (result); |
572 | } | 572 | } |
573 | 573 | ||
574 | return 0; | 574 | return 0; |
diff --git a/src/daemon/https/x509/pkcs12.c b/src/daemon/https/x509/pkcs12.c index df4a2d99..3d1705ab 100644 --- a/src/daemon/https/x509/pkcs12.c +++ b/src/daemon/https/x509/pkcs12.c | |||
@@ -59,7 +59,7 @@ _decode_pkcs12_auth_safe (ASN1_TYPE pkcs12, ASN1_TYPE * authen_safe, | |||
59 | if (result != ASN1_SUCCESS) | 59 | if (result != ASN1_SUCCESS) |
60 | { | 60 | { |
61 | gnutls_assert (); | 61 | gnutls_assert (); |
62 | return _gnutls_asn2err (result); | 62 | return mhd_gtls_asn2err (result); |
63 | } | 63 | } |
64 | 64 | ||
65 | if (strcmp (oid, DATA_OID) != 0) | 65 | if (strcmp (oid, DATA_OID) != 0) |
@@ -89,7 +89,7 @@ _decode_pkcs12_auth_safe (ASN1_TYPE pkcs12, ASN1_TYPE * authen_safe, | |||
89 | &c2)) != ASN1_SUCCESS) | 89 | &c2)) != ASN1_SUCCESS) |
90 | { | 90 | { |
91 | gnutls_assert (); | 91 | gnutls_assert (); |
92 | result = _gnutls_asn2err (result); | 92 | result = mhd_gtls_asn2err (result); |
93 | goto cleanup; | 93 | goto cleanup; |
94 | } | 94 | } |
95 | 95 | ||
@@ -97,7 +97,7 @@ _decode_pkcs12_auth_safe (ASN1_TYPE pkcs12, ASN1_TYPE * authen_safe, | |||
97 | if (result != ASN1_SUCCESS) | 97 | if (result != ASN1_SUCCESS) |
98 | { | 98 | { |
99 | gnutls_assert (); | 99 | gnutls_assert (); |
100 | result = _gnutls_asn2err (result); | 100 | result = mhd_gtls_asn2err (result); |
101 | goto cleanup; | 101 | goto cleanup; |
102 | } | 102 | } |
103 | 103 | ||
@@ -150,7 +150,7 @@ gnutls_pkcs12_init (gnutls_pkcs12_t * pkcs12) | |||
150 | { | 150 | { |
151 | gnutls_assert (); | 151 | gnutls_assert (); |
152 | gnutls_free (*pkcs12); | 152 | gnutls_free (*pkcs12); |
153 | return _gnutls_asn2err (result); | 153 | return mhd_gtls_asn2err (result); |
154 | } | 154 | } |
155 | return 0; /* success */ | 155 | return 0; /* success */ |
156 | } | 156 | } |
@@ -234,7 +234,7 @@ gnutls_pkcs12_import (gnutls_pkcs12_t pkcs12, | |||
234 | result = asn1_der_decoding (&pkcs12->pkcs12, _data.data, _data.size, NULL); | 234 | result = asn1_der_decoding (&pkcs12->pkcs12, _data.data, _data.size, NULL); |
235 | if (result != ASN1_SUCCESS) | 235 | if (result != ASN1_SUCCESS) |
236 | { | 236 | { |
237 | result = _gnutls_asn2err (result); | 237 | result = mhd_gtls_asn2err (result); |
238 | gnutls_assert (); | 238 | gnutls_assert (); |
239 | goto cleanup; | 239 | goto cleanup; |
240 | } | 240 | } |
@@ -360,7 +360,7 @@ _pkcs12_decode_safe_contents (const gnutls_datum_t * content, | |||
360 | &c2)) != ASN1_SUCCESS) | 360 | &c2)) != ASN1_SUCCESS) |
361 | { | 361 | { |
362 | gnutls_assert (); | 362 | gnutls_assert (); |
363 | result = _gnutls_asn2err (result); | 363 | result = mhd_gtls_asn2err (result); |
364 | goto cleanup; | 364 | goto cleanup; |
365 | } | 365 | } |
366 | 366 | ||
@@ -368,7 +368,7 @@ _pkcs12_decode_safe_contents (const gnutls_datum_t * content, | |||
368 | if (result != ASN1_SUCCESS) | 368 | if (result != ASN1_SUCCESS) |
369 | { | 369 | { |
370 | gnutls_assert (); | 370 | gnutls_assert (); |
371 | result = _gnutls_asn2err (result); | 371 | result = mhd_gtls_asn2err (result); |
372 | goto cleanup; | 372 | goto cleanup; |
373 | } | 373 | } |
374 | 374 | ||
@@ -378,7 +378,7 @@ _pkcs12_decode_safe_contents (const gnutls_datum_t * content, | |||
378 | if (result != ASN1_SUCCESS) | 378 | if (result != ASN1_SUCCESS) |
379 | { | 379 | { |
380 | gnutls_assert (); | 380 | gnutls_assert (); |
381 | result = _gnutls_asn2err (result); | 381 | result = mhd_gtls_asn2err (result); |
382 | goto cleanup; | 382 | goto cleanup; |
383 | } | 383 | } |
384 | 384 | ||
@@ -394,7 +394,7 @@ _pkcs12_decode_safe_contents (const gnutls_datum_t * content, | |||
394 | if (result != ASN1_SUCCESS) | 394 | if (result != ASN1_SUCCESS) |
395 | { | 395 | { |
396 | gnutls_assert (); | 396 | gnutls_assert (); |
397 | result = _gnutls_asn2err (result); | 397 | result = mhd_gtls_asn2err (result); |
398 | goto cleanup; | 398 | goto cleanup; |
399 | } | 399 | } |
400 | 400 | ||
@@ -443,7 +443,7 @@ _pkcs12_decode_safe_contents (const gnutls_datum_t * content, | |||
443 | if (result != ASN1_SUCCESS && result != ASN1_ELEMENT_NOT_FOUND) | 443 | if (result != ASN1_SUCCESS && result != ASN1_ELEMENT_NOT_FOUND) |
444 | { | 444 | { |
445 | gnutls_assert (); | 445 | gnutls_assert (); |
446 | result = _gnutls_asn2err (result); | 446 | result = mhd_gtls_asn2err (result); |
447 | goto cleanup; | 447 | goto cleanup; |
448 | } | 448 | } |
449 | 449 | ||
@@ -619,7 +619,7 @@ gnutls_pkcs12_get_bag (gnutls_pkcs12_t pkcs12, | |||
619 | if (result != ASN1_SUCCESS) | 619 | if (result != ASN1_SUCCESS) |
620 | { | 620 | { |
621 | gnutls_assert (); | 621 | gnutls_assert (); |
622 | result = _gnutls_asn2err (result); | 622 | result = mhd_gtls_asn2err (result); |
623 | goto cleanup; | 623 | goto cleanup; |
624 | } | 624 | } |
625 | 625 | ||
@@ -669,7 +669,7 @@ create_empty_pfx (ASN1_TYPE pkcs12) | |||
669 | if (result != ASN1_SUCCESS) | 669 | if (result != ASN1_SUCCESS) |
670 | { | 670 | { |
671 | gnutls_assert (); | 671 | gnutls_assert (); |
672 | result = _gnutls_asn2err (result); | 672 | result = mhd_gtls_asn2err (result); |
673 | goto cleanup; | 673 | goto cleanup; |
674 | } | 674 | } |
675 | 675 | ||
@@ -679,7 +679,7 @@ create_empty_pfx (ASN1_TYPE pkcs12) | |||
679 | if (result != ASN1_SUCCESS) | 679 | if (result != ASN1_SUCCESS) |
680 | { | 680 | { |
681 | gnutls_assert (); | 681 | gnutls_assert (); |
682 | result = _gnutls_asn2err (result); | 682 | result = mhd_gtls_asn2err (result); |
683 | goto cleanup; | 683 | goto cleanup; |
684 | } | 684 | } |
685 | 685 | ||
@@ -692,7 +692,7 @@ create_empty_pfx (ASN1_TYPE pkcs12) | |||
692 | &c2)) != ASN1_SUCCESS) | 692 | &c2)) != ASN1_SUCCESS) |
693 | { | 693 | { |
694 | gnutls_assert (); | 694 | gnutls_assert (); |
695 | result = _gnutls_asn2err (result); | 695 | result = mhd_gtls_asn2err (result); |
696 | goto cleanup; | 696 | goto cleanup; |
697 | } | 697 | } |
698 | 698 | ||
@@ -777,7 +777,7 @@ gnutls_pkcs12_set_bag (gnutls_pkcs12_t pkcs12, gnutls_pkcs12_bag_t bag) | |||
777 | if (result != ASN1_SUCCESS) | 777 | if (result != ASN1_SUCCESS) |
778 | { | 778 | { |
779 | gnutls_assert (); | 779 | gnutls_assert (); |
780 | result = _gnutls_asn2err (result); | 780 | result = mhd_gtls_asn2err (result); |
781 | goto cleanup; | 781 | goto cleanup; |
782 | } | 782 | } |
783 | 783 | ||
@@ -788,7 +788,7 @@ gnutls_pkcs12_set_bag (gnutls_pkcs12_t pkcs12, gnutls_pkcs12_bag_t bag) | |||
788 | if (result != ASN1_SUCCESS) | 788 | if (result != ASN1_SUCCESS) |
789 | { | 789 | { |
790 | gnutls_assert (); | 790 | gnutls_assert (); |
791 | result = _gnutls_asn2err (result); | 791 | result = mhd_gtls_asn2err (result); |
792 | goto cleanup; | 792 | goto cleanup; |
793 | } | 793 | } |
794 | 794 | ||
@@ -803,7 +803,7 @@ gnutls_pkcs12_set_bag (gnutls_pkcs12_t pkcs12, gnutls_pkcs12_bag_t bag) | |||
803 | if (result != ASN1_SUCCESS) | 803 | if (result != ASN1_SUCCESS) |
804 | { | 804 | { |
805 | gnutls_assert (); | 805 | gnutls_assert (); |
806 | result = _gnutls_asn2err (result); | 806 | result = mhd_gtls_asn2err (result); |
807 | goto cleanup; | 807 | goto cleanup; |
808 | } | 808 | } |
809 | } | 809 | } |
@@ -884,7 +884,7 @@ gnutls_pkcs12_generate_mac (gnutls_pkcs12_t pkcs12, const char *pass) | |||
884 | if (result != ASN1_SUCCESS) | 884 | if (result != ASN1_SUCCESS) |
885 | { | 885 | { |
886 | gnutls_assert (); | 886 | gnutls_assert (); |
887 | result = _gnutls_asn2err (result); | 887 | result = mhd_gtls_asn2err (result); |
888 | goto cleanup; | 888 | goto cleanup; |
889 | } | 889 | } |
890 | 890 | ||
@@ -944,7 +944,7 @@ gnutls_pkcs12_generate_mac (gnutls_pkcs12_t pkcs12, const char *pass) | |||
944 | if (result != ASN1_SUCCESS) | 944 | if (result != ASN1_SUCCESS) |
945 | { | 945 | { |
946 | gnutls_assert (); | 946 | gnutls_assert (); |
947 | result = _gnutls_asn2err (result); | 947 | result = mhd_gtls_asn2err (result); |
948 | goto cleanup; | 948 | goto cleanup; |
949 | } | 949 | } |
950 | 950 | ||
@@ -954,7 +954,7 @@ gnutls_pkcs12_generate_mac (gnutls_pkcs12_t pkcs12, const char *pass) | |||
954 | if (result != ASN1_SUCCESS) | 954 | if (result != ASN1_SUCCESS) |
955 | { | 955 | { |
956 | gnutls_assert (); | 956 | gnutls_assert (); |
957 | result = _gnutls_asn2err (result); | 957 | result = mhd_gtls_asn2err (result); |
958 | goto cleanup; | 958 | goto cleanup; |
959 | } | 959 | } |
960 | 960 | ||
@@ -965,7 +965,7 @@ gnutls_pkcs12_generate_mac (gnutls_pkcs12_t pkcs12, const char *pass) | |||
965 | if (result != ASN1_SUCCESS) | 965 | if (result != ASN1_SUCCESS) |
966 | { | 966 | { |
967 | gnutls_assert (); | 967 | gnutls_assert (); |
968 | result = _gnutls_asn2err (result); | 968 | result = mhd_gtls_asn2err (result); |
969 | goto cleanup; | 969 | goto cleanup; |
970 | } | 970 | } |
971 | 971 | ||
@@ -1023,7 +1023,7 @@ gnutls_pkcs12_verify_mac (gnutls_pkcs12_t pkcs12, const char *pass) | |||
1023 | if (result != ASN1_SUCCESS) | 1023 | if (result != ASN1_SUCCESS) |
1024 | { | 1024 | { |
1025 | gnutls_assert (); | 1025 | gnutls_assert (); |
1026 | result = _gnutls_asn2err (result); | 1026 | result = mhd_gtls_asn2err (result); |
1027 | goto cleanup; | 1027 | goto cleanup; |
1028 | } | 1028 | } |
1029 | 1029 | ||
@@ -1070,7 +1070,7 @@ gnutls_pkcs12_verify_mac (gnutls_pkcs12_t pkcs12, const char *pass) | |||
1070 | if (result != ASN1_SUCCESS) | 1070 | if (result != ASN1_SUCCESS) |
1071 | { | 1071 | { |
1072 | gnutls_assert (); | 1072 | gnutls_assert (); |
1073 | result = _gnutls_asn2err (result); | 1073 | result = mhd_gtls_asn2err (result); |
1074 | goto cleanup; | 1074 | goto cleanup; |
1075 | } | 1075 | } |
1076 | 1076 | ||
@@ -1108,7 +1108,7 @@ write_attributes (gnutls_pkcs12_bag_t bag, int elem, | |||
1108 | if (result != ASN1_SUCCESS) | 1108 | if (result != ASN1_SUCCESS) |
1109 | { | 1109 | { |
1110 | gnutls_assert (); | 1110 | gnutls_assert (); |
1111 | return _gnutls_asn2err (result); | 1111 | return mhd_gtls_asn2err (result); |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | return 0; | 1114 | return 0; |
@@ -1123,7 +1123,7 @@ write_attributes (gnutls_pkcs12_bag_t bag, int elem, | |||
1123 | if (result != ASN1_SUCCESS) | 1123 | if (result != ASN1_SUCCESS) |
1124 | { | 1124 | { |
1125 | gnutls_assert (); | 1125 | gnutls_assert (); |
1126 | return _gnutls_asn2err (result); | 1126 | return mhd_gtls_asn2err (result); |
1127 | } | 1127 | } |
1128 | 1128 | ||
1129 | mhd_gtls_str_cpy (root, sizeof (root), where); | 1129 | mhd_gtls_str_cpy (root, sizeof (root), where); |
@@ -1154,7 +1154,7 @@ write_attributes (gnutls_pkcs12_bag_t bag, int elem, | |||
1154 | if (result != ASN1_SUCCESS) | 1154 | if (result != ASN1_SUCCESS) |
1155 | { | 1155 | { |
1156 | gnutls_assert (); | 1156 | gnutls_assert (); |
1157 | return _gnutls_asn2err (result); | 1157 | return mhd_gtls_asn2err (result); |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | /* convert name to BMPString | 1160 | /* convert name to BMPString |
@@ -1224,7 +1224,7 @@ _pkcs12_encode_safe_contents (gnutls_pkcs12_bag_t bag, ASN1_TYPE * contents, | |||
1224 | &c2)) != ASN1_SUCCESS) | 1224 | &c2)) != ASN1_SUCCESS) |
1225 | { | 1225 | { |
1226 | gnutls_assert (); | 1226 | gnutls_assert (); |
1227 | result = _gnutls_asn2err (result); | 1227 | result = mhd_gtls_asn2err (result); |
1228 | goto cleanup; | 1228 | goto cleanup; |
1229 | } | 1229 | } |
1230 | 1230 | ||
@@ -1242,7 +1242,7 @@ _pkcs12_encode_safe_contents (gnutls_pkcs12_bag_t bag, ASN1_TYPE * contents, | |||
1242 | if (result != ASN1_SUCCESS) | 1242 | if (result != ASN1_SUCCESS) |
1243 | { | 1243 | { |
1244 | gnutls_assert (); | 1244 | gnutls_assert (); |
1245 | result = _gnutls_asn2err (result); | 1245 | result = mhd_gtls_asn2err (result); |
1246 | goto cleanup; | 1246 | goto cleanup; |
1247 | } | 1247 | } |
1248 | 1248 | ||
@@ -1252,7 +1252,7 @@ _pkcs12_encode_safe_contents (gnutls_pkcs12_bag_t bag, ASN1_TYPE * contents, | |||
1252 | if (result != ASN1_SUCCESS) | 1252 | if (result != ASN1_SUCCESS) |
1253 | { | 1253 | { |
1254 | gnutls_assert (); | 1254 | gnutls_assert (); |
1255 | result = _gnutls_asn2err (result); | 1255 | result = mhd_gtls_asn2err (result); |
1256 | goto cleanup; | 1256 | goto cleanup; |
1257 | } | 1257 | } |
1258 | 1258 | ||
diff --git a/src/daemon/https/x509/pkcs12_bag.c b/src/daemon/https/x509/pkcs12_bag.c index c34ec757..780dfb52 100644 --- a/src/daemon/https/x509/pkcs12_bag.c +++ b/src/daemon/https/x509/pkcs12_bag.c | |||
@@ -185,7 +185,7 @@ _pkcs12_decode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
185 | &c2)) != ASN1_SUCCESS) | 185 | &c2)) != ASN1_SUCCESS) |
186 | { | 186 | { |
187 | gnutls_assert (); | 187 | gnutls_assert (); |
188 | ret = _gnutls_asn2err (ret); | 188 | ret = mhd_gtls_asn2err (ret); |
189 | goto cleanup; | 189 | goto cleanup; |
190 | } | 190 | } |
191 | 191 | ||
@@ -193,7 +193,7 @@ _pkcs12_decode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
193 | if (ret != ASN1_SUCCESS) | 193 | if (ret != ASN1_SUCCESS) |
194 | { | 194 | { |
195 | gnutls_assert (); | 195 | gnutls_assert (); |
196 | ret = _gnutls_asn2err (ret); | 196 | ret = mhd_gtls_asn2err (ret); |
197 | goto cleanup; | 197 | goto cleanup; |
198 | } | 198 | } |
199 | 199 | ||
@@ -212,7 +212,7 @@ _pkcs12_decode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
212 | &c2)) != ASN1_SUCCESS) | 212 | &c2)) != ASN1_SUCCESS) |
213 | { | 213 | { |
214 | gnutls_assert (); | 214 | gnutls_assert (); |
215 | ret = _gnutls_asn2err (ret); | 215 | ret = mhd_gtls_asn2err (ret); |
216 | goto cleanup; | 216 | goto cleanup; |
217 | } | 217 | } |
218 | 218 | ||
@@ -220,7 +220,7 @@ _pkcs12_decode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
220 | if (ret != ASN1_SUCCESS) | 220 | if (ret != ASN1_SUCCESS) |
221 | { | 221 | { |
222 | gnutls_assert (); | 222 | gnutls_assert (); |
223 | ret = _gnutls_asn2err (ret); | 223 | ret = mhd_gtls_asn2err (ret); |
224 | goto cleanup; | 224 | goto cleanup; |
225 | } | 225 | } |
226 | 226 | ||
@@ -258,7 +258,7 @@ _pkcs12_encode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
258 | &c2)) != ASN1_SUCCESS) | 258 | &c2)) != ASN1_SUCCESS) |
259 | { | 259 | { |
260 | gnutls_assert (); | 260 | gnutls_assert (); |
261 | ret = _gnutls_asn2err (ret); | 261 | ret = mhd_gtls_asn2err (ret); |
262 | goto cleanup; | 262 | goto cleanup; |
263 | } | 263 | } |
264 | 264 | ||
@@ -266,7 +266,7 @@ _pkcs12_encode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
266 | if (ret != ASN1_SUCCESS) | 266 | if (ret != ASN1_SUCCESS) |
267 | { | 267 | { |
268 | gnutls_assert (); | 268 | gnutls_assert (); |
269 | ret = _gnutls_asn2err (ret); | 269 | ret = mhd_gtls_asn2err (ret); |
270 | goto cleanup; | 270 | goto cleanup; |
271 | } | 271 | } |
272 | 272 | ||
@@ -285,7 +285,7 @@ _pkcs12_encode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
285 | &c2)) != ASN1_SUCCESS) | 285 | &c2)) != ASN1_SUCCESS) |
286 | { | 286 | { |
287 | gnutls_assert (); | 287 | gnutls_assert (); |
288 | ret = _gnutls_asn2err (ret); | 288 | ret = mhd_gtls_asn2err (ret); |
289 | goto cleanup; | 289 | goto cleanup; |
290 | } | 290 | } |
291 | 291 | ||
@@ -293,7 +293,7 @@ _pkcs12_encode_crt_bag (gnutls_pkcs12_bag_type_t type, | |||
293 | if (ret != ASN1_SUCCESS) | 293 | if (ret != ASN1_SUCCESS) |
294 | { | 294 | { |
295 | gnutls_assert (); | 295 | gnutls_assert (); |
296 | ret = _gnutls_asn2err (ret); | 296 | ret = mhd_gtls_asn2err (ret); |
297 | goto cleanup; | 297 | goto cleanup; |
298 | } | 298 | } |
299 | 299 | ||
diff --git a/src/daemon/https/x509/pkcs7.c b/src/daemon/https/x509/pkcs7.c index 35f21b12..3cef67c2 100644 --- a/src/daemon/https/x509/pkcs7.c +++ b/src/daemon/https/x509/pkcs7.c | |||
@@ -58,7 +58,7 @@ _decode_pkcs7_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata, | |||
58 | if (result != ASN1_SUCCESS) | 58 | if (result != ASN1_SUCCESS) |
59 | { | 59 | { |
60 | gnutls_assert (); | 60 | gnutls_assert (); |
61 | return _gnutls_asn2err (result); | 61 | return mhd_gtls_asn2err (result); |
62 | } | 62 | } |
63 | 63 | ||
64 | if (strcmp (oid, SIGNED_DATA_OID) != 0) | 64 | if (strcmp (oid, SIGNED_DATA_OID) != 0) |
@@ -72,7 +72,7 @@ _decode_pkcs7_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata, | |||
72 | (_gnutls_get_pkix (), "PKIX1.pkcs-7-SignedData", &c2)) != ASN1_SUCCESS) | 72 | (_gnutls_get_pkix (), "PKIX1.pkcs-7-SignedData", &c2)) != ASN1_SUCCESS) |
73 | { | 73 | { |
74 | gnutls_assert (); | 74 | gnutls_assert (); |
75 | return _gnutls_asn2err (result); | 75 | return mhd_gtls_asn2err (result); |
76 | } | 76 | } |
77 | 77 | ||
78 | /* the Signed-data has been created, so | 78 | /* the Signed-data has been created, so |
@@ -83,7 +83,7 @@ _decode_pkcs7_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata, | |||
83 | if (result != ASN1_MEM_ERROR) | 83 | if (result != ASN1_MEM_ERROR) |
84 | { | 84 | { |
85 | gnutls_assert (); | 85 | gnutls_assert (); |
86 | result = _gnutls_asn2err (result); | 86 | result = mhd_gtls_asn2err (result); |
87 | goto cleanup; | 87 | goto cleanup; |
88 | } | 88 | } |
89 | 89 | ||
@@ -99,7 +99,7 @@ _decode_pkcs7_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata, | |||
99 | if (result != ASN1_SUCCESS) | 99 | if (result != ASN1_SUCCESS) |
100 | { | 100 | { |
101 | gnutls_assert (); | 101 | gnutls_assert (); |
102 | result = _gnutls_asn2err (result); | 102 | result = mhd_gtls_asn2err (result); |
103 | goto cleanup; | 103 | goto cleanup; |
104 | } | 104 | } |
105 | 105 | ||
@@ -114,7 +114,7 @@ _decode_pkcs7_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata, | |||
114 | if (result != ASN1_SUCCESS) | 114 | if (result != ASN1_SUCCESS) |
115 | { | 115 | { |
116 | gnutls_assert (); | 116 | gnutls_assert (); |
117 | result = _gnutls_asn2err (result); | 117 | result = mhd_gtls_asn2err (result); |
118 | goto cleanup; | 118 | goto cleanup; |
119 | } | 119 | } |
120 | 120 | ||
@@ -164,7 +164,7 @@ gnutls_pkcs7_init (gnutls_pkcs7_t * pkcs7) | |||
164 | { | 164 | { |
165 | gnutls_assert (); | 165 | gnutls_assert (); |
166 | gnutls_free (*pkcs7); | 166 | gnutls_free (*pkcs7); |
167 | return _gnutls_asn2err (result); | 167 | return mhd_gtls_asn2err (result); |
168 | } | 168 | } |
169 | return 0; /* success */ | 169 | return 0; /* success */ |
170 | } | 170 | } |
@@ -244,7 +244,7 @@ gnutls_pkcs7_import (gnutls_pkcs7_t pkcs7, const gnutls_datum_t * data, | |||
244 | result = asn1_der_decoding (&pkcs7->pkcs7, _data.data, _data.size, NULL); | 244 | result = asn1_der_decoding (&pkcs7->pkcs7, _data.data, _data.size, NULL); |
245 | if (result != ASN1_SUCCESS) | 245 | if (result != ASN1_SUCCESS) |
246 | { | 246 | { |
247 | result = _gnutls_asn2err (result); | 247 | result = mhd_gtls_asn2err (result); |
248 | gnutls_assert (); | 248 | gnutls_assert (); |
249 | goto cleanup; | 249 | goto cleanup; |
250 | } | 250 | } |
@@ -316,7 +316,7 @@ gnutls_pkcs7_get_crt_raw (gnutls_pkcs7_t pkcs7, | |||
316 | if (result != ASN1_SUCCESS) | 316 | if (result != ASN1_SUCCESS) |
317 | { | 317 | { |
318 | gnutls_assert (); | 318 | gnutls_assert (); |
319 | result = _gnutls_asn2err (result); | 319 | result = mhd_gtls_asn2err (result); |
320 | goto cleanup; | 320 | goto cleanup; |
321 | } | 321 | } |
322 | 322 | ||
@@ -332,7 +332,7 @@ gnutls_pkcs7_get_crt_raw (gnutls_pkcs7_t pkcs7, | |||
332 | if (result != ASN1_SUCCESS) | 332 | if (result != ASN1_SUCCESS) |
333 | { | 333 | { |
334 | gnutls_assert (); | 334 | gnutls_assert (); |
335 | result = _gnutls_asn2err (result); | 335 | result = mhd_gtls_asn2err (result); |
336 | goto cleanup; | 336 | goto cleanup; |
337 | } | 337 | } |
338 | 338 | ||
@@ -458,7 +458,7 @@ create_empty_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata) | |||
458 | sdata)) != ASN1_SUCCESS) | 458 | sdata)) != ASN1_SUCCESS) |
459 | { | 459 | { |
460 | gnutls_assert (); | 460 | gnutls_assert (); |
461 | result = _gnutls_asn2err (result); | 461 | result = mhd_gtls_asn2err (result); |
462 | goto cleanup; | 462 | goto cleanup; |
463 | } | 463 | } |
464 | 464 | ||
@@ -468,7 +468,7 @@ create_empty_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata) | |||
468 | if (result != ASN1_SUCCESS) | 468 | if (result != ASN1_SUCCESS) |
469 | { | 469 | { |
470 | gnutls_assert (); | 470 | gnutls_assert (); |
471 | result = _gnutls_asn2err (result); | 471 | result = mhd_gtls_asn2err (result); |
472 | goto cleanup; | 472 | goto cleanup; |
473 | } | 473 | } |
474 | 474 | ||
@@ -482,7 +482,7 @@ create_empty_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata) | |||
482 | if (result != ASN1_SUCCESS) | 482 | if (result != ASN1_SUCCESS) |
483 | { | 483 | { |
484 | gnutls_assert (); | 484 | gnutls_assert (); |
485 | result = _gnutls_asn2err (result); | 485 | result = mhd_gtls_asn2err (result); |
486 | goto cleanup; | 486 | goto cleanup; |
487 | } | 487 | } |
488 | 488 | ||
@@ -490,7 +490,7 @@ create_empty_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata) | |||
490 | if (result != ASN1_SUCCESS) | 490 | if (result != ASN1_SUCCESS) |
491 | { | 491 | { |
492 | gnutls_assert (); | 492 | gnutls_assert (); |
493 | result = _gnutls_asn2err (result); | 493 | result = mhd_gtls_asn2err (result); |
494 | goto cleanup; | 494 | goto cleanup; |
495 | } | 495 | } |
496 | 496 | ||
@@ -509,7 +509,7 @@ create_empty_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata) | |||
509 | if (result != ASN1_SUCCESS) | 509 | if (result != ASN1_SUCCESS) |
510 | { | 510 | { |
511 | gnutls_assert (); | 511 | gnutls_assert (); |
512 | result = _gnutls_asn2err (result); | 512 | result = mhd_gtls_asn2err (result); |
513 | goto cleanup; | 513 | goto cleanup; |
514 | } | 514 | } |
515 | 515 | ||
@@ -571,7 +571,7 @@ gnutls_pkcs7_set_crt_raw (gnutls_pkcs7_t pkcs7, const gnutls_datum_t * crt) | |||
571 | if (result != ASN1_SUCCESS) | 571 | if (result != ASN1_SUCCESS) |
572 | { | 572 | { |
573 | gnutls_assert (); | 573 | gnutls_assert (); |
574 | result = _gnutls_asn2err (result); | 574 | result = mhd_gtls_asn2err (result); |
575 | goto cleanup; | 575 | goto cleanup; |
576 | } | 576 | } |
577 | 577 | ||
@@ -579,7 +579,7 @@ gnutls_pkcs7_set_crt_raw (gnutls_pkcs7_t pkcs7, const gnutls_datum_t * crt) | |||
579 | if (result != ASN1_SUCCESS) | 579 | if (result != ASN1_SUCCESS) |
580 | { | 580 | { |
581 | gnutls_assert (); | 581 | gnutls_assert (); |
582 | result = _gnutls_asn2err (result); | 582 | result = mhd_gtls_asn2err (result); |
583 | goto cleanup; | 583 | goto cleanup; |
584 | } | 584 | } |
585 | 585 | ||
@@ -589,7 +589,7 @@ gnutls_pkcs7_set_crt_raw (gnutls_pkcs7_t pkcs7, const gnutls_datum_t * crt) | |||
589 | if (result != ASN1_SUCCESS) | 589 | if (result != ASN1_SUCCESS) |
590 | { | 590 | { |
591 | gnutls_assert (); | 591 | gnutls_assert (); |
592 | result = _gnutls_asn2err (result); | 592 | result = mhd_gtls_asn2err (result); |
593 | goto cleanup; | 593 | goto cleanup; |
594 | } | 594 | } |
595 | 595 | ||
@@ -691,7 +691,7 @@ gnutls_pkcs7_delete_crt (gnutls_pkcs7_t pkcs7, int indx) | |||
691 | if (result != ASN1_SUCCESS) | 691 | if (result != ASN1_SUCCESS) |
692 | { | 692 | { |
693 | gnutls_assert (); | 693 | gnutls_assert (); |
694 | result = _gnutls_asn2err (result); | 694 | result = mhd_gtls_asn2err (result); |
695 | goto cleanup; | 695 | goto cleanup; |
696 | } | 696 | } |
697 | 697 | ||
@@ -768,7 +768,7 @@ gnutls_pkcs7_get_crl_raw (gnutls_pkcs7_t pkcs7, | |||
768 | if (result != ASN1_SUCCESS) | 768 | if (result != ASN1_SUCCESS) |
769 | { | 769 | { |
770 | gnutls_assert (); | 770 | gnutls_assert (); |
771 | result = _gnutls_asn2err (result); | 771 | result = mhd_gtls_asn2err (result); |
772 | goto cleanup; | 772 | goto cleanup; |
773 | } | 773 | } |
774 | 774 | ||
@@ -889,7 +889,7 @@ gnutls_pkcs7_set_crl_raw (gnutls_pkcs7_t pkcs7, const gnutls_datum_t * crl) | |||
889 | if (result != ASN1_SUCCESS) | 889 | if (result != ASN1_SUCCESS) |
890 | { | 890 | { |
891 | gnutls_assert (); | 891 | gnutls_assert (); |
892 | result = _gnutls_asn2err (result); | 892 | result = mhd_gtls_asn2err (result); |
893 | goto cleanup; | 893 | goto cleanup; |
894 | } | 894 | } |
895 | 895 | ||
@@ -897,7 +897,7 @@ gnutls_pkcs7_set_crl_raw (gnutls_pkcs7_t pkcs7, const gnutls_datum_t * crl) | |||
897 | if (result != ASN1_SUCCESS) | 897 | if (result != ASN1_SUCCESS) |
898 | { | 898 | { |
899 | gnutls_assert (); | 899 | gnutls_assert (); |
900 | result = _gnutls_asn2err (result); | 900 | result = mhd_gtls_asn2err (result); |
901 | goto cleanup; | 901 | goto cleanup; |
902 | } | 902 | } |
903 | 903 | ||
@@ -996,7 +996,7 @@ gnutls_pkcs7_delete_crl (gnutls_pkcs7_t pkcs7, int indx) | |||
996 | if (result != ASN1_SUCCESS) | 996 | if (result != ASN1_SUCCESS) |
997 | { | 997 | { |
998 | gnutls_assert (); | 998 | gnutls_assert (); |
999 | result = _gnutls_asn2err (result); | 999 | result = mhd_gtls_asn2err (result); |
1000 | goto cleanup; | 1000 | goto cleanup; |
1001 | } | 1001 | } |
1002 | 1002 | ||
diff --git a/src/daemon/https/x509/privkey_pkcs8.c b/src/daemon/https/x509/privkey_pkcs8.c index 3b33720c..4812c29f 100644 --- a/src/daemon/https/x509/privkey_pkcs8.c +++ b/src/daemon/https/x509/privkey_pkcs8.c | |||
@@ -221,7 +221,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
221 | pkey_info)) != ASN1_SUCCESS) | 221 | pkey_info)) != ASN1_SUCCESS) |
222 | { | 222 | { |
223 | gnutls_assert (); | 223 | gnutls_assert (); |
224 | result = _gnutls_asn2err (result); | 224 | result = mhd_gtls_asn2err (result); |
225 | goto error; | 225 | goto error; |
226 | } | 226 | } |
227 | 227 | ||
@@ -231,7 +231,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
231 | if (result != ASN1_SUCCESS) | 231 | if (result != ASN1_SUCCESS) |
232 | { | 232 | { |
233 | gnutls_assert (); | 233 | gnutls_assert (); |
234 | result = _gnutls_asn2err (result); | 234 | result = mhd_gtls_asn2err (result); |
235 | goto error; | 235 | goto error; |
236 | } | 236 | } |
237 | 237 | ||
@@ -243,7 +243,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
243 | if (result != ASN1_SUCCESS) | 243 | if (result != ASN1_SUCCESS) |
244 | { | 244 | { |
245 | gnutls_assert (); | 245 | gnutls_assert (); |
246 | result = _gnutls_asn2err (result); | 246 | result = mhd_gtls_asn2err (result); |
247 | goto error; | 247 | goto error; |
248 | } | 248 | } |
249 | 249 | ||
@@ -254,7 +254,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
254 | if (result != ASN1_SUCCESS) | 254 | if (result != ASN1_SUCCESS) |
255 | { | 255 | { |
256 | gnutls_assert (); | 256 | gnutls_assert (); |
257 | result = _gnutls_asn2err (result); | 257 | result = mhd_gtls_asn2err (result); |
258 | goto error; | 258 | goto error; |
259 | } | 259 | } |
260 | 260 | ||
@@ -275,7 +275,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
275 | if (result != ASN1_SUCCESS) | 275 | if (result != ASN1_SUCCESS) |
276 | { | 276 | { |
277 | gnutls_assert (); | 277 | gnutls_assert (); |
278 | result = _gnutls_asn2err (result); | 278 | result = mhd_gtls_asn2err (result); |
279 | goto error; | 279 | goto error; |
280 | } | 280 | } |
281 | 281 | ||
@@ -285,7 +285,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
285 | if (result != ASN1_SUCCESS) | 285 | if (result != ASN1_SUCCESS) |
286 | { | 286 | { |
287 | gnutls_assert (); | 287 | gnutls_assert (); |
288 | result = _gnutls_asn2err (result); | 288 | result = mhd_gtls_asn2err (result); |
289 | goto error; | 289 | goto error; |
290 | } | 290 | } |
291 | 291 | ||
@@ -296,7 +296,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
296 | if (result != ASN1_MEM_ERROR) | 296 | if (result != ASN1_MEM_ERROR) |
297 | { | 297 | { |
298 | gnutls_assert (); | 298 | gnutls_assert (); |
299 | result = _gnutls_asn2err (result); | 299 | result = mhd_gtls_asn2err (result); |
300 | goto error; | 300 | goto error; |
301 | } | 301 | } |
302 | 302 | ||
@@ -314,7 +314,7 @@ encode_to_private_key_info (gnutls_x509_privkey_t pkey, | |||
314 | if (result != ASN1_SUCCESS) | 314 | if (result != ASN1_SUCCESS) |
315 | { | 315 | { |
316 | gnutls_assert (); | 316 | gnutls_assert (); |
317 | result = _gnutls_asn2err (result); | 317 | result = mhd_gtls_asn2err (result); |
318 | goto error; | 318 | goto error; |
319 | } | 319 | } |
320 | 320 | ||
@@ -348,7 +348,7 @@ encode_to_pkcs8_key (schema_id schema, const gnutls_datum_t * der_key, | |||
348 | &pkcs8_asn)) != ASN1_SUCCESS) | 348 | &pkcs8_asn)) != ASN1_SUCCESS) |
349 | { | 349 | { |
350 | gnutls_assert (); | 350 | gnutls_assert (); |
351 | result = _gnutls_asn2err (result); | 351 | result = mhd_gtls_asn2err (result); |
352 | goto error; | 352 | goto error; |
353 | } | 353 | } |
354 | 354 | ||
@@ -382,7 +382,7 @@ encode_to_pkcs8_key (schema_id schema, const gnutls_datum_t * der_key, | |||
382 | if (result != ASN1_SUCCESS) | 382 | if (result != ASN1_SUCCESS) |
383 | { | 383 | { |
384 | gnutls_assert (); | 384 | gnutls_assert (); |
385 | result = _gnutls_asn2err (result); | 385 | result = mhd_gtls_asn2err (result); |
386 | goto error; | 386 | goto error; |
387 | } | 387 | } |
388 | 388 | ||
@@ -422,7 +422,7 @@ encode_to_pkcs8_key (schema_id schema, const gnutls_datum_t * der_key, | |||
422 | if (result != ASN1_SUCCESS) | 422 | if (result != ASN1_SUCCESS) |
423 | { | 423 | { |
424 | gnutls_assert (); | 424 | gnutls_assert (); |
425 | result = _gnutls_asn2err (result); | 425 | result = mhd_gtls_asn2err (result); |
426 | goto error; | 426 | goto error; |
427 | } | 427 | } |
428 | 428 | ||
@@ -569,7 +569,7 @@ read_pkcs_schema_params (schema_id schema, const char *password, | |||
569 | &pbes2_asn)) != ASN1_SUCCESS) | 569 | &pbes2_asn)) != ASN1_SUCCESS) |
570 | { | 570 | { |
571 | gnutls_assert (); | 571 | gnutls_assert (); |
572 | result = _gnutls_asn2err (result); | 572 | result = mhd_gtls_asn2err (result); |
573 | goto error; | 573 | goto error; |
574 | } | 574 | } |
575 | 575 | ||
@@ -579,7 +579,7 @@ read_pkcs_schema_params (schema_id schema, const char *password, | |||
579 | if (result != ASN1_SUCCESS) | 579 | if (result != ASN1_SUCCESS) |
580 | { | 580 | { |
581 | gnutls_assert (); | 581 | gnutls_assert (); |
582 | result = _gnutls_asn2err (result); | 582 | result = mhd_gtls_asn2err (result); |
583 | goto error; | 583 | goto error; |
584 | } | 584 | } |
585 | 585 | ||
@@ -590,7 +590,7 @@ read_pkcs_schema_params (schema_id schema, const char *password, | |||
590 | if (result < 0) | 590 | if (result < 0) |
591 | { | 591 | { |
592 | gnutls_assert (); | 592 | gnutls_assert (); |
593 | result = _gnutls_asn2err (result); | 593 | result = mhd_gtls_asn2err (result); |
594 | goto error; | 594 | goto error; |
595 | } | 595 | } |
596 | 596 | ||
@@ -598,7 +598,7 @@ read_pkcs_schema_params (schema_id schema, const char *password, | |||
598 | if (result < 0) | 598 | if (result < 0) |
599 | { | 599 | { |
600 | gnutls_assert (); | 600 | gnutls_assert (); |
601 | result = _gnutls_asn2err (result); | 601 | result = mhd_gtls_asn2err (result); |
602 | goto error; | 602 | goto error; |
603 | } | 603 | } |
604 | 604 | ||
@@ -632,7 +632,7 @@ read_pkcs_schema_params (schema_id schema, const char *password, | |||
632 | &pbes2_asn)) != ASN1_SUCCESS) | 632 | &pbes2_asn)) != ASN1_SUCCESS) |
633 | { | 633 | { |
634 | gnutls_assert (); | 634 | gnutls_assert (); |
635 | result = _gnutls_asn2err (result); | 635 | result = mhd_gtls_asn2err (result); |
636 | goto error; | 636 | goto error; |
637 | } | 637 | } |
638 | 638 | ||
@@ -642,7 +642,7 @@ read_pkcs_schema_params (schema_id schema, const char *password, | |||
642 | if (result != ASN1_SUCCESS) | 642 | if (result != ASN1_SUCCESS) |
643 | { | 643 | { |
644 | gnutls_assert (); | 644 | gnutls_assert (); |
645 | result = _gnutls_asn2err (result); | 645 | result = mhd_gtls_asn2err (result); |
646 | goto error; | 646 | goto error; |
647 | } | 647 | } |
648 | 648 | ||
@@ -705,7 +705,7 @@ decode_pkcs8_key (const gnutls_datum_t * raw_key, | |||
705 | &pkcs8_asn)) != ASN1_SUCCESS) | 705 | &pkcs8_asn)) != ASN1_SUCCESS) |
706 | { | 706 | { |
707 | gnutls_assert (); | 707 | gnutls_assert (); |
708 | result = _gnutls_asn2err (result); | 708 | result = mhd_gtls_asn2err (result); |
709 | goto error; | 709 | goto error; |
710 | } | 710 | } |
711 | 711 | ||
@@ -713,7 +713,7 @@ decode_pkcs8_key (const gnutls_datum_t * raw_key, | |||
713 | if (result != ASN1_SUCCESS) | 713 | if (result != ASN1_SUCCESS) |
714 | { | 714 | { |
715 | gnutls_assert (); | 715 | gnutls_assert (); |
716 | result = _gnutls_asn2err (result); | 716 | result = mhd_gtls_asn2err (result); |
717 | goto error; | 717 | goto error; |
718 | } | 718 | } |
719 | 719 | ||
@@ -747,7 +747,7 @@ decode_pkcs8_key (const gnutls_datum_t * raw_key, | |||
747 | if (result != ASN1_SUCCESS) | 747 | if (result != ASN1_SUCCESS) |
748 | { | 748 | { |
749 | gnutls_assert (); | 749 | gnutls_assert (); |
750 | result = _gnutls_asn2err (result); | 750 | result = mhd_gtls_asn2err (result); |
751 | goto error; | 751 | goto error; |
752 | } | 752 | } |
753 | params_len = params_end - params_start + 1; | 753 | params_len = params_end - params_start + 1; |
@@ -923,7 +923,7 @@ decode_private_key_info (const gnutls_datum_t * der, | |||
923 | &pkcs8_asn)) != ASN1_SUCCESS) | 923 | &pkcs8_asn)) != ASN1_SUCCESS) |
924 | { | 924 | { |
925 | gnutls_assert (); | 925 | gnutls_assert (); |
926 | result = _gnutls_asn2err (result); | 926 | result = mhd_gtls_asn2err (result); |
927 | goto error; | 927 | goto error; |
928 | } | 928 | } |
929 | 929 | ||
@@ -931,7 +931,7 @@ decode_private_key_info (const gnutls_datum_t * der, | |||
931 | if (result != ASN1_SUCCESS) | 931 | if (result != ASN1_SUCCESS) |
932 | { | 932 | { |
933 | gnutls_assert (); | 933 | gnutls_assert (); |
934 | result = _gnutls_asn2err (result); | 934 | result = mhd_gtls_asn2err (result); |
935 | goto error; | 935 | goto error; |
936 | } | 936 | } |
937 | 937 | ||
@@ -943,7 +943,7 @@ decode_private_key_info (const gnutls_datum_t * der, | |||
943 | if (result != ASN1_SUCCESS) | 943 | if (result != ASN1_SUCCESS) |
944 | { | 944 | { |
945 | gnutls_assert (); | 945 | gnutls_assert (); |
946 | result = _gnutls_asn2err (result); | 946 | result = mhd_gtls_asn2err (result); |
947 | goto error; | 947 | goto error; |
948 | } | 948 | } |
949 | 949 | ||
@@ -1109,7 +1109,7 @@ read_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1109 | if (result != ASN1_SUCCESS) | 1109 | if (result != ASN1_SUCCESS) |
1110 | { | 1110 | { |
1111 | gnutls_assert (); | 1111 | gnutls_assert (); |
1112 | return _gnutls_asn2err (result); | 1112 | return mhd_gtls_asn2err (result); |
1113 | } | 1113 | } |
1114 | _gnutls_hard_log ("keyDerivationFunc.algorithm: %s\n", oid); | 1114 | _gnutls_hard_log ("keyDerivationFunc.algorithm: %s\n", oid); |
1115 | 1115 | ||
@@ -1118,7 +1118,7 @@ read_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1118 | gnutls_assert (); | 1118 | gnutls_assert (); |
1119 | _gnutls_x509_log | 1119 | _gnutls_x509_log |
1120 | ("PKCS #8 key derivation OID '%s' is unsupported.\n", oid); | 1120 | ("PKCS #8 key derivation OID '%s' is unsupported.\n", oid); |
1121 | return _gnutls_asn2err (result); | 1121 | return mhd_gtls_asn2err (result); |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | result = | 1124 | result = |
@@ -1128,7 +1128,7 @@ read_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1128 | if (result != ASN1_SUCCESS) | 1128 | if (result != ASN1_SUCCESS) |
1129 | { | 1129 | { |
1130 | gnutls_assert (); | 1130 | gnutls_assert (); |
1131 | return _gnutls_asn2err (result); | 1131 | return mhd_gtls_asn2err (result); |
1132 | } | 1132 | } |
1133 | params_len = params_end - params_start + 1; | 1133 | params_len = params_end - params_start + 1; |
1134 | 1134 | ||
@@ -1141,7 +1141,7 @@ read_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1141 | &pbkdf2_asn)) != ASN1_SUCCESS) | 1141 | &pbkdf2_asn)) != ASN1_SUCCESS) |
1142 | { | 1142 | { |
1143 | gnutls_assert (); | 1143 | gnutls_assert (); |
1144 | return _gnutls_asn2err (result); | 1144 | return mhd_gtls_asn2err (result); |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | result = | 1147 | result = |
@@ -1150,7 +1150,7 @@ read_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1150 | if (result != ASN1_SUCCESS) | 1150 | if (result != ASN1_SUCCESS) |
1151 | { | 1151 | { |
1152 | gnutls_assert (); | 1152 | gnutls_assert (); |
1153 | result = _gnutls_asn2err (result); | 1153 | result = mhd_gtls_asn2err (result); |
1154 | goto error; | 1154 | goto error; |
1155 | } | 1155 | } |
1156 | 1156 | ||
@@ -1162,7 +1162,7 @@ read_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1162 | if (result != ASN1_SUCCESS) | 1162 | if (result != ASN1_SUCCESS) |
1163 | { | 1163 | { |
1164 | gnutls_assert (); | 1164 | gnutls_assert (); |
1165 | result = _gnutls_asn2err (result); | 1165 | result = mhd_gtls_asn2err (result); |
1166 | goto error; | 1166 | goto error; |
1167 | } | 1167 | } |
1168 | _gnutls_hard_log ("salt.specified.size: %d\n", params->salt_size); | 1168 | _gnutls_hard_log ("salt.specified.size: %d\n", params->salt_size); |
@@ -1216,7 +1216,7 @@ read_pkcs12_kdf_params (ASN1_TYPE pbes2_asn, struct pbkdf2_params *params) | |||
1216 | if (result != ASN1_SUCCESS) | 1216 | if (result != ASN1_SUCCESS) |
1217 | { | 1217 | { |
1218 | gnutls_assert (); | 1218 | gnutls_assert (); |
1219 | result = _gnutls_asn2err (result); | 1219 | result = mhd_gtls_asn2err (result); |
1220 | goto error; | 1220 | goto error; |
1221 | } | 1221 | } |
1222 | _gnutls_hard_log ("salt.size: %d\n", params->salt_size); | 1222 | _gnutls_hard_log ("salt.size: %d\n", params->salt_size); |
@@ -1257,7 +1257,7 @@ write_pkcs12_kdf_params (ASN1_TYPE pbes2_asn, | |||
1257 | if (result != ASN1_SUCCESS) | 1257 | if (result != ASN1_SUCCESS) |
1258 | { | 1258 | { |
1259 | gnutls_assert (); | 1259 | gnutls_assert (); |
1260 | result = _gnutls_asn2err (result); | 1260 | result = mhd_gtls_asn2err (result); |
1261 | goto error; | 1261 | goto error; |
1262 | } | 1262 | } |
1263 | _gnutls_hard_log ("salt.size: %d\n", kdf_params->salt_size); | 1263 | _gnutls_hard_log ("salt.size: %d\n", kdf_params->salt_size); |
@@ -1342,7 +1342,7 @@ read_pbe_enc_params (ASN1_TYPE pbes2_asn, | |||
1342 | if (result != ASN1_SUCCESS) | 1342 | if (result != ASN1_SUCCESS) |
1343 | { | 1343 | { |
1344 | gnutls_assert (); | 1344 | gnutls_assert (); |
1345 | return _gnutls_asn2err (result); | 1345 | return mhd_gtls_asn2err (result); |
1346 | } | 1346 | } |
1347 | params_len = params_end - params_start + 1; | 1347 | params_len = params_end - params_start + 1; |
1348 | 1348 | ||
@@ -1354,7 +1354,7 @@ read_pbe_enc_params (ASN1_TYPE pbes2_asn, | |||
1354 | &pbe_asn)) != ASN1_SUCCESS) | 1354 | &pbe_asn)) != ASN1_SUCCESS) |
1355 | { | 1355 | { |
1356 | gnutls_assert (); | 1356 | gnutls_assert (); |
1357 | return _gnutls_asn2err (result); | 1357 | return mhd_gtls_asn2err (result); |
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | result = | 1360 | result = |
@@ -1362,7 +1362,7 @@ read_pbe_enc_params (ASN1_TYPE pbes2_asn, | |||
1362 | if (result != ASN1_SUCCESS) | 1362 | if (result != ASN1_SUCCESS) |
1363 | { | 1363 | { |
1364 | gnutls_assert (); | 1364 | gnutls_assert (); |
1365 | result = _gnutls_asn2err (result); | 1365 | result = mhd_gtls_asn2err (result); |
1366 | goto error; | 1366 | goto error; |
1367 | } | 1367 | } |
1368 | 1368 | ||
@@ -1372,7 +1372,7 @@ read_pbe_enc_params (ASN1_TYPE pbes2_asn, | |||
1372 | if (result != ASN1_SUCCESS) | 1372 | if (result != ASN1_SUCCESS) |
1373 | { | 1373 | { |
1374 | gnutls_assert (); | 1374 | gnutls_assert (); |
1375 | result = _gnutls_asn2err (result); | 1375 | result = mhd_gtls_asn2err (result); |
1376 | goto error; | 1376 | goto error; |
1377 | } | 1377 | } |
1378 | _gnutls_hard_log ("IV.size: %d\n", params->iv_size); | 1378 | _gnutls_hard_log ("IV.size: %d\n", params->iv_size); |
@@ -1404,7 +1404,7 @@ decrypt_data (schema_id schema, ASN1_TYPE pkcs8_asn, | |||
1404 | if (result != ASN1_MEM_ERROR) | 1404 | if (result != ASN1_MEM_ERROR) |
1405 | { | 1405 | { |
1406 | gnutls_assert (); | 1406 | gnutls_assert (); |
1407 | return _gnutls_asn2err (result); | 1407 | return mhd_gtls_asn2err (result); |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | data = gnutls_malloc (data_size); | 1410 | data = gnutls_malloc (data_size); |
@@ -1418,7 +1418,7 @@ decrypt_data (schema_id schema, ASN1_TYPE pkcs8_asn, | |||
1418 | if (result != ASN1_SUCCESS) | 1418 | if (result != ASN1_SUCCESS) |
1419 | { | 1419 | { |
1420 | gnutls_assert (); | 1420 | gnutls_assert (); |
1421 | result = _gnutls_asn2err (result); | 1421 | result = mhd_gtls_asn2err (result); |
1422 | goto error; | 1422 | goto error; |
1423 | } | 1423 | } |
1424 | 1424 | ||
@@ -1530,7 +1530,7 @@ write_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1530 | if (result != ASN1_SUCCESS) | 1530 | if (result != ASN1_SUCCESS) |
1531 | { | 1531 | { |
1532 | gnutls_assert (); | 1532 | gnutls_assert (); |
1533 | return _gnutls_asn2err (result); | 1533 | return mhd_gtls_asn2err (result); |
1534 | } | 1534 | } |
1535 | 1535 | ||
1536 | /* Now write the key derivation and the encryption | 1536 | /* Now write the key derivation and the encryption |
@@ -1542,14 +1542,14 @@ write_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1542 | &pbkdf2_asn)) != ASN1_SUCCESS) | 1542 | &pbkdf2_asn)) != ASN1_SUCCESS) |
1543 | { | 1543 | { |
1544 | gnutls_assert (); | 1544 | gnutls_assert (); |
1545 | return _gnutls_asn2err (result); | 1545 | return mhd_gtls_asn2err (result); |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | result = asn1_write_value (pbkdf2_asn, "salt", "specified", 1); | 1548 | result = asn1_write_value (pbkdf2_asn, "salt", "specified", 1); |
1549 | if (result != ASN1_SUCCESS) | 1549 | if (result != ASN1_SUCCESS) |
1550 | { | 1550 | { |
1551 | gnutls_assert (); | 1551 | gnutls_assert (); |
1552 | result = _gnutls_asn2err (result); | 1552 | result = mhd_gtls_asn2err (result); |
1553 | goto error; | 1553 | goto error; |
1554 | } | 1554 | } |
1555 | 1555 | ||
@@ -1561,7 +1561,7 @@ write_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1561 | if (result != ASN1_SUCCESS) | 1561 | if (result != ASN1_SUCCESS) |
1562 | { | 1562 | { |
1563 | gnutls_assert (); | 1563 | gnutls_assert (); |
1564 | result = _gnutls_asn2err (result); | 1564 | result = mhd_gtls_asn2err (result); |
1565 | goto error; | 1565 | goto error; |
1566 | } | 1566 | } |
1567 | _gnutls_hard_log ("salt.specified.size: %d\n", kdf_params->salt_size); | 1567 | _gnutls_hard_log ("salt.specified.size: %d\n", kdf_params->salt_size); |
@@ -1574,7 +1574,7 @@ write_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1574 | if (result != ASN1_SUCCESS) | 1574 | if (result != ASN1_SUCCESS) |
1575 | { | 1575 | { |
1576 | gnutls_assert (); | 1576 | gnutls_assert (); |
1577 | result = _gnutls_asn2err (result); | 1577 | result = mhd_gtls_asn2err (result); |
1578 | goto error; | 1578 | goto error; |
1579 | } | 1579 | } |
1580 | _gnutls_hard_log ("iterationCount: %d\n", kdf_params->iter_count); | 1580 | _gnutls_hard_log ("iterationCount: %d\n", kdf_params->iter_count); |
@@ -1585,7 +1585,7 @@ write_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1585 | if (result != ASN1_SUCCESS) | 1585 | if (result != ASN1_SUCCESS) |
1586 | { | 1586 | { |
1587 | gnutls_assert (); | 1587 | gnutls_assert (); |
1588 | result = _gnutls_asn2err (result); | 1588 | result = mhd_gtls_asn2err (result); |
1589 | goto error; | 1589 | goto error; |
1590 | } | 1590 | } |
1591 | 1591 | ||
@@ -1595,7 +1595,7 @@ write_pbkdf2_params (ASN1_TYPE pbes2_asn, | |||
1595 | if (result != ASN1_SUCCESS) | 1595 | if (result != ASN1_SUCCESS) |
1596 | { | 1596 | { |
1597 | gnutls_assert (); | 1597 | gnutls_assert (); |
1598 | result = _gnutls_asn2err (result); | 1598 | result = mhd_gtls_asn2err (result); |
1599 | goto error; | 1599 | goto error; |
1600 | } | 1600 | } |
1601 | 1601 | ||
@@ -1647,7 +1647,7 @@ write_pbe_enc_params (ASN1_TYPE pbes2_asn, | |||
1647 | &pbe_asn)) != ASN1_SUCCESS) | 1647 | &pbe_asn)) != ASN1_SUCCESS) |
1648 | { | 1648 | { |
1649 | gnutls_assert (); | 1649 | gnutls_assert (); |
1650 | return _gnutls_asn2err (result); | 1650 | return mhd_gtls_asn2err (result); |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | /* read the salt */ | 1653 | /* read the salt */ |
@@ -1655,7 +1655,7 @@ write_pbe_enc_params (ASN1_TYPE pbes2_asn, | |||
1655 | if (result != ASN1_SUCCESS) | 1655 | if (result != ASN1_SUCCESS) |
1656 | { | 1656 | { |
1657 | gnutls_assert (); | 1657 | gnutls_assert (); |
1658 | result = _gnutls_asn2err (result); | 1658 | result = mhd_gtls_asn2err (result); |
1659 | goto error; | 1659 | goto error; |
1660 | } | 1660 | } |
1661 | _gnutls_hard_log ("IV.size: %d\n", params->iv_size); | 1661 | _gnutls_hard_log ("IV.size: %d\n", params->iv_size); |
@@ -1814,7 +1814,7 @@ write_schema_params (schema_id schema, ASN1_TYPE pkcs8_asn, | |||
1814 | &pbes2_asn)) != ASN1_SUCCESS) | 1814 | &pbes2_asn)) != ASN1_SUCCESS) |
1815 | { | 1815 | { |
1816 | gnutls_assert (); | 1816 | gnutls_assert (); |
1817 | return _gnutls_asn2err (result); | 1817 | return mhd_gtls_asn2err (result); |
1818 | } | 1818 | } |
1819 | 1819 | ||
1820 | result = write_pbkdf2_params (pbes2_asn, kdf_params); | 1820 | result = write_pbkdf2_params (pbes2_asn, kdf_params); |
@@ -1850,7 +1850,7 @@ write_schema_params (schema_id schema, ASN1_TYPE pkcs8_asn, | |||
1850 | &pbes2_asn)) != ASN1_SUCCESS) | 1850 | &pbes2_asn)) != ASN1_SUCCESS) |
1851 | { | 1851 | { |
1852 | gnutls_assert (); | 1852 | gnutls_assert (); |
1853 | result = _gnutls_asn2err (result); | 1853 | result = mhd_gtls_asn2err (result); |
1854 | goto error; | 1854 | goto error; |
1855 | } | 1855 | } |
1856 | 1856 | ||
@@ -1973,7 +1973,7 @@ _gnutls_pkcs7_decrypt_data (const gnutls_datum_t * data, | |||
1973 | &pkcs7_asn)) != ASN1_SUCCESS) | 1973 | &pkcs7_asn)) != ASN1_SUCCESS) |
1974 | { | 1974 | { |
1975 | gnutls_assert (); | 1975 | gnutls_assert (); |
1976 | result = _gnutls_asn2err (result); | 1976 | result = mhd_gtls_asn2err (result); |
1977 | goto error; | 1977 | goto error; |
1978 | } | 1978 | } |
1979 | 1979 | ||
@@ -1981,7 +1981,7 @@ _gnutls_pkcs7_decrypt_data (const gnutls_datum_t * data, | |||
1981 | if (result != ASN1_SUCCESS) | 1981 | if (result != ASN1_SUCCESS) |
1982 | { | 1982 | { |
1983 | gnutls_assert (); | 1983 | gnutls_assert (); |
1984 | result = _gnutls_asn2err (result); | 1984 | result = mhd_gtls_asn2err (result); |
1985 | goto error; | 1985 | goto error; |
1986 | } | 1986 | } |
1987 | 1987 | ||
@@ -1995,7 +1995,7 @@ _gnutls_pkcs7_decrypt_data (const gnutls_datum_t * data, | |||
1995 | if (result != ASN1_SUCCESS) | 1995 | if (result != ASN1_SUCCESS) |
1996 | { | 1996 | { |
1997 | gnutls_assert (); | 1997 | gnutls_assert (); |
1998 | result = _gnutls_asn2err (result); | 1998 | result = mhd_gtls_asn2err (result); |
1999 | goto error; | 1999 | goto error; |
2000 | } | 2000 | } |
2001 | 2001 | ||
@@ -2015,7 +2015,7 @@ _gnutls_pkcs7_decrypt_data (const gnutls_datum_t * data, | |||
2015 | if (result != ASN1_SUCCESS) | 2015 | if (result != ASN1_SUCCESS) |
2016 | { | 2016 | { |
2017 | gnutls_assert (); | 2017 | gnutls_assert (); |
2018 | result = _gnutls_asn2err (result); | 2018 | result = mhd_gtls_asn2err (result); |
2019 | goto error; | 2019 | goto error; |
2020 | } | 2020 | } |
2021 | params_len = params_end - params_start + 1; | 2021 | params_len = params_end - params_start + 1; |
@@ -2027,7 +2027,7 @@ _gnutls_pkcs7_decrypt_data (const gnutls_datum_t * data, | |||
2027 | if (result < ASN1_SUCCESS) | 2027 | if (result < ASN1_SUCCESS) |
2028 | { | 2028 | { |
2029 | gnutls_assert (); | 2029 | gnutls_assert (); |
2030 | result = _gnutls_asn2err (result); | 2030 | result = mhd_gtls_asn2err (result); |
2031 | goto error; | 2031 | goto error; |
2032 | } | 2032 | } |
2033 | 2033 | ||
@@ -2078,7 +2078,7 @@ _gnutls_pkcs7_encrypt_data (schema_id schema, | |||
2078 | &pkcs7_asn)) != ASN1_SUCCESS) | 2078 | &pkcs7_asn)) != ASN1_SUCCESS) |
2079 | { | 2079 | { |
2080 | gnutls_assert (); | 2080 | gnutls_assert (); |
2081 | result = _gnutls_asn2err (result); | 2081 | result = mhd_gtls_asn2err (result); |
2082 | goto error; | 2082 | goto error; |
2083 | } | 2083 | } |
2084 | 2084 | ||
@@ -2116,7 +2116,7 @@ _gnutls_pkcs7_encrypt_data (schema_id schema, | |||
2116 | if (result != ASN1_SUCCESS) | 2116 | if (result != ASN1_SUCCESS) |
2117 | { | 2117 | { |
2118 | gnutls_assert (); | 2118 | gnutls_assert (); |
2119 | result = _gnutls_asn2err (result); | 2119 | result = mhd_gtls_asn2err (result); |
2120 | goto error; | 2120 | goto error; |
2121 | } | 2121 | } |
2122 | 2122 | ||
@@ -2158,7 +2158,7 @@ _gnutls_pkcs7_encrypt_data (schema_id schema, | |||
2158 | if (result != ASN1_SUCCESS) | 2158 | if (result != ASN1_SUCCESS) |
2159 | { | 2159 | { |
2160 | gnutls_assert (); | 2160 | gnutls_assert (); |
2161 | result = _gnutls_asn2err (result); | 2161 | result = mhd_gtls_asn2err (result); |
2162 | goto error; | 2162 | goto error; |
2163 | } | 2163 | } |
2164 | 2164 | ||
@@ -2181,7 +2181,7 @@ _gnutls_pkcs7_encrypt_data (schema_id schema, | |||
2181 | if (result != ASN1_SUCCESS) | 2181 | if (result != ASN1_SUCCESS) |
2182 | { | 2182 | { |
2183 | gnutls_assert (); | 2183 | gnutls_assert (); |
2184 | result = _gnutls_asn2err (result); | 2184 | result = mhd_gtls_asn2err (result); |
2185 | goto error; | 2185 | goto error; |
2186 | } | 2186 | } |
2187 | 2187 | ||
@@ -2189,7 +2189,7 @@ _gnutls_pkcs7_encrypt_data (schema_id schema, | |||
2189 | if (result != ASN1_SUCCESS) | 2189 | if (result != ASN1_SUCCESS) |
2190 | { | 2190 | { |
2191 | gnutls_assert (); | 2191 | gnutls_assert (); |
2192 | result = _gnutls_asn2err (result); | 2192 | result = mhd_gtls_asn2err (result); |
2193 | goto error; | 2193 | goto error; |
2194 | } | 2194 | } |
2195 | 2195 | ||
diff --git a/src/daemon/https/x509/sign.c b/src/daemon/https/x509/sign.c index c316cf8a..672c2af6 100644 --- a/src/daemon/https/x509/sign.c +++ b/src/daemon/https/x509/sign.c | |||
@@ -69,7 +69,7 @@ encode_ber_digest_info (gnutls_digest_algorithm_t hash, | |||
69 | &dinfo)) != ASN1_SUCCESS) | 69 | &dinfo)) != ASN1_SUCCESS) |
70 | { | 70 | { |
71 | gnutls_assert (); | 71 | gnutls_assert (); |
72 | return _gnutls_asn2err (result); | 72 | return mhd_gtls_asn2err (result); |
73 | } | 73 | } |
74 | 74 | ||
75 | result = asn1_write_value (dinfo, "digestAlgorithm.algorithm", algo, 1); | 75 | result = asn1_write_value (dinfo, "digestAlgorithm.algorithm", algo, 1); |
@@ -77,7 +77,7 @@ encode_ber_digest_info (gnutls_digest_algorithm_t hash, | |||
77 | { | 77 | { |
78 | gnutls_assert (); | 78 | gnutls_assert (); |
79 | asn1_delete_structure (&dinfo); | 79 | asn1_delete_structure (&dinfo); |
80 | return _gnutls_asn2err (result); | 80 | return mhd_gtls_asn2err (result); |
81 | } | 81 | } |
82 | 82 | ||
83 | /* Write an ASN.1 NULL in the parameters field. This matches RFC | 83 | /* Write an ASN.1 NULL in the parameters field. This matches RFC |
@@ -91,7 +91,7 @@ encode_ber_digest_info (gnutls_digest_algorithm_t hash, | |||
91 | { | 91 | { |
92 | gnutls_assert (); | 92 | gnutls_assert (); |
93 | asn1_delete_structure (&dinfo); | 93 | asn1_delete_structure (&dinfo); |
94 | return _gnutls_asn2err (result); | 94 | return mhd_gtls_asn2err (result); |
95 | } | 95 | } |
96 | 96 | ||
97 | result = asn1_write_value (dinfo, "digest", digest->data, digest->size); | 97 | result = asn1_write_value (dinfo, "digest", digest->data, digest->size); |
@@ -99,7 +99,7 @@ encode_ber_digest_info (gnutls_digest_algorithm_t hash, | |||
99 | { | 99 | { |
100 | gnutls_assert (); | 100 | gnutls_assert (); |
101 | asn1_delete_structure (&dinfo); | 101 | asn1_delete_structure (&dinfo); |
102 | return _gnutls_asn2err (result); | 102 | return mhd_gtls_asn2err (result); |
103 | } | 103 | } |
104 | 104 | ||
105 | info->size = 0; | 105 | info->size = 0; |
@@ -118,7 +118,7 @@ encode_ber_digest_info (gnutls_digest_algorithm_t hash, | |||
118 | { | 118 | { |
119 | gnutls_assert (); | 119 | gnutls_assert (); |
120 | asn1_delete_structure (&dinfo); | 120 | asn1_delete_structure (&dinfo); |
121 | return _gnutls_asn2err (result); | 121 | return mhd_gtls_asn2err (result); |
122 | } | 122 | } |
123 | 123 | ||
124 | asn1_delete_structure (&dinfo); | 124 | asn1_delete_structure (&dinfo); |
@@ -242,7 +242,7 @@ _gnutls_x509_sign_tbs (ASN1_TYPE cert, const char *tbs_name, | |||
242 | { | 242 | { |
243 | gnutls_assert (); | 243 | gnutls_assert (); |
244 | gnutls_afree (buf); | 244 | gnutls_afree (buf); |
245 | return _gnutls_asn2err (result); | 245 | return mhd_gtls_asn2err (result); |
246 | } | 246 | } |
247 | 247 | ||
248 | tbs.data = buf; | 248 | tbs.data = buf; |
@@ -285,7 +285,7 @@ _gnutls_x509_pkix_sign (ASN1_TYPE src, const char *src_name, | |||
285 | if (result != ASN1_SUCCESS) | 285 | if (result != ASN1_SUCCESS) |
286 | { | 286 | { |
287 | gnutls_assert (); | 287 | gnutls_assert (); |
288 | return _gnutls_asn2err (result); | 288 | return mhd_gtls_asn2err (result); |
289 | } | 289 | } |
290 | 290 | ||
291 | /* Step 1.5. Write the signature stuff in the tbsCertificate. | 291 | /* Step 1.5. Write the signature stuff in the tbsCertificate. |
@@ -323,7 +323,7 @@ _gnutls_x509_pkix_sign (ASN1_TYPE src, const char *src_name, | |||
323 | if (result != ASN1_SUCCESS) | 323 | if (result != ASN1_SUCCESS) |
324 | { | 324 | { |
325 | gnutls_assert (); | 325 | gnutls_assert (); |
326 | return _gnutls_asn2err (result); | 326 | return mhd_gtls_asn2err (result); |
327 | } | 327 | } |
328 | 328 | ||
329 | /* Step 3. Move up and write the AlgorithmIdentifier, which is also | 329 | /* Step 3. Move up and write the AlgorithmIdentifier, which is also |
diff --git a/src/daemon/https/x509/x509.c b/src/daemon/https/x509/x509.c index 4b3f04ba..c682abe0 100644 --- a/src/daemon/https/x509/x509.c +++ b/src/daemon/https/x509/x509.c | |||
@@ -63,7 +63,7 @@ gnutls_x509_crt_init (gnutls_x509_crt_t * cert) | |||
63 | { | 63 | { |
64 | gnutls_assert (); | 64 | gnutls_assert (); |
65 | gnutls_free (tmp); | 65 | gnutls_free (tmp); |
66 | return _gnutls_asn2err (result); | 66 | return mhd_gtls_asn2err (result); |
67 | } | 67 | } |
68 | 68 | ||
69 | *cert = tmp; | 69 | *cert = tmp; |
@@ -213,7 +213,7 @@ gnutls_x509_crt_import (gnutls_x509_crt_t cert, | |||
213 | result = asn1_der_decoding (&cert->cert, _data.data, _data.size, NULL); | 213 | result = asn1_der_decoding (&cert->cert, _data.data, _data.size, NULL); |
214 | if (result != ASN1_SUCCESS) | 214 | if (result != ASN1_SUCCESS) |
215 | { | 215 | { |
216 | result = _gnutls_asn2err (result); | 216 | result = mhd_gtls_asn2err (result); |
217 | gnutls_assert (); | 217 | gnutls_assert (); |
218 | goto cleanup; | 218 | goto cleanup; |
219 | } | 219 | } |
@@ -522,7 +522,7 @@ gnutls_x509_crt_get_signature (gnutls_x509_crt_t cert, | |||
522 | if (result != ASN1_MEM_ERROR) | 522 | if (result != ASN1_MEM_ERROR) |
523 | { | 523 | { |
524 | gnutls_assert (); | 524 | gnutls_assert (); |
525 | return _gnutls_asn2err (result); | 525 | return mhd_gtls_asn2err (result); |
526 | } | 526 | } |
527 | 527 | ||
528 | if (bits % 8 != 0) | 528 | if (bits % 8 != 0) |
@@ -543,7 +543,7 @@ gnutls_x509_crt_get_signature (gnutls_x509_crt_t cert, | |||
543 | if (result != ASN1_SUCCESS) | 543 | if (result != ASN1_SUCCESS) |
544 | { | 544 | { |
545 | gnutls_assert (); | 545 | gnutls_assert (); |
546 | return _gnutls_asn2err (result); | 546 | return mhd_gtls_asn2err (result); |
547 | } | 547 | } |
548 | 548 | ||
549 | return 0; | 549 | return 0; |
@@ -579,7 +579,7 @@ gnutls_x509_crt_get_version (gnutls_x509_crt_t cert) | |||
579 | if (result == ASN1_ELEMENT_NOT_FOUND) | 579 | if (result == ASN1_ELEMENT_NOT_FOUND) |
580 | return 1; /* the DEFAULT version */ | 580 | return 1; /* the DEFAULT version */ |
581 | gnutls_assert (); | 581 | gnutls_assert (); |
582 | return _gnutls_asn2err (result); | 582 | return mhd_gtls_asn2err (result); |
583 | } | 583 | } |
584 | 584 | ||
585 | return (int) version[0] + 1; | 585 | return (int) version[0] + 1; |
@@ -665,7 +665,7 @@ gnutls_x509_crt_get_serial (gnutls_x509_crt_t cert, | |||
665 | if (ret != ASN1_SUCCESS) | 665 | if (ret != ASN1_SUCCESS) |
666 | { | 666 | { |
667 | gnutls_assert (); | 667 | gnutls_assert (); |
668 | return _gnutls_asn2err (ret); | 668 | return mhd_gtls_asn2err (ret); |
669 | } | 669 | } |
670 | 670 | ||
671 | return 0; | 671 | return 0; |
@@ -724,7 +724,7 @@ gnutls_x509_crt_get_subject_key_id (gnutls_x509_crt_t cert, | |||
724 | { | 724 | { |
725 | gnutls_assert (); | 725 | gnutls_assert (); |
726 | _gnutls_free_datum (&id); | 726 | _gnutls_free_datum (&id); |
727 | return _gnutls_asn2err (result); | 727 | return mhd_gtls_asn2err (result); |
728 | } | 728 | } |
729 | 729 | ||
730 | result = asn1_der_decoding (&c2, id.data, id.size, NULL); | 730 | result = asn1_der_decoding (&c2, id.data, id.size, NULL); |
@@ -734,7 +734,7 @@ gnutls_x509_crt_get_subject_key_id (gnutls_x509_crt_t cert, | |||
734 | { | 734 | { |
735 | gnutls_assert (); | 735 | gnutls_assert (); |
736 | asn1_delete_structure (&c2); | 736 | asn1_delete_structure (&c2); |
737 | return _gnutls_asn2err (result); | 737 | return mhd_gtls_asn2err (result); |
738 | } | 738 | } |
739 | 739 | ||
740 | len = *ret_size; | 740 | len = *ret_size; |
@@ -751,7 +751,7 @@ gnutls_x509_crt_get_subject_key_id (gnutls_x509_crt_t cert, | |||
751 | if (result != ASN1_SUCCESS) | 751 | if (result != ASN1_SUCCESS) |
752 | { | 752 | { |
753 | gnutls_assert (); | 753 | gnutls_assert (); |
754 | return _gnutls_asn2err (result); | 754 | return mhd_gtls_asn2err (result); |
755 | } | 755 | } |
756 | 756 | ||
757 | return 0; | 757 | return 0; |
@@ -812,7 +812,7 @@ gnutls_x509_crt_get_authority_key_id (gnutls_x509_crt_t cert, | |||
812 | { | 812 | { |
813 | gnutls_assert (); | 813 | gnutls_assert (); |
814 | _gnutls_free_datum (&id); | 814 | _gnutls_free_datum (&id); |
815 | return _gnutls_asn2err (result); | 815 | return mhd_gtls_asn2err (result); |
816 | } | 816 | } |
817 | 817 | ||
818 | result = asn1_der_decoding (&c2, id.data, id.size, NULL); | 818 | result = asn1_der_decoding (&c2, id.data, id.size, NULL); |
@@ -822,7 +822,7 @@ gnutls_x509_crt_get_authority_key_id (gnutls_x509_crt_t cert, | |||
822 | { | 822 | { |
823 | gnutls_assert (); | 823 | gnutls_assert (); |
824 | asn1_delete_structure (&c2); | 824 | asn1_delete_structure (&c2); |
825 | return _gnutls_asn2err (result); | 825 | return mhd_gtls_asn2err (result); |
826 | } | 826 | } |
827 | 827 | ||
828 | len = *ret_size; | 828 | len = *ret_size; |
@@ -839,7 +839,7 @@ gnutls_x509_crt_get_authority_key_id (gnutls_x509_crt_t cert, | |||
839 | if (result != ASN1_SUCCESS) | 839 | if (result != ASN1_SUCCESS) |
840 | { | 840 | { |
841 | gnutls_assert (); | 841 | gnutls_assert (); |
842 | return _gnutls_asn2err (result); | 842 | return mhd_gtls_asn2err (result); |
843 | } | 843 | } |
844 | 844 | ||
845 | return 0; | 845 | return 0; |
@@ -934,7 +934,7 @@ parse_general_name (ASN1_TYPE src, | |||
934 | if (result != ASN1_SUCCESS) | 934 | if (result != ASN1_SUCCESS) |
935 | { | 935 | { |
936 | gnutls_assert (); | 936 | gnutls_assert (); |
937 | return _gnutls_asn2err (result); | 937 | return mhd_gtls_asn2err (result); |
938 | } | 938 | } |
939 | 939 | ||
940 | type = _gnutls_x509_san_find_type (choice_type); | 940 | type = _gnutls_x509_san_find_type (choice_type); |
@@ -964,7 +964,7 @@ parse_general_name (ASN1_TYPE src, | |||
964 | if (result != ASN1_SUCCESS) | 964 | if (result != ASN1_SUCCESS) |
965 | { | 965 | { |
966 | gnutls_assert (); | 966 | gnutls_assert (); |
967 | return _gnutls_asn2err (result); | 967 | return mhd_gtls_asn2err (result); |
968 | } | 968 | } |
969 | 969 | ||
970 | if (othername_oid) | 970 | if (othername_oid) |
@@ -987,7 +987,7 @@ parse_general_name (ASN1_TYPE src, | |||
987 | if (result != ASN1_SUCCESS) | 987 | if (result != ASN1_SUCCESS) |
988 | { | 988 | { |
989 | gnutls_assert (); | 989 | gnutls_assert (); |
990 | return _gnutls_asn2err (result); | 990 | return mhd_gtls_asn2err (result); |
991 | } | 991 | } |
992 | 992 | ||
993 | if (len > strlen (XMPP_OID) && strcmp (oid, XMPP_OID) == 0) | 993 | if (len > strlen (XMPP_OID) && strcmp (oid, XMPP_OID) == 0) |
@@ -1000,7 +1000,7 @@ parse_general_name (ASN1_TYPE src, | |||
1000 | if (result != ASN1_SUCCESS) | 1000 | if (result != ASN1_SUCCESS) |
1001 | { | 1001 | { |
1002 | gnutls_assert (); | 1002 | gnutls_assert (); |
1003 | return _gnutls_asn2err (result); | 1003 | return mhd_gtls_asn2err (result); |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | result = asn1_der_decoding (&c2, name, *name_size, NULL); | 1006 | result = asn1_der_decoding (&c2, name, *name_size, NULL); |
@@ -1008,7 +1008,7 @@ parse_general_name (ASN1_TYPE src, | |||
1008 | { | 1008 | { |
1009 | gnutls_assert (); | 1009 | gnutls_assert (); |
1010 | asn1_delete_structure (&c2); | 1010 | asn1_delete_structure (&c2); |
1011 | return _gnutls_asn2err (result); | 1011 | return mhd_gtls_asn2err (result); |
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | result = asn1_read_value (c2, "", name, &len); | 1014 | result = asn1_read_value (c2, "", name, &len); |
@@ -1017,7 +1017,7 @@ parse_general_name (ASN1_TYPE src, | |||
1017 | { | 1017 | { |
1018 | gnutls_assert (); | 1018 | gnutls_assert (); |
1019 | asn1_delete_structure (&c2); | 1019 | asn1_delete_structure (&c2); |
1020 | return _gnutls_asn2err (result); | 1020 | return mhd_gtls_asn2err (result); |
1021 | } | 1021 | } |
1022 | asn1_delete_structure (&c2); | 1022 | asn1_delete_structure (&c2); |
1023 | } | 1023 | } |
@@ -1056,7 +1056,7 @@ parse_general_name (ASN1_TYPE src, | |||
1056 | if (result != ASN1_SUCCESS) | 1056 | if (result != ASN1_SUCCESS) |
1057 | { | 1057 | { |
1058 | gnutls_assert (); | 1058 | gnutls_assert (); |
1059 | return _gnutls_asn2err (result); | 1059 | return mhd_gtls_asn2err (result); |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | if (is_type_printable (type)) | 1062 | if (is_type_printable (type)) |
@@ -1121,7 +1121,7 @@ get_subject_alt_name (gnutls_x509_crt_t cert, | |||
1121 | { | 1121 | { |
1122 | gnutls_assert (); | 1122 | gnutls_assert (); |
1123 | _gnutls_free_datum (&dnsname); | 1123 | _gnutls_free_datum (&dnsname); |
1124 | return _gnutls_asn2err (result); | 1124 | return mhd_gtls_asn2err (result); |
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | result = asn1_der_decoding (&c2, dnsname.data, dnsname.size, NULL); | 1127 | result = asn1_der_decoding (&c2, dnsname.data, dnsname.size, NULL); |
@@ -1131,7 +1131,7 @@ get_subject_alt_name (gnutls_x509_crt_t cert, | |||
1131 | { | 1131 | { |
1132 | gnutls_assert (); | 1132 | gnutls_assert (); |
1133 | asn1_delete_structure (&c2); | 1133 | asn1_delete_structure (&c2); |
1134 | return _gnutls_asn2err (result); | 1134 | return mhd_gtls_asn2err (result); |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | result = parse_general_name (c2, "", seq, ret, ret_size, ret_type, | 1137 | result = parse_general_name (c2, "", seq, ret, ret_size, ret_type, |
@@ -1620,7 +1620,7 @@ gnutls_x509_crt_get_extension_info (gnutls_x509_crt_t cert, | |||
1620 | else if (result < 0) | 1620 | else if (result < 0) |
1621 | { | 1621 | { |
1622 | gnutls_assert (); | 1622 | gnutls_assert (); |
1623 | return _gnutls_asn2err (result); | 1623 | return mhd_gtls_asn2err (result); |
1624 | } | 1624 | } |
1625 | 1625 | ||
1626 | snprintf (name, sizeof (name), "tbsCertificate.extensions.?%u.critical", | 1626 | snprintf (name, sizeof (name), "tbsCertificate.extensions.?%u.critical", |
@@ -1630,7 +1630,7 @@ gnutls_x509_crt_get_extension_info (gnutls_x509_crt_t cert, | |||
1630 | if (result < 0) | 1630 | if (result < 0) |
1631 | { | 1631 | { |
1632 | gnutls_assert (); | 1632 | gnutls_assert (); |
1633 | return _gnutls_asn2err (result); | 1633 | return mhd_gtls_asn2err (result); |
1634 | } | 1634 | } |
1635 | 1635 | ||
1636 | if (critical) | 1636 | if (critical) |
@@ -1691,7 +1691,7 @@ gnutls_x509_crt_get_extension_data (gnutls_x509_crt_t cert, | |||
1691 | else if (result < 0) | 1691 | else if (result < 0) |
1692 | { | 1692 | { |
1693 | gnutls_assert (); | 1693 | gnutls_assert (); |
1694 | return _gnutls_asn2err (result); | 1694 | return mhd_gtls_asn2err (result); |
1695 | } | 1695 | } |
1696 | 1696 | ||
1697 | return 0; | 1697 | return 0; |
@@ -1715,7 +1715,7 @@ _gnutls_x509_crt_get_raw_dn2 (gnutls_x509_crt_t cert, | |||
1715 | &c2)) != ASN1_SUCCESS) | 1715 | &c2)) != ASN1_SUCCESS) |
1716 | { | 1716 | { |
1717 | gnutls_assert (); | 1717 | gnutls_assert (); |
1718 | return _gnutls_asn2err (result); | 1718 | return mhd_gtls_asn2err (result); |
1719 | } | 1719 | } |
1720 | 1720 | ||
1721 | result = _gnutls_x509_get_signed_data (cert->cert, "tbsCertificate", | 1721 | result = _gnutls_x509_get_signed_data (cert->cert, "tbsCertificate", |
@@ -1731,7 +1731,7 @@ _gnutls_x509_crt_get_raw_dn2 (gnutls_x509_crt_t cert, | |||
1731 | { | 1731 | { |
1732 | gnutls_assert (); | 1732 | gnutls_assert (); |
1733 | asn1_delete_structure (&c2); | 1733 | asn1_delete_structure (&c2); |
1734 | result = _gnutls_asn2err (result); | 1734 | result = mhd_gtls_asn2err (result); |
1735 | goto cleanup; | 1735 | goto cleanup; |
1736 | } | 1736 | } |
1737 | 1737 | ||
@@ -1741,7 +1741,7 @@ _gnutls_x509_crt_get_raw_dn2 (gnutls_x509_crt_t cert, | |||
1741 | if (result != ASN1_SUCCESS) | 1741 | if (result != ASN1_SUCCESS) |
1742 | { | 1742 | { |
1743 | gnutls_assert (); | 1743 | gnutls_assert (); |
1744 | result = _gnutls_asn2err (result); | 1744 | result = mhd_gtls_asn2err (result); |
1745 | goto cleanup; | 1745 | goto cleanup; |
1746 | } | 1746 | } |
1747 | 1747 | ||
@@ -1910,7 +1910,7 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn, | |||
1910 | if (ret) | 1910 | if (ret) |
1911 | { | 1911 | { |
1912 | gnutls_assert (); | 1912 | gnutls_assert (); |
1913 | return _gnutls_asn2err (ret); | 1913 | return mhd_gtls_asn2err (ret); |
1914 | } | 1914 | } |
1915 | 1915 | ||
1916 | ptr += lenlen; | 1916 | ptr += lenlen; |
@@ -1974,7 +1974,7 @@ gnutls_x509_crt_get_fingerprint (gnutls_x509_crt_t cert, | |||
1974 | { | 1974 | { |
1975 | gnutls_assert (); | 1975 | gnutls_assert (); |
1976 | gnutls_afree (cert_buf); | 1976 | gnutls_afree (cert_buf); |
1977 | return _gnutls_asn2err (result); | 1977 | return mhd_gtls_asn2err (result); |
1978 | } | 1978 | } |
1979 | 1979 | ||
1980 | tmp.data = cert_buf; | 1980 | tmp.data = cert_buf; |
@@ -2146,7 +2146,7 @@ gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt, | |||
2146 | if (result != ASN1_MEM_ERROR) | 2146 | if (result != ASN1_MEM_ERROR) |
2147 | { | 2147 | { |
2148 | gnutls_assert (); | 2148 | gnutls_assert (); |
2149 | return _gnutls_asn2err (result); | 2149 | return mhd_gtls_asn2err (result); |
2150 | } | 2150 | } |
2151 | 2151 | ||
2152 | pubkey.data = gnutls_alloca (pubkey.size); | 2152 | pubkey.data = gnutls_alloca (pubkey.size); |
@@ -2162,7 +2162,7 @@ gnutls_x509_crt_get_key_id (gnutls_x509_crt_t crt, | |||
2162 | { | 2162 | { |
2163 | gnutls_assert (); | 2163 | gnutls_assert (); |
2164 | gnutls_afree (pubkey.data); | 2164 | gnutls_afree (pubkey.data); |
2165 | return _gnutls_asn2err (result); | 2165 | return mhd_gtls_asn2err (result); |
2166 | } | 2166 | } |
2167 | 2167 | ||
2168 | result = MHD_gnutls_fingerprint (MHD_GNUTLS_DIG_SHA1, &pubkey, output_data, | 2168 | result = MHD_gnutls_fingerprint (MHD_GNUTLS_DIG_SHA1, &pubkey, output_data, |
@@ -2404,7 +2404,7 @@ gnutls_x509_crt_get_crl_dist_points (gnutls_x509_crt_t cert, | |||
2404 | { | 2404 | { |
2405 | gnutls_assert (); | 2405 | gnutls_assert (); |
2406 | _gnutls_free_datum (&dist_points); | 2406 | _gnutls_free_datum (&dist_points); |
2407 | return _gnutls_asn2err (result); | 2407 | return mhd_gtls_asn2err (result); |
2408 | } | 2408 | } |
2409 | 2409 | ||
2410 | result = asn1_der_decoding (&c2, dist_points.data, dist_points.size, NULL); | 2410 | result = asn1_der_decoding (&c2, dist_points.data, dist_points.size, NULL); |
@@ -2414,7 +2414,7 @@ gnutls_x509_crt_get_crl_dist_points (gnutls_x509_crt_t cert, | |||
2414 | { | 2414 | { |
2415 | gnutls_assert (); | 2415 | gnutls_assert (); |
2416 | asn1_delete_structure (&c2); | 2416 | asn1_delete_structure (&c2); |
2417 | return _gnutls_asn2err (result); | 2417 | return mhd_gtls_asn2err (result); |
2418 | } | 2418 | } |
2419 | 2419 | ||
2420 | /* Return the different names from the first CRLDistr. point. | 2420 | /* Return the different names from the first CRLDistr. point. |
@@ -2446,7 +2446,7 @@ gnutls_x509_crt_get_crl_dist_points (gnutls_x509_crt_t cert, | |||
2446 | { | 2446 | { |
2447 | gnutls_assert (); | 2447 | gnutls_assert (); |
2448 | asn1_delete_structure (&c2); | 2448 | asn1_delete_structure (&c2); |
2449 | return _gnutls_asn2err (result); | 2449 | return mhd_gtls_asn2err (result); |
2450 | } | 2450 | } |
2451 | 2451 | ||
2452 | *reason_flags = reasons[0] | (reasons[1] << 8); | 2452 | *reason_flags = reasons[0] | (reasons[1] << 8); |
@@ -2514,7 +2514,7 @@ gnutls_x509_crt_get_key_purpose_oid (gnutls_x509_crt_t cert, | |||
2514 | { | 2514 | { |
2515 | gnutls_assert (); | 2515 | gnutls_assert (); |
2516 | _gnutls_free_datum (&id); | 2516 | _gnutls_free_datum (&id); |
2517 | return _gnutls_asn2err (result); | 2517 | return mhd_gtls_asn2err (result); |
2518 | } | 2518 | } |
2519 | 2519 | ||
2520 | result = asn1_der_decoding (&c2, id.data, id.size, NULL); | 2520 | result = asn1_der_decoding (&c2, id.data, id.size, NULL); |
@@ -2524,7 +2524,7 @@ gnutls_x509_crt_get_key_purpose_oid (gnutls_x509_crt_t cert, | |||
2524 | { | 2524 | { |
2525 | gnutls_assert (); | 2525 | gnutls_assert (); |
2526 | asn1_delete_structure (&c2); | 2526 | asn1_delete_structure (&c2); |
2527 | return _gnutls_asn2err (result); | 2527 | return mhd_gtls_asn2err (result); |
2528 | } | 2528 | } |
2529 | 2529 | ||
2530 | indx++; | 2530 | indx++; |
@@ -2546,7 +2546,7 @@ gnutls_x509_crt_get_key_purpose_oid (gnutls_x509_crt_t cert, | |||
2546 | if (result != ASN1_SUCCESS) | 2546 | if (result != ASN1_SUCCESS) |
2547 | { | 2547 | { |
2548 | gnutls_assert (); | 2548 | gnutls_assert (); |
2549 | return _gnutls_asn2err (result); | 2549 | return mhd_gtls_asn2err (result); |
2550 | } | 2550 | } |
2551 | 2551 | ||
2552 | return 0; | 2552 | return 0; |
diff --git a/src/daemon/https/x509/x509_privkey.c b/src/daemon/https/x509/x509_privkey.c index 2a690adb..2eade5d1 100644 --- a/src/daemon/https/x509/x509_privkey.c +++ b/src/daemon/https/x509/x509_privkey.c | |||
@@ -956,7 +956,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
956 | c2)) != ASN1_SUCCESS) | 956 | c2)) != ASN1_SUCCESS) |
957 | { | 957 | { |
958 | gnutls_assert (); | 958 | gnutls_assert (); |
959 | result = _gnutls_asn2err (result); | 959 | result = mhd_gtls_asn2err (result); |
960 | goto cleanup; | 960 | goto cleanup; |
961 | } | 961 | } |
962 | 962 | ||
@@ -966,7 +966,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
966 | != ASN1_SUCCESS) | 966 | != ASN1_SUCCESS) |
967 | { | 967 | { |
968 | gnutls_assert (); | 968 | gnutls_assert (); |
969 | result = _gnutls_asn2err (result); | 969 | result = mhd_gtls_asn2err (result); |
970 | goto cleanup; | 970 | goto cleanup; |
971 | } | 971 | } |
972 | 972 | ||
@@ -974,7 +974,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
974 | != ASN1_SUCCESS) | 974 | != ASN1_SUCCESS) |
975 | { | 975 | { |
976 | gnutls_assert (); | 976 | gnutls_assert (); |
977 | result = _gnutls_asn2err (result); | 977 | result = mhd_gtls_asn2err (result); |
978 | goto cleanup; | 978 | goto cleanup; |
979 | } | 979 | } |
980 | 980 | ||
@@ -982,7 +982,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
982 | != ASN1_SUCCESS) | 982 | != ASN1_SUCCESS) |
983 | { | 983 | { |
984 | gnutls_assert (); | 984 | gnutls_assert (); |
985 | result = _gnutls_asn2err (result); | 985 | result = mhd_gtls_asn2err (result); |
986 | goto cleanup; | 986 | goto cleanup; |
987 | } | 987 | } |
988 | 988 | ||
@@ -990,7 +990,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
990 | != ASN1_SUCCESS) | 990 | != ASN1_SUCCESS) |
991 | { | 991 | { |
992 | gnutls_assert (); | 992 | gnutls_assert (); |
993 | result = _gnutls_asn2err (result); | 993 | result = mhd_gtls_asn2err (result); |
994 | goto cleanup; | 994 | goto cleanup; |
995 | } | 995 | } |
996 | 996 | ||
@@ -998,7 +998,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
998 | != ASN1_SUCCESS) | 998 | != ASN1_SUCCESS) |
999 | { | 999 | { |
1000 | gnutls_assert (); | 1000 | gnutls_assert (); |
1001 | result = _gnutls_asn2err (result); | 1001 | result = mhd_gtls_asn2err (result); |
1002 | goto cleanup; | 1002 | goto cleanup; |
1003 | } | 1003 | } |
1004 | 1004 | ||
@@ -1006,7 +1006,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
1006 | != ASN1_SUCCESS) | 1006 | != ASN1_SUCCESS) |
1007 | { | 1007 | { |
1008 | gnutls_assert (); | 1008 | gnutls_assert (); |
1009 | result = _gnutls_asn2err (result); | 1009 | result = mhd_gtls_asn2err (result); |
1010 | goto cleanup; | 1010 | goto cleanup; |
1011 | } | 1011 | } |
1012 | 1012 | ||
@@ -1014,7 +1014,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
1014 | != ASN1_SUCCESS) | 1014 | != ASN1_SUCCESS) |
1015 | { | 1015 | { |
1016 | gnutls_assert (); | 1016 | gnutls_assert (); |
1017 | result = _gnutls_asn2err (result); | 1017 | result = mhd_gtls_asn2err (result); |
1018 | goto cleanup; | 1018 | goto cleanup; |
1019 | } | 1019 | } |
1020 | 1020 | ||
@@ -1022,7 +1022,7 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
1022 | != ASN1_SUCCESS) | 1022 | != ASN1_SUCCESS) |
1023 | { | 1023 | { |
1024 | gnutls_assert (); | 1024 | gnutls_assert (); |
1025 | result = _gnutls_asn2err (result); | 1025 | result = mhd_gtls_asn2err (result); |
1026 | goto cleanup; | 1026 | goto cleanup; |
1027 | } | 1027 | } |
1028 | 1028 | ||
@@ -1037,14 +1037,14 @@ _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params) | |||
1037 | NULL, 0)) != ASN1_SUCCESS) | 1037 | NULL, 0)) != ASN1_SUCCESS) |
1038 | { | 1038 | { |
1039 | gnutls_assert (); | 1039 | gnutls_assert (); |
1040 | result = _gnutls_asn2err (result); | 1040 | result = mhd_gtls_asn2err (result); |
1041 | goto cleanup; | 1041 | goto cleanup; |
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | if ((result = asn1_write_value (*c2, "version", &null, 1)) != ASN1_SUCCESS) | 1044 | if ((result = asn1_write_value (*c2, "version", &null, 1)) != ASN1_SUCCESS) |
1045 | { | 1045 | { |
1046 | gnutls_assert (); | 1046 | gnutls_assert (); |
1047 | result = _gnutls_asn2err (result); | 1047 | result = mhd_gtls_asn2err (result); |
1048 | goto cleanup; | 1048 | goto cleanup; |
1049 | } | 1049 | } |
1050 | 1050 | ||
@@ -1116,7 +1116,7 @@ _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params) | |||
1116 | c2)) != ASN1_SUCCESS) | 1116 | c2)) != ASN1_SUCCESS) |
1117 | { | 1117 | { |
1118 | gnutls_assert (); | 1118 | gnutls_assert (); |
1119 | result = _gnutls_asn2err (result); | 1119 | result = mhd_gtls_asn2err (result); |
1120 | goto cleanup; | 1120 | goto cleanup; |
1121 | } | 1121 | } |
1122 | 1122 | ||
@@ -1125,28 +1125,28 @@ _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params) | |||
1125 | if ((result = asn1_write_value (*c2, "p", p_data, size[0])) != ASN1_SUCCESS) | 1125 | if ((result = asn1_write_value (*c2, "p", p_data, size[0])) != ASN1_SUCCESS) |
1126 | { | 1126 | { |
1127 | gnutls_assert (); | 1127 | gnutls_assert (); |
1128 | result = _gnutls_asn2err (result); | 1128 | result = mhd_gtls_asn2err (result); |
1129 | goto cleanup; | 1129 | goto cleanup; |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | if ((result = asn1_write_value (*c2, "q", q_data, size[1])) != ASN1_SUCCESS) | 1132 | if ((result = asn1_write_value (*c2, "q", q_data, size[1])) != ASN1_SUCCESS) |
1133 | { | 1133 | { |
1134 | gnutls_assert (); | 1134 | gnutls_assert (); |
1135 | result = _gnutls_asn2err (result); | 1135 | result = mhd_gtls_asn2err (result); |
1136 | goto cleanup; | 1136 | goto cleanup; |
1137 | } | 1137 | } |
1138 | 1138 | ||
1139 | if ((result = asn1_write_value (*c2, "g", g_data, size[2])) != ASN1_SUCCESS) | 1139 | if ((result = asn1_write_value (*c2, "g", g_data, size[2])) != ASN1_SUCCESS) |
1140 | { | 1140 | { |
1141 | gnutls_assert (); | 1141 | gnutls_assert (); |
1142 | result = _gnutls_asn2err (result); | 1142 | result = mhd_gtls_asn2err (result); |
1143 | goto cleanup; | 1143 | goto cleanup; |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | if ((result = asn1_write_value (*c2, "Y", y_data, size[3])) != ASN1_SUCCESS) | 1146 | if ((result = asn1_write_value (*c2, "Y", y_data, size[3])) != ASN1_SUCCESS) |
1147 | { | 1147 | { |
1148 | gnutls_assert (); | 1148 | gnutls_assert (); |
1149 | result = _gnutls_asn2err (result); | 1149 | result = mhd_gtls_asn2err (result); |
1150 | goto cleanup; | 1150 | goto cleanup; |
1151 | } | 1151 | } |
1152 | 1152 | ||
@@ -1154,7 +1154,7 @@ _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params) | |||
1154 | asn1_write_value (*c2, "priv", x_data, size[4])) != ASN1_SUCCESS) | 1154 | asn1_write_value (*c2, "priv", x_data, size[4])) != ASN1_SUCCESS) |
1155 | { | 1155 | { |
1156 | gnutls_assert (); | 1156 | gnutls_assert (); |
1157 | result = _gnutls_asn2err (result); | 1157 | result = mhd_gtls_asn2err (result); |
1158 | goto cleanup; | 1158 | goto cleanup; |
1159 | } | 1159 | } |
1160 | 1160 | ||
@@ -1163,7 +1163,7 @@ _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params) | |||
1163 | if ((result = asn1_write_value (*c2, "version", &null, 1)) != ASN1_SUCCESS) | 1163 | if ((result = asn1_write_value (*c2, "version", &null, 1)) != ASN1_SUCCESS) |
1164 | { | 1164 | { |
1165 | gnutls_assert (); | 1165 | gnutls_assert (); |
1166 | result = _gnutls_asn2err (result); | 1166 | result = mhd_gtls_asn2err (result); |
1167 | goto cleanup; | 1167 | goto cleanup; |
1168 | } | 1168 | } |
1169 | 1169 | ||
diff --git a/src/daemon/https/x509/x509_verify.c b/src/daemon/https/x509/x509_verify.c index b0d63727..3a27bfec 100644 --- a/src/daemon/https/x509/x509_verify.c +++ b/src/daemon/https/x509/x509_verify.c | |||
@@ -478,7 +478,7 @@ decode_ber_digest_info (const gnutls_datum_t * info, | |||
478 | &dinfo)) != ASN1_SUCCESS) | 478 | &dinfo)) != ASN1_SUCCESS) |
479 | { | 479 | { |
480 | gnutls_assert (); | 480 | gnutls_assert (); |
481 | return _gnutls_asn2err (result); | 481 | return mhd_gtls_asn2err (result); |
482 | } | 482 | } |
483 | 483 | ||
484 | result = asn1_der_decoding (&dinfo, info->data, info->size, NULL); | 484 | result = asn1_der_decoding (&dinfo, info->data, info->size, NULL); |
@@ -486,7 +486,7 @@ decode_ber_digest_info (const gnutls_datum_t * info, | |||
486 | { | 486 | { |
487 | gnutls_assert (); | 487 | gnutls_assert (); |
488 | asn1_delete_structure (&dinfo); | 488 | asn1_delete_structure (&dinfo); |
489 | return _gnutls_asn2err (result); | 489 | return mhd_gtls_asn2err (result); |
490 | } | 490 | } |
491 | 491 | ||
492 | len = sizeof (str) - 1; | 492 | len = sizeof (str) - 1; |
@@ -495,7 +495,7 @@ decode_ber_digest_info (const gnutls_datum_t * info, | |||
495 | { | 495 | { |
496 | gnutls_assert (); | 496 | gnutls_assert (); |
497 | asn1_delete_structure (&dinfo); | 497 | asn1_delete_structure (&dinfo); |
498 | return _gnutls_asn2err (result); | 498 | return mhd_gtls_asn2err (result); |
499 | } | 499 | } |
500 | 500 | ||
501 | *hash = mhd_gtls_x509_oid2mac_algorithm (str); | 501 | *hash = mhd_gtls_x509_oid2mac_algorithm (str); |
@@ -529,7 +529,7 @@ decode_ber_digest_info (const gnutls_datum_t * info, | |||
529 | { | 529 | { |
530 | gnutls_assert (); | 530 | gnutls_assert (); |
531 | asn1_delete_structure (&dinfo); | 531 | asn1_delete_structure (&dinfo); |
532 | return _gnutls_asn2err (result); | 532 | return mhd_gtls_asn2err (result); |
533 | } | 533 | } |
534 | 534 | ||
535 | asn1_delete_structure (&dinfo); | 535 | asn1_delete_structure (&dinfo); |
diff --git a/src/daemon/https/x509/x509_write.c b/src/daemon/https/x509/x509_write.c index 8855eadb..516f034f 100644 --- a/src/daemon/https/x509/x509_write.c +++ b/src/daemon/https/x509/x509_write.c | |||
@@ -151,7 +151,7 @@ gnutls_x509_crt_set_proxy_dn (gnutls_x509_crt_t crt, gnutls_x509_crt_t eecrt, | |||
151 | if (result != ASN1_SUCCESS) | 151 | if (result != ASN1_SUCCESS) |
152 | { | 152 | { |
153 | gnutls_assert (); | 153 | gnutls_assert (); |
154 | return _gnutls_asn2err (result); | 154 | return mhd_gtls_asn2err (result); |
155 | } | 155 | } |
156 | 156 | ||
157 | if (name && sizeof_name) | 157 | if (name && sizeof_name) |
@@ -200,7 +200,7 @@ gnutls_x509_crt_set_version (gnutls_x509_crt_t crt, unsigned int version) | |||
200 | if (result != ASN1_SUCCESS) | 200 | if (result != ASN1_SUCCESS) |
201 | { | 201 | { |
202 | gnutls_assert (); | 202 | gnutls_assert (); |
203 | return _gnutls_asn2err (result); | 203 | return mhd_gtls_asn2err (result); |
204 | } | 204 | } |
205 | 205 | ||
206 | return 0; | 206 | return 0; |
@@ -273,7 +273,7 @@ gnutls_x509_crt_set_crq (gnutls_x509_crt_t crt, gnutls_x509_crq_t crq) | |||
273 | if (result != ASN1_SUCCESS) | 273 | if (result != ASN1_SUCCESS) |
274 | { | 274 | { |
275 | gnutls_assert (); | 275 | gnutls_assert (); |
276 | return _gnutls_asn2err (result); | 276 | return mhd_gtls_asn2err (result); |
277 | } | 277 | } |
278 | 278 | ||
279 | result = | 279 | result = |
@@ -282,7 +282,7 @@ gnutls_x509_crt_set_crq (gnutls_x509_crt_t crt, gnutls_x509_crq_t crq) | |||
282 | if (result != ASN1_SUCCESS) | 282 | if (result != ASN1_SUCCESS) |
283 | { | 283 | { |
284 | gnutls_assert (); | 284 | gnutls_assert (); |
285 | return _gnutls_asn2err (result); | 285 | return mhd_gtls_asn2err (result); |
286 | } | 286 | } |
287 | 287 | ||
288 | return 0; | 288 | return 0; |
@@ -714,7 +714,7 @@ gnutls_x509_crt_set_serial (gnutls_x509_crt_t cert, const void *serial, | |||
714 | if (ret != ASN1_SUCCESS) | 714 | if (ret != ASN1_SUCCESS) |
715 | { | 715 | { |
716 | gnutls_assert (); | 716 | gnutls_assert (); |
717 | return _gnutls_asn2err (ret); | 717 | return mhd_gtls_asn2err (ret); |
718 | } | 718 | } |
719 | 719 | ||
720 | return 0; | 720 | return 0; |
@@ -1020,7 +1020,7 @@ gnutls_x509_crt_set_key_purpose_oid (gnutls_x509_crt_t cert, | |||
1020 | if (result != ASN1_SUCCESS) | 1020 | if (result != ASN1_SUCCESS) |
1021 | { | 1021 | { |
1022 | gnutls_assert (); | 1022 | gnutls_assert (); |
1023 | return _gnutls_asn2err (result); | 1023 | return mhd_gtls_asn2err (result); |
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | /* Check if the extension already exists. | 1026 | /* Check if the extension already exists. |
@@ -1039,7 +1039,7 @@ gnutls_x509_crt_set_key_purpose_oid (gnutls_x509_crt_t cert, | |||
1039 | { | 1039 | { |
1040 | gnutls_assert (); | 1040 | gnutls_assert (); |
1041 | asn1_delete_structure (&c2); | 1041 | asn1_delete_structure (&c2); |
1042 | return _gnutls_asn2err (result); | 1042 | return mhd_gtls_asn2err (result); |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | } | 1045 | } |
@@ -1053,7 +1053,7 @@ gnutls_x509_crt_set_key_purpose_oid (gnutls_x509_crt_t cert, | |||
1053 | { | 1053 | { |
1054 | gnutls_assert (); | 1054 | gnutls_assert (); |
1055 | asn1_delete_structure (&c2); | 1055 | asn1_delete_structure (&c2); |
1056 | return _gnutls_asn2err (result); | 1056 | return mhd_gtls_asn2err (result); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | /* 2. Add the OID. | 1059 | /* 2. Add the OID. |
@@ -1063,7 +1063,7 @@ gnutls_x509_crt_set_key_purpose_oid (gnutls_x509_crt_t cert, | |||
1063 | { | 1063 | { |
1064 | gnutls_assert (); | 1064 | gnutls_assert (); |
1065 | asn1_delete_structure (&c2); | 1065 | asn1_delete_structure (&c2); |
1066 | return _gnutls_asn2err (result); | 1066 | return mhd_gtls_asn2err (result); |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | result = _gnutls_x509_der_encode (c2, "", &der_data, 0); | 1069 | result = _gnutls_x509_der_encode (c2, "", &der_data, 0); |
@@ -1072,7 +1072,7 @@ gnutls_x509_crt_set_key_purpose_oid (gnutls_x509_crt_t cert, | |||
1072 | if (result != ASN1_SUCCESS) | 1072 | if (result != ASN1_SUCCESS) |
1073 | { | 1073 | { |
1074 | gnutls_assert (); | 1074 | gnutls_assert (); |
1075 | return _gnutls_asn2err (result); | 1075 | return mhd_gtls_asn2err (result); |
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | result = _gnutls_x509_crt_set_extension (cert, "2.5.29.37", | 1078 | result = _gnutls_x509_crt_set_extension (cert, "2.5.29.37", |
diff --git a/src/testcurl/daemon_options_test.c b/src/testcurl/daemon_options_test.c index 5851f958..739860dd 100644 --- a/src/testcurl/daemon_options_test.c +++ b/src/testcurl/daemon_options_test.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file mhds_get_test.c | 22 | * @file mhds_get_test.c |
23 | * @brief Testcase for libmicrohttpd daemon option arguments | 23 | * @brief Testcase for libmicrohttpd HTTPS GET operations |
24 | * @author Sagie Amir | 24 | * @author Sagie Amir |
25 | */ | 25 | */ |
26 | 26 | ||
@@ -67,9 +67,6 @@ test_wrap (char *test_name, int (*test) (void )) | |||
67 | return ret; | 67 | return ret; |
68 | } | 68 | } |
69 | 69 | ||
70 | /** | ||
71 | * Test the MHD_OPTION_IP_ADDR along with an IPv4 address | ||
72 | */ | ||
73 | static int | 70 | static int |
74 | test_ipv4_option () | 71 | test_ipv4_option () |
75 | { | 72 | { |
@@ -85,10 +82,6 @@ test_ipv4_option () | |||
85 | return 0; | 82 | return 0; |
86 | } | 83 | } |
87 | 84 | ||
88 | /** | ||
89 | * Test the MHD_OPTION_IP_ADDR along with an IPv6 address | ||
90 | */ | ||
91 | |||
92 | static int | 85 | static int |
93 | test_ipv6_option () | 86 | test_ipv6_option () |
94 | { | 87 | { |
diff --git a/src/testcurl/https/Makefile.am b/src/testcurl/https/Makefile.am index 73698996..de1024f5 100644 --- a/src/testcurl/https/Makefile.am +++ b/src/testcurl/https/Makefile.am | |||
@@ -10,23 +10,21 @@ AM_CPPFLAGS = \ | |||
10 | $(LIBCURL_CPPFLAGS) | 10 | $(LIBCURL_CPPFLAGS) |
11 | 11 | ||
12 | check_PROGRAMS = \ | 12 | check_PROGRAMS = \ |
13 | tls_session_time_out_test \ | 13 | tls_daemon_options_test \ |
14 | tls_cipher_change_test \ | 14 | tls_authentication_test \ |
15 | tls_daemon_options_test \ | 15 | mhds_multi_daemon_test \ |
16 | tls_alert_test \ | 16 | mhds_session_info_test |
17 | tls_authentication_test \ | 17 | |
18 | mhds_multi_daemon_test \ | 18 | if MHD_DEBUG_TLS |
19 | mhds_session_info_test | 19 | check_PROGRAMS += \ |
20 | tls_session_time_out_test \ | ||
21 | tls_cipher_change_test \ | ||
22 | tls_alert_test | ||
23 | endif | ||
20 | 24 | ||
21 | TESTS = $(check_PROGRAMS) | 25 | TESTS = $(check_PROGRAMS) |
22 | 26 | ||
23 | tls_daemon_options_test_SOURCES = \ | 27 | # cURL independent tests |
24 | tls_daemon_options_test.c | ||
25 | tls_daemon_options_test_LDADD = \ | ||
26 | $(top_builddir)/src/testcurl/libcurl_version_check.a \ | ||
27 | $(top_builddir)/src/daemon/libmicrohttpd.la \ | ||
28 | @LIBCURL@ | ||
29 | |||
30 | tls_session_time_out_test_SOURCES = \ | 28 | tls_session_time_out_test_SOURCES = \ |
31 | tls_session_time_out_test.c | 29 | tls_session_time_out_test.c |
32 | tls_session_time_out_test_LDADD = \ | 30 | tls_session_time_out_test_LDADD = \ |
@@ -45,6 +43,14 @@ tls_alert_test_LDADD = \ | |||
45 | $(top_builddir)/src/testcurl/libcurl_version_check.a \ | 43 | $(top_builddir)/src/testcurl/libcurl_version_check.a \ |
46 | $(top_builddir)/src/daemon/libmicrohttpd.la | 44 | $(top_builddir)/src/daemon/libmicrohttpd.la |
47 | 45 | ||
46 | # cURL dependent tests | ||
47 | tls_daemon_options_test_SOURCES = \ | ||
48 | tls_daemon_options_test.c | ||
49 | tls_daemon_options_test_LDADD = \ | ||
50 | $(top_builddir)/src/testcurl/libcurl_version_check.a \ | ||
51 | $(top_builddir)/src/daemon/libmicrohttpd.la \ | ||
52 | @LIBCURL@ | ||
53 | |||
48 | tls_authentication_test_SOURCES = \ | 54 | tls_authentication_test_SOURCES = \ |
49 | tls_authentication_test.c | 55 | tls_authentication_test.c |
50 | tls_authentication_test_LDADD = \ | 56 | tls_authentication_test_LDADD = \ |
diff --git a/src/testcurl/https/tls_daemon_options_test.c b/src/testcurl/https/tls_daemon_options_test.c index 9df7a9e9..1418dac0 100644 --- a/src/testcurl/https/tls_daemon_options_test.c +++ b/src/testcurl/https/tls_daemon_options_test.c | |||
@@ -469,18 +469,6 @@ main (int argc, char *const *argv) | |||
469 | MHD_OPTION_KX_PRIORITY, | 469 | MHD_OPTION_KX_PRIORITY, |
470 | kx, MHD_OPTION_END); | 470 | kx, MHD_OPTION_END); |
471 | 471 | ||
472 | |||
473 | /*gnutls_mac_algorithm_t mac[] = { | ||
474 | {MHD_GNUTLS_MAC_MD5, 0}, 0}; | ||
475 | gnutls_mac_algorithm_t * cur_mac; | ||
476 | |||
477 | for ( cur_mac = &mac[0]; (*cur_mac) != 0; cur_mac++ ){ | ||
478 | option[0] = MHD_GNUTLS_MAC_SHA1; | ||
479 | errorCount += | ||
480 | test_wrap (&test_https_transfer, test_fd, "AES256-SHA", | ||
481 | CURL_SSLVERSION_TLSv1, MHD_OPTION_MAC_ALGO, option); | ||
482 | } */ | ||
483 | |||
484 | if (errorCount != 0) | 472 | if (errorCount != 0) |
485 | fprintf (stderr, "Failed test: %s.\n", argv[0]); | 473 | fprintf (stderr, "Failed test: %s.\n", argv[0]); |
486 | 474 | ||