diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-06-01 14:34:57 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-06-02 08:50:16 +0200 |
commit | ff04ce2f22b58cf5dee5347e7fc11d130fc7ff90 (patch) | |
tree | 66d960cde4b6ae372c6d4faf4137a615aaabb796 /tests/dn.c | |
parent | c18644935bc61be1a2d6bca2c3929a23495377a6 (diff) | |
download | gnutls-ff04ce2f22b58cf5dee5347e7fc11d130fc7ff90.tar.gz |
tests: added check for gnutls_x509_dn_get_str
Diffstat (limited to 'tests/dn.c')
-rw-r--r-- | tests/dn.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/dn.c b/tests/dn.c index 05710fda3b..97c3ea1041 100644 --- a/tests/dn.c +++ b/tests/dn.c @@ -89,6 +89,7 @@ void doit(void) int ret; gnutls_datum_t pem_cert = { (unsigned char *) pem, sizeof(pem) }; gnutls_x509_crt_t cert; + gnutls_datum_t strdn; gnutls_x509_dn_t xdn; ret = global_init(); @@ -116,6 +117,15 @@ void doit(void) if (ret < 0) fail("get_subject %d\n", ret); + ret = gnutls_x509_dn_get_str(xdn, &strdn); + if (ret < 0) + fail("gnutls_x509_dn_get_str %d\n", ret); + + if (strdn.size != 44 || strcmp((char*)strdn.data, "CN=CAcert WoT User,EMAIL=simon@josefsson.org") != 0) { + fail("gnutls_x509_dn_get_str string comparison failed: '%s'/%d\n", strdn.data, strdn.size); + } + gnutls_free(strdn.data); + if (debug) { printf("Subject:\n"); print_dn(xdn); |