diff options
author | Stef Walter <stef@thewalter.net> | 2013-07-04 15:37:34 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2013-07-04 15:42:16 +0200 |
commit | ec7c2ff2011d774217c1e35d664072d0487853c7 (patch) | |
tree | c2ff76fc08c9b237f101d4119451ef04229c7788 /trust/tests | |
parent | a2165fe35e336fd807af053a21a396b020f90a23 (diff) |
trust: Add p11_asn1_read() and p11_asn1_free() functions
Some helpers for commonly used ASN.1 related stuff.
Diffstat (limited to 'trust/tests')
-rw-r--r-- | trust/tests/test-asn1.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/trust/tests/test-asn1.c b/trust/tests/test-asn1.c index 710928c..d5ec131 100644 --- a/trust/tests/test-asn1.c +++ b/trust/tests/test-asn1.c @@ -130,6 +130,24 @@ test_asn1_cache (void) p11_asn1_cache_free (cache); } +static void +test_asn1_free (void) +{ + p11_dict *defs; + node_asn *asn; + + defs = p11_asn1_defs_load (); + assert_ptr_not_null (defs); + + asn = p11_asn1_decode (defs, "PKIX1.ExtKeyUsageSyntax", + test_eku_server_and_client, + sizeof (test_eku_server_and_client), NULL); + assert_ptr_not_null (defs); + + p11_asn1_free (asn); + p11_asn1_free (NULL); +} + int main (int argc, char *argv[]) @@ -139,6 +157,7 @@ main (int argc, p11_fixture (NULL, NULL); p11_test (test_asn1_cache, "/asn1/asn1_cache"); + p11_test (test_asn1_free, "/asn1/free"); return p11_test_run (argc, argv); } |