]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Test more.
authorSimon Josefsson <simon@josefsson.org>
Wed, 3 Jun 2009 03:39:52 +0000 (05:39 +0200)
committerSimon Josefsson <simon@josefsson.org>
Wed, 3 Jun 2009 03:39:52 +0000 (05:39 +0200)
tests/crq_apis.c

index 812baaac0986ede9d8c6664917f6141924b002c2..43dd3bebc8d7e631c35088d56d34da82132891d2 100644 (file)
@@ -142,6 +142,26 @@ void doit (void)
   if (ret != 0)
     fail ("gnutls_x509_crq_set_subject_alt_name\n");
 
+  s = 0;
+  ret = gnutls_x509_crq_get_key_purpose_oid (crq, 0, NULL, &s, NULL);
+  if (ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
+    fail ("gnutls_x509_crq_get_key_purpose_oid %d\n", ret);
+
+  s = 0;
+  ret = gnutls_x509_crq_set_key_purpose_oid (crq, GNUTLS_KP_TLS_WWW_SERVER, 0);
+  if (ret != 0)
+    fail ("gnutls_x509_crq_set_key_purpose_oid %d\n", ret);
+
+  s = 0;
+  ret = gnutls_x509_crq_get_key_purpose_oid (crq, 0, NULL, &s, NULL);
+  if (ret != GNUTLS_E_SHORT_MEMORY_BUFFER)
+    fail ("gnutls_x509_crq_get_key_purpose_oid %d\n", ret);
+
+  s = 0;
+  ret = gnutls_x509_crq_set_key_purpose_oid (crq, GNUTLS_KP_TLS_WWW_CLIENT, 1);
+  if (ret != 0)
+    fail ("gnutls_x509_crq_set_key_purpose_oid2 %d\n", ret);
+
   ret = gnutls_x509_crq_print (crq, GNUTLS_CRT_PRINT_FULL, &out);
   if (ret != 0)
     fail ("gnutls_x509_crq_print\n");