}
static int
-compar_pointers (const void *one,
- const void *two)
+compar_strings (const void *one,
+ const void *two)
{
char **p1 = (char **)one;
char **p2 = (char **)two;
- return *p1 - *p2;
+ return strcmp (*p1, *p2);
}
static void
{
p11_dict *map;
p11_dictiter iter;
- char *keys[] = { "one", "two", "three" };
- char *values[] = { "four", "eight", "twelve" };
+ char *keys[] = { "111", "222", "333" };
+ char *values[] = { "444", "555", "666" };
void *okeys[3];
void *ovalues[3];
bool ret;
int i;
- map = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL);
+ map = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL);
CuAssertPtrNotNull (tc, map);
for (i = 0; i < 3; i++) {
CuAssertIntEquals (tc, 2, p11_dict_size (map));
p11_dict_free (map);
- qsort (okeys, 3, sizeof (void *), compar_pointers);
- qsort (ovalues, 3, sizeof (void *), compar_pointers);
+ qsort (okeys, 3, sizeof (void *), compar_strings);
+ qsort (ovalues, 3, sizeof (void *), compar_strings);
for (i = 0; i < 3; i++) {
CuAssertStrEquals (tc, keys[i], okeys[i]);
listed in a module config file with a relative path.</para></listitem>
</varlistentry>
<varlistentry>
- <term><option>--with-system-anchors</option></term>
- <listitem><para>Specify the files or directories to look for system
- certificate anchors. Multiple files and/or directories are specified with
- a <literal>:</literal> in between them.</para></listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--with-system-certificates</option></term>
- <listitem><para>Specify the files or directories to look for other
- non-anchor system certificates. Multiple files and/or directories are
- specified with a <literal>:</literal> in between them.</para></listitem>
+ <term><option>--with-trust-paths</option></term>
+ <listitem><para>Specify the files or directories to look for certificate
+ anchors and blacklists. Multiple files and/or directories are specified with
+ a <literal>:</literal> in between them. The first path has the highest
+ priority when searching for certificates.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--with-system-config</option></term>
CK_SLOT_INFO info;
char description[64];
CK_ULONG count;
+ size_t length;
CK_RV rv;
int i;
CuAssertIntEquals (cu, CKR_OK, rv);
memset (description, ' ', sizeof (description));
- assert (strlen (paths[i]) <= sizeof (description));
- memcpy (description, paths[i], strlen (paths[i]));
+ length = strlen(paths[i]);
+ if (length > sizeof (description))
+ length = sizeof (description);
+ memcpy (description, paths[i], length);
CuAssertTrue (cu, memcmp (info.slotDescription, description, sizeof (description)) == 0);
}