summaryrefslogtreecommitdiff
path: root/common/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix mostly erroneous scanner warnings in testsStef Walter2014-08-083-0/+6
|
* Fix handling of mmap failure and mapping empty filesPascal Terjan2014-02-131-0/+17
| | | | | | | | | | | Check the return value of mmap() correctly. Empty files cannot be mmap'd so we implement some work around code for that. https://bugs.freedesktop.org/show_bug.cgi?id=74773 Signed-off-by: Stef Walter <stef@thewalter.net>
* attrs: Allow NULL attribute to be passed to p11_attr_hash()Stef Walter2014-01-131-0/+3
| | | | | | This allows simpler lookups. https://bugs.freedesktop.org/show_bug.cgi?id=73558
* Drop unused libtasn1.h includeRoman Bogorodskiy2013-11-081-2/+0
| | | | | | | | | It's not only unsed, but also causes build fail because CFLAGS for tests does not contain LIBTASN1_CFLAGS. Signed-off-by: Stef Walter <stef@thewalter.net> https://bugs.freedesktop.org/show_bug.cgi?id=71379
* Disable tests with setgid binaries when running in fakerootAndreas Metzler2013-10-011-1/+4
| | | | | We use the FAKED_MODE environment variable as a way to detect fakeroot.
* Remove unused make variablesStef Walter2013-09-091-4/+2
|
* test-compat calls test_getauxval which is in a UNIX defined blockMichael Cronenworth2013-07-301-0/+2
| | | | | | MinGW builds fail due to this. https://bugs.freedesktop.org/show_bug.cgi?id=67518
* Don't use _GNU_SOURCE and fix strerror_r usageStef Walter2013-07-232-0/+66
| | | | | glibc declares strerror_r completely different if in POSIX or GNU mode. Nastiness. Stop using _GNU_SOURCE all together.
* Fix various memory leaks exposed by 'make leakcheck'Stef Walter2013-07-231-42/+48
|
* Use simple serial automake test harnessStef Walter2013-07-233-2/+96
| | | | | * Add a testing sanity check to see if we're catching errors * Fix a few other testing issues
* Support expanding $XDG_CONFIG_HOME in user config pathsStef Walter2013-07-181-0/+6
| | | | | | | | | | If ~/.config is specified as a prefix to a configured path, then it is expanded to the $XDG_CONFIG_HOME if that exists Add --with-user-config ./configure option to configure a different user config directory. Interpolate the right directories into documentation.
* Don't load configs from user directory when setuidStef Walter2013-07-183-1/+97
| | | | | | | When running as setuid() or setgid() don't access the user's home directory, or use $HOME environment variables. https://bugzilla.redhat.com/show_bug.cgi?id=985014
* tools: Use $TMPDIR instead of $TEMPStef Walter2013-07-181-30/+1
| | | | | | | | | | | | TMPDIR is a more standard environment variable for locating the temp directory on Unix. In addition since this is only used in tests, remove the code from the generic p11_path_expand() func. In general remove the possibility for forks to put $HOME or $TEMP environment variables in configured paths. This was possible due to code in p11_path_expand() but not something we supported. https://bugzilla.redhat.com/show_bug.cgi?id=985017
* Add support for using freebl3 for SHA1 and MD5 hashingStef Walter2013-07-101-92/+0
| | | | | | Since we don't want to link freebl3 to libp11-kit.so where it isn't needed, move the SHA-1 and MD5 digest functionality to the trust/ directory.
* path: Add p11_path_canon() functionStef Walter2013-07-031-0/+17
| | | | Cleans up a filename with readable characters.
* path: Add p11_path_prefix() functionStef Walter2013-07-031-0/+13
| | | | | Checks if a wellformed path is identical to or a prefix of another path.
* Reorganize various componentsStef Walter2013-06-2512-1982/+11
| | | | | | | * p11-kit library and tool in the p11-kit/ subdirectory * trust module and new trust tool in trust/ subdirectory * No more tools/ subdirectory * Lots less in the common/ subdirectory
* path: Add p11_path_parent() functionStef Walter2013-06-141-0/+17
| | | | | Gets the parent element of the path, removing the last component. Handles trailing and duplicate path separators correctly.
* path: Fix expanding of paths and testsStef Walter2013-06-141-20/+26
|
* constants: Tweaks and add mechanismsStef Walter2013-05-271-39/+31
|
* pem: Write PEM data directly to a bufferStef Walter2013-05-271-9/+12
|
* url: Encode directly to a bufferStef Walter2013-05-271-12/+18
|
* Fix up Makefile.am files for automake 1.13 warningsStef Walter2013-05-211-2/+2
|
* Our own unit testing frameworkStef Walter2013-05-2117-1004/+765
| | | | | | | | * Support the TAP protocol * Much cleaner without having to carry around state * First class support for setup/teardown * Port the common tests * Wait on porting other tests until we've merged outstanding code
* Support /xxx/yyy as an absolute path with Win32Stef Walter2013-05-211-1/+1
| | | | | Because win32 code doesn't just run on windows, wine runs with unix style paths.
* Add the log-calls module config optionStef Walter2013-05-211-5/+13
| | | | | If 'log-calls = yes' is set then all the PKCS#11 modules are logged to stderr.
* Patch to make test-lexer depend on ASN.1manphiz@gmail.com2013-05-141-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=64378
* Update to MurmurHash3Stef Walter2013-04-031-9/+9
| | | | | | | This should also fix problems with accessing memory in a non-aligned fashion on platforms where this causes problems. https://bugs.freedesktop.org/show_bug.cgi?id=62819
* More compatible path munging and handling codeStef Walter2013-04-033-32/+203
| | | | | | | | | | Centralize the path handling code, so we can remove unixy assumptions and have a chance of running on Windows. The current goal is to run all the tests on Windows. Includes some code from LRN <lrn1986@gmail.com> https://bugs.freedesktop.org/show_bug.cgi?id=63062
* Separate library init from message codeStef Walter2013-04-034-8/+8
| | | | | | | | | | | Put library init/uninit code its into their own statically linked library so that they don't get linked into the p11-kit executable. Refactor the message code so that the library initialization can plug in its per thread message buffer. https://bugs.freedesktop.org/show_bug.cgi?id=63046
* Fix build with automake 1.13Stef Walter2013-04-031-2/+2
| | | | Also remove some generated files from the po/ directory.
* Fix testing of murmur hash on bigendian systemsStef Walter2013-03-251-37/+23
| | | | | | The murmur hash produces different output depending on the architecture https://bugzilla.redhat.com/show_bug.cgi?id=927394
* Fix memory leaks reported by 'make leakcheck'Stef Walter2013-03-203-0/+7
|
* Fix invalid memory accesses reported by 'make memcheck'Stef Walter2013-03-202-11/+27
| | | | These are things that showed up in valgrind while running the tests.
* Add a bit of infrastructure for running valgrindStef Walter2013-03-201-2/+0
| | | | | * make memcheck: Runs basic memory checking * make leakcheck: Also runs leak checking
* attrs: Print out the CKA_VALUE for certificates when debuggingStef Walter2013-03-201-1/+1
| | | | | | | | While it's true that we shouldn't be pritning out CKA_VALUE in certain cases, like for keys, we obviously can do so for certificates. We don't have keys anyway, but in the interest of being general purpose use the class to determine whether CKA_VALUE can be printed
* hash: Add the murmur2 hash and start using itStef Walter2013-03-201-0/+71
| | | | | | | | | | | Add implementation of the murmur2 hash function, and start using it for our dictionaries. Our implementation is incremental like our other hash functions. Also remove p11_oid_hash() which wasn't being used. In addition fix several tests whose success was based on the way that the dictionary hashed. This was a hidden testing bug.
* hash: Rename file and functions for hashesStef Walter2013-03-202-15/+15
| | | | | We're going to be adding other hashes. Also build as part of a different common library.
* trust: Don't use POSIX or GNU basename()Stef Walter2013-03-192-0/+94
| | | | | | Both are nasty. Do our own, and test it a bit https://bugs.freedesktop.org/show_bug.cgi?id=62479
* attrs: Change p11_attrs_to_string() to allow static templatesStef Walter2013-03-181-1/+5
| | | | | Allow passing the number of attributes to print, which lets us use this directly on templates passed in by callers of the PKCS#11 API.
* Refine looking up of attributes in arraysStef Walter2013-03-181-3/+51
| | | | | | | | There was a class of bugs for looking up invalid or empty attributes in the internal PKCS#11 attribute arrays. * Refine what p11_attrs_find_valid() treats as valid * Rename p11_attrs_is_empty() to p11_attrs_terminator() for clarity
* Fix distcheck and documentationStef Walter2013-03-151-8/+8
|
* url: Split out the URL encoding and decoding functionsStef Walter2013-03-152-0/+167
| | | | | | | We want to use these as the format for encoding binary data in our PKCS#11 attribute persistence https://bugs.freedesktop.org/show_bug.cgi?id=62156
* lexer: Make a lexer for our config file formatStef Walter2013-03-152-0/+282
| | | | | | This lexer will be used in our PKCS#11 persistence format as well. https://bugs.freedesktop.org/show_bug.cgi?id=62156
* attrs: Add info functions for constant names and valuesStef Walter2013-03-152-0/+118
| | | | | | | * For retrieving the name and/or nick of constants * The nick is what we'll use in the file format https://bugs.freedesktop.org/show_bug.cgi?id=62329
* attrs: New p11_attrs_merge() functionStef Walter2013-03-151-0/+103
| | | | | | | This takes one set of attributes and merges them into another, without copying memory needlessly. https://bugs.freedesktop.org/show_bug.cgi?id=62329
* asn1: Implement a parsed ASN.1 tree cacheStef Walter2013-03-151-0/+46
| | | | | | | | | In order to unmarry the parser from the future builder, but still retain efficiency, we need to be able to cache parsed ASN.1 trees. The ASN.1 cache provides this. In addition it carries around the loaded ASN.1 definitions. https://bugs.freedesktop.org/show_bug.cgi?id=62329
* dict: Allow removal of current item in a p11_dict iterationStef Walter2013-03-151-0/+60
| | | | | | | * This was already possible to do safely before * Document and test this behavior https://bugs.freedesktop.org/show_bug.cgi?id=61499
* pem: Fix a bug decoding some PEM filesStef Walter2013-03-152-0/+213
| | | | | When bringing over the BSD base64 code, there was a regression. In addition add some tests for the base64 stuff.
* Build with the libtasn1 CFLAGS properlyStef Walter2013-03-041-0/+4
| | | | | | Tweaks by: Roman Bogorodskiy <bogorodskiy@gmail.com> https://bugs.freedesktop.org/show_bug.cgi?id=61739