From ec7c2ff2011d774217c1e35d664072d0487853c7 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 4 Jul 2013 15:37:34 +0200 Subject: trust: Add p11_asn1_read() and p11_asn1_free() functions Some helpers for commonly used ASN.1 related stuff. --- trust/tests/test-asn1.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'trust/tests') 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); } -- cgit v1.1