From: Simon Josefsson Date: Wed, 3 Jun 2009 04:38:18 +0000 (+0200) Subject: Test more. X-Git-Tag: gnutls_2_9_1~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0cb9bce03167fb5bd2c2a03d4381865006b22030;p=thirdparty%2Fgnutls.git Test more. --- diff --git a/tests/crq_apis.c b/tests/crq_apis.c index 43dd3bebc8..ee5da504df 100644 --- a/tests/crq_apis.c +++ b/tests/crq_apis.c @@ -66,6 +66,8 @@ void doit (void) size_t s = 0; + char smallbuf[10]; + int ret; ret = gnutls_global_init (); @@ -112,6 +114,25 @@ void doit (void) if (ret != 0) fail ("gnutls_x509_crq_set_key_usage %d\n", ret); + 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); + + ret = gnutls_x509_crq_set_challenge_password (crq, "foo"); + if (ret != 0) + fail ("gnutls_x509_crq_set_challenge_password %d\n", ret); + + 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, 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, s, smallbuf); + s = 0; ret = gnutls_x509_crq_get_extension_info (crq, 0, NULL, &s, NULL); if (ret != 0)