summaryrefslogtreecommitdiff
path: root/common/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Abstract mmap() into a compat APIStef Walter2013-03-031-24/+11
| | | | | The Win32 for mmap() is very different from Unix, so abstract this into our own p11_mmap_xxx() functions.
* Use putenv() instead of setenv()Stef Walter2013-03-035-5/+5
| | | | Since older operating systems don't support setenv()
* Use the CN, OU or O of certificates to generate a labelStef Walter2013-02-053-0/+334
| | | | | * This is in cases where the certificate information does not already have a friendly name or alias.
* Implement code for writing PEMStef Walter2013-02-051-3/+111
| | | | | | | * Based on the gcr code * Bring in base64 output code from BSD * Make sure to output base64 lines of 64 character length since this is what OpenSSL expects
* Move the X.509 extension parsing code in common/Stef Walter2013-02-051-7/+184
| | | | * So it can be used by other code, in addition to the trust stuff
* Add p11_array_clear() functionStef Walter2013-02-051-0/+27
| | | | * Clears an array without freeing the array itself
* Implement trust assertion PKCS#11 objectsStef Walter2013-02-052-9/+10
| | | | | | * Implement trust assertions for anchored and distrusted certs * Pinned certificate trust assertions are not implemented yet * Add an internal tool for pulling apart bits of certificates
* Refactor how parsing of ASN.1 data and certificate extensions workStef Walter2013-02-053-0/+300
|
* Implement stapled certificate extensions internallyStef Walter2013-02-054-19/+244
| | | | | | | | | | | | * Use stapled certificate extensions to represent loaded trust policy * Build NSS trust objects from stapled certificate extensions * Add further attribute debugging for NSS trust objects * Use a custom certificate extension for the OpenSSL reject purpose data * Use SubjectKeyIdentifier for OpenSSL keyid data * Use ExtendedKeyUsage for OpenSSL trust purpose data * Implement simple way to handle binary DER OIDs, using the DER TLV length. DER OIDs are used in the CKA_OBJECT_ID value, and elsewhere. * Split out the building of NSS trust objects from the main parser
* Add support for parsing PEM filesStef Walter2013-02-052-5/+263
|
* Add basic trust moduleStef Walter2013-02-054-2/+400
| | | | | | This is based off the roots-store from gnome-keyring and loads certificates from a root directory and exposes them as PKCS#11 objects.
* Add basic checksum algorithmsStef Walter2013-02-052-0/+153
| | | | | | The SHA-1 and MD5 digests here are used for checksums in legacy protocols. We don't use them in cryptographic contexts at all. These particular algorithms would be poor choices for that.
* Further tweaks and cleanup for functions dealing with PKCS#11 attributesStef Walter2013-02-041-17/+109
| | | | | | | | * Check that the size is correct when looking for a boolean or a ulong. * Make sure that the length is not the invalid negative ulong. * Functions for dumping out attribute contents * Make it possible to use attributes in hash tables
* Add generic buffer codeStef Walter2013-02-042-0/+215
| | | | Represents a block of memory that can be added to, parsed and so on
* Use the stdbool.h C99 bool typeStef Walter2013-01-231-42/+48
| | | | | | It was getting really wild knowing whether a function returning an int would return -1 on failure or 0 or whether the int return value was actually a number etc..
* Set strict debug preconditions during testingStef Walter2013-01-091-0/+4
|
* Add common functions for manipulating CK_ATTRIBUTE arraysStef Walter2013-01-092-0/+519
|
* Build common code into noinst librariesStef Walter2013-01-091-9/+5
| | | | | | * This is cleaner than building the same source files all over the place over and over. * Works better with code coverage.
* Move debug and library code into the common/ subdirectoryStef Walter2013-01-093-0/+691
Start using p11_ as our internal prefix rather than _p11_. We explicitly export p11_kit_ so this is fine as far as visibility. Move the threading, mutex, and module compat, dict, and array code into the common directory too. Take this opportunity to clean up a bit of internal API as well, since so many lines are being touched internally.