From 32ca4f6d3167d08fc985d66fe48f453954596f87 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sun, 3 Feb 2013 23:26:10 +0100 Subject: Use the CN, OU or O of certificates to generate a label * This is in cases where the certificate information does not already have a friendly name or alias. --- tools/tests/test-openssl.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'tools/tests/test-openssl.c') diff --git a/tools/tests/test-openssl.c b/tools/tests/test-openssl.c index a48220d..d242b50 100644 --- a/tools/tests/test-openssl.c +++ b/tools/tests/test-openssl.c @@ -373,7 +373,7 @@ test_file_without (CuTest *tc) } /* From extract-openssl.c */ -void p11_openssl_canon_string (char *str, long *len); +void p11_openssl_canon_string (char *str, size_t *len); static void test_canon_string (CuTest *tc) @@ -392,21 +392,23 @@ test_canon_string (CuTest *tc) }; char *str; - long len; - long out; + size_t len; + size_t out; int i; for (i = 0; i < ELEMS (fixtures); i++) { - len = fixtures[i].input_len; - if (len < 0) + if (fixtures[i].input_len < 0) len = strlen (fixtures[i].input); + else + len = fixtures[i].input_len; str = strndup (fixtures[i].input, len); p11_openssl_canon_string (str, &len); - out = fixtures[i].output_len; - if (out < 0) + if (fixtures[i].output_len < 0) out = strlen (fixtures[i].output); + else + out = fixtures[i].output_len; CuAssertIntEquals (tc, out, len); CuAssertStrEquals (tc, fixtures[i].output, str); -- cgit v1.1