diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/crq_apis.c | 10 | ||||
-rw-r--r-- | tests/set_pkcs12_cred.c | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/tests/crq_apis.c b/tests/crq_apis.c index c34babf0a1..83ed6d962b 100644 --- a/tests/crq_apis.c +++ b/tests/crq_apis.c @@ -118,7 +118,7 @@ doit (void) ret = gnutls_x509_crq_get_challenge_password (crq, NULL, &s); if (ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) - fail ("gnutls_x509_crq_get_challenge_password %d\n", ret); + fail ("%d: gnutls_x509_crq_get_challenge_password %d: %s\n", __LINE__, ret, gnutls_strerror(ret)); ret = gnutls_x509_crq_set_challenge_password (crq, "foo"); if (ret != 0) @@ -126,14 +126,14 @@ doit (void) s = 0; ret = gnutls_x509_crq_get_challenge_password (crq, NULL, &s); - if (ret != 0 || s != 3) - fail ("gnutls_x509_crq_get_challenge_password2 %d/%d\n", ret, (int) s); + if (ret != GNUTLS_E_SHORT_MEMORY_BUFFER || s != 4) + fail ("%d: gnutls_x509_crq_get_challenge_password %d: %s (passlen: %d)\n", __LINE__, ret, gnutls_strerror(ret), (int)s); s = 10; ret = gnutls_x509_crq_get_challenge_password (crq, smallbuf, &s); if (ret != 0 || s != 3 || strcmp (smallbuf, "foo") != 0) - fail ("gnutls_x509_crq_get_challenge_password3 %d/%d/%s\n", - ret, (int) s, smallbuf); + fail ("%d: gnutls_x509_crq_get_challenge_password3 %d/%d/%s\n", + __LINE__, ret, (int) s, smallbuf); s = 0; ret = gnutls_x509_crq_get_extension_info (crq, 0, NULL, &s, NULL); diff --git a/tests/set_pkcs12_cred.c b/tests/set_pkcs12_cred.c index 8770bea475..71a4ce792e 100644 --- a/tests/set_pkcs12_cred.c +++ b/tests/set_pkcs12_cred.c @@ -25,9 +25,16 @@ #endif #include <stdlib.h> +#include <stdio.h> #include "utils.h" +static void +tls_log_func (int level, const char *str) +{ + fprintf (stderr, "<%d>| %s", level, str); +} + void doit (void) { @@ -39,6 +46,10 @@ doit (void) if (ret < 0) fail ("gnutls_global_init failed %d\n", ret); + gnutls_global_set_log_function (tls_log_func); + if (debug) + gnutls_global_set_log_level (4711); + ret = gnutls_certificate_allocate_credentials (&x509cred); if (ret < 0) fail ("gnutls_certificate_allocate_credentials failed %d\n", ret); |