diff options
Diffstat (limited to 'tests/empty_retrieve_function.c')
-rw-r--r-- | tests/empty_retrieve_function.c | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/tests/empty_retrieve_function.c b/tests/empty_retrieve_function.c index ecdab3ca35..35e2de913f 100644 --- a/tests/empty_retrieve_function.c +++ b/tests/empty_retrieve_function.c @@ -20,7 +20,7 @@ */ #ifdef HAVE_CONFIG_H -#include <config.h> +# include <config.h> #endif #include <stdio.h> @@ -37,24 +37,22 @@ */ static int cert_cb1(gnutls_session_t session, - const gnutls_datum_t * req_ca_rdn, - int nreqs, - const gnutls_pk_algorithm_t * pk_algos, - int pk_algos_length, - gnutls_retr2_st *retr) + const gnutls_datum_t * req_ca_rdn, + int nreqs, + const gnutls_pk_algorithm_t * pk_algos, + int pk_algos_length, gnutls_retr2_st * retr) { memset(retr, 0, sizeof(*retr)); return 0; } static int cert_cb2(gnutls_session_t session, - const gnutls_datum_t *req_ca_rdn, - int nreqs, - const gnutls_pk_algorithm_t *pk_algos, - int pk_algos_length, - gnutls_pcert_st** pcert, - unsigned int *pcert_length, - gnutls_privkey_t *privkey) + const gnutls_datum_t * req_ca_rdn, + int nreqs, + const gnutls_pk_algorithm_t * pk_algos, + int pk_algos_length, + gnutls_pcert_st ** pcert, + unsigned int *pcert_length, gnutls_privkey_t * privkey) { *pcert_length = 0; *privkey = NULL; @@ -64,13 +62,12 @@ static int cert_cb2(gnutls_session_t session, } static int cert_cb3(gnutls_session_t session, - const struct gnutls_cert_retr_st *info, - gnutls_pcert_st **certs, - unsigned int *pcert_length, - gnutls_ocsp_data_st **ocsp, - unsigned int *ocsp_length, - gnutls_privkey_t *privkey, - unsigned int *flags) + const struct gnutls_cert_retr_st *info, + gnutls_pcert_st ** certs, + unsigned int *pcert_length, + gnutls_ocsp_data_st ** ocsp, + unsigned int *ocsp_length, + gnutls_privkey_t * privkey, unsigned int *flags) { *privkey = NULL; *ocsp_length = 0; @@ -78,7 +75,6 @@ static int cert_cb3(gnutls_session_t session, return 0; } - static void tls_log_func(int level, const char *str) { fprintf(stderr, "<%d>| %s", level, str); @@ -100,9 +96,11 @@ void doit(void) gnutls_certificate_allocate_credentials(&x509_cred); - ret = gnutls_certificate_set_x509_key_mem(x509_cred, &server_ca3_localhost_cert_chain, - &server_ca3_key, - GNUTLS_X509_FMT_PEM); + ret = + gnutls_certificate_set_x509_key_mem(x509_cred, + &server_ca3_localhost_cert_chain, + &server_ca3_key, + GNUTLS_X509_FMT_PEM); if (ret < 0) { fail("error in error code\n"); exit(1); @@ -110,17 +108,23 @@ void doit(void) gnutls_certificate_allocate_credentials(&clicred); gnutls_certificate_set_retrieve_function(clicred, cert_cb1); - _test_cli_serv(x509_cred, clicred, "NORMAL", "NORMAL", "localhost", NULL, NULL, NULL, 0, 1, GNUTLS_E_CERTIFICATE_REQUIRED, -1); + _test_cli_serv(x509_cred, clicred, "NORMAL", "NORMAL", "localhost", + NULL, NULL, NULL, 0, 1, GNUTLS_E_CERTIFICATE_REQUIRED, + -1); gnutls_certificate_free_credentials(clicred); gnutls_certificate_allocate_credentials(&clicred); gnutls_certificate_set_retrieve_function2(clicred, cert_cb2); - _test_cli_serv(x509_cred, clicred, "NORMAL", "NORMAL", "localhost", NULL, NULL, NULL, 0, 1, GNUTLS_E_CERTIFICATE_REQUIRED, -1); + _test_cli_serv(x509_cred, clicred, "NORMAL", "NORMAL", "localhost", + NULL, NULL, NULL, 0, 1, GNUTLS_E_CERTIFICATE_REQUIRED, + -1); gnutls_certificate_free_credentials(clicred); gnutls_certificate_allocate_credentials(&clicred); gnutls_certificate_set_retrieve_function3(clicred, cert_cb3); - _test_cli_serv(x509_cred, clicred, "NORMAL", "NORMAL", "localhost", NULL, NULL, NULL, 0, 1, GNUTLS_E_CERTIFICATE_REQUIRED, -1); + _test_cli_serv(x509_cred, clicred, "NORMAL", "NORMAL", "localhost", + NULL, NULL, NULL, 0, 1, GNUTLS_E_CERTIFICATE_REQUIRED, + -1); gnutls_certificate_free_credentials(clicred); gnutls_certificate_free_credentials(x509_cred); |