summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-06-03 06:38:18 +0200
committerSimon Josefsson <simon@josefsson.org>2009-06-03 06:38:18 +0200
commit0cb9bce03167fb5bd2c2a03d4381865006b22030 (patch)
tree3de1720adbac6c3e6734e2c5c3377b67e545c88b
parent276f7b0cb8ecbd71a816d1e6f26e4561c4dc4d00 (diff)
downloadgnutls-0cb9bce03167fb5bd2c2a03d4381865006b22030.tar.gz
Test more.
-rw-r--r--tests/crq_apis.c21
1 files changed, 21 insertions, 0 deletions
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)