mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-10-01 04:03:18 +03:00
indent
This commit is contained in:
1 parent
d59bf31468
commit
a0a601db24
40 files changed
+309
-352
No files matched your search
@@ -70,24 +70,28 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
|
||||
int ret;
|
||||
|
||||
/* assert actual connection cipher is the one negotiated */
|
||||
if (MHD_get_connection_info (connection, MHD_CONNECTION_INFO_CIPHER_ALGO)->
|
||||
cipher_algorithm != MHD_GNUTLS_CIPHER_AES_256_CBC)
|
||||
if (MHD_get_connection_info
|
||||
(connection,
|
||||
MHD_CONNECTION_INFO_CIPHER_ALGO)->cipher_algorithm !=
|
||||
MHD_GNUTLS_CIPHER_AES_256_CBC)
|
||||
{
|
||||
fprintf (stderr, "Error: requested cipher mismatch. %s\n",
|
||||
strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (MHD_get_connection_info (connection, MHD_CONNECTION_INFO_KX_ALGO)->
|
||||
kx_algorithm != MHD_GNUTLS_KX_RSA)
|
||||
if (MHD_get_connection_info
|
||||
(connection,
|
||||
MHD_CONNECTION_INFO_KX_ALGO)->kx_algorithm != MHD_GNUTLS_KX_RSA)
|
||||
{
|
||||
fprintf (stderr, "Error: requested key exchange mismatch. %s\n",
|
||||
strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (MHD_get_connection_info (connection, MHD_CONNECTION_INFO_MAC_ALGO)->
|
||||
mac_algorithm != MHD_GNUTLS_MAC_SHA1)
|
||||
if (MHD_get_connection_info
|
||||
(connection,
|
||||
MHD_CONNECTION_INFO_MAC_ALGO)->mac_algorithm != MHD_GNUTLS_MAC_SHA1)
|
||||
{
|
||||
fprintf (stderr, "Error: requested mac algorithm mismatch. %s\n",
|
||||
strerror (errno));
|
||||
@@ -104,16 +108,19 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (MHD_get_connection_info (connection, MHD_CONNECTION_INFO_PROTOCOL)->
|
||||
protocol != MHD_GNUTLS_PROTOCOL_SSL3)
|
||||
if (MHD_get_connection_info
|
||||
(connection,
|
||||
MHD_CONNECTION_INFO_PROTOCOL)->protocol != MHD_GNUTLS_PROTOCOL_SSL3)
|
||||
{
|
||||
fprintf (stderr, "Error: requested compression mismatch. %s\n",
|
||||
strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (MHD_get_connection_info (connection, MHD_CONNECTION_INFO_CERT_TYPE)->
|
||||
certificate_type != MHD_GNUTLS_CRT_X509)
|
||||
if (MHD_get_connection_info
|
||||
(connection,
|
||||
MHD_CONNECTION_INFO_CERT_TYPE)->certificate_type !=
|
||||
MHD_GNUTLS_CRT_X509)
|
||||
{
|
||||
fprintf (stderr, "Error: requested certificate mismatch. %s\n",
|
||||
strerror (errno));
|
||||
|
||||
@@ -71,7 +71,7 @@ setup (MHD_gtls_session_t * session,
|
||||
strlen (srv_self_signed_cert_pem), &malloc);
|
||||
|
||||
MHD__gnutls_certificate_set_x509_key_mem (*xcred, cert, key,
|
||||
GNUTLS_X509_FMT_PEM);
|
||||
GNUTLS_X509_FMT_PEM);
|
||||
|
||||
MHD__gnutls_init (session, GNUTLS_CLIENT);
|
||||
ret = MHD__gnutls_priority_set_direct (*session, "NORMAL", err_pos);
|
||||
@@ -167,7 +167,7 @@ test_alert_unexpected_message (MHD_gtls_session_t session)
|
||||
inet_pton (AF_INET, "127.0.0.1", &sa.sin_addr);
|
||||
|
||||
MHD__gnutls_transport_set_ptr (session,
|
||||
(MHD_gnutls_transport_ptr_t) ((void *) sd));
|
||||
(MHD_gnutls_transport_ptr_t) ((void *) sd));
|
||||
|
||||
ret = connect (sd, &sa, sizeof (struct sockaddr_in));
|
||||
|
||||
@@ -184,7 +184,7 @@ test_alert_unexpected_message (MHD_gtls_session_t session)
|
||||
}
|
||||
|
||||
MHD__gnutls_alert_send (session, GNUTLS_AL_FATAL,
|
||||
GNUTLS_A_UNEXPECTED_MESSAGE);
|
||||
GNUTLS_A_UNEXPECTED_MESSAGE);
|
||||
usleep (100);
|
||||
|
||||
/* TODO better RST trigger */
|
||||
|
||||
@@ -73,7 +73,7 @@ setup (MHD_gtls_session_t * session,
|
||||
strlen (srv_self_signed_cert_pem), &malloc);
|
||||
|
||||
MHD__gnutls_certificate_set_x509_key_mem (*xcred, cert, key,
|
||||
GNUTLS_X509_FMT_PEM);
|
||||
GNUTLS_X509_FMT_PEM);
|
||||
|
||||
MHD__gnutls_init (session, GNUTLS_CLIENT);
|
||||
ret = MHD__gnutls_priority_set_direct (*session, "NORMAL", err_pos);
|
||||
@@ -89,8 +89,7 @@ setup (MHD_gtls_session_t * session,
|
||||
static int
|
||||
teardown (MHD_gtls_session_t session,
|
||||
MHD_gnutls_datum_t * key,
|
||||
MHD_gnutls_datum_t * cert,
|
||||
MHD_gtls_cert_credentials_t xcred)
|
||||
MHD_gnutls_datum_t * cert, MHD_gtls_cert_credentials_t xcred)
|
||||
{
|
||||
|
||||
MHD_gtls_free_datum_m (key, free);
|
||||
|
||||
@@ -381,8 +381,8 @@ main (int argc, char *const *argv)
|
||||
int cipher[] = { MHD_GNUTLS_CIPHER_3DES_CBC, 0 };
|
||||
|
||||
errorCount +=
|
||||
test_wrap ("https_transfer", &test_https_transfer,
|
||||
test_fd, "AES256-SHA",
|
||||
test_wrap ("https_transfer", &test_https_transfer,
|
||||
test_fd, "AES256-SHA",
|
||||
CURL_SSLVERSION_TLSv1,
|
||||
MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
|
||||
MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
|
||||
@@ -391,11 +391,10 @@ main (int argc, char *const *argv)
|
||||
errorCount +=
|
||||
test_wrap ("protocol_version", &test_protocol_version, test_fd,
|
||||
"AES256-SHA", CURL_SSLVERSION_TLSv1,
|
||||
MHD_OPTION_HTTPS_MEM_KEY,
|
||||
MHD_OPTION_HTTPS_MEM_KEY,
|
||||
srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
|
||||
srv_self_signed_cert_pem,
|
||||
MHD_OPTION_PROTOCOL_VERSION, p,
|
||||
MHD_OPTION_END);
|
||||
srv_self_signed_cert_pem,
|
||||
MHD_OPTION_PROTOCOL_VERSION, p, MHD_OPTION_END);
|
||||
errorCount +=
|
||||
test_wrap ("cipher DES-CBC3-SHA", &test_https_transfer, test_fd,
|
||||
"DES-CBC3-SHA", CURL_SSLVERSION_TLSv1,
|
||||
|
||||
@@ -63,13 +63,13 @@ setup (MHD_gtls_session_t * session,
|
||||
const char **err_pos;
|
||||
|
||||
MHD__gnutls_certificate_allocate_credentials (xcred);
|
||||
|
||||
|
||||
MHD_gtls_set_datum_m (key, srv_key_pem, strlen (srv_key_pem), &malloc);
|
||||
MHD_gtls_set_datum_m (cert, srv_self_signed_cert_pem,
|
||||
strlen (srv_self_signed_cert_pem), &malloc);
|
||||
|
||||
MHD__gnutls_certificate_set_x509_key_mem (*xcred, cert, key,
|
||||
GNUTLS_X509_FMT_PEM);
|
||||
GNUTLS_X509_FMT_PEM);
|
||||
|
||||
MHD__gnutls_init (session, GNUTLS_CLIENT);
|
||||
ret = MHD__gnutls_priority_set_direct (*session, "NORMAL", err_pos);
|
||||
|
||||
Reference in new issue
Block a user