summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Don't respect timezones for CKA_START_DATE or CKA_END_DATEStef Walter2013-04-032-338/+0
| | | | | | | | | | | | | The PKCS#11 specification does not note what timezone these dates are in. In addition the time values are not represented in PKCS#11. So don't reinterpret certificate dates, other than filling in the century for dates that have a two digit year. Lastly, these are low resolution optional fields so not being all strict about timezones here is appropriate. https://bugs.freedesktop.org/show_bug.cgi?id=62825
* More compatible path munging and handling codeStef Walter2013-04-038-73/+526
| | | | | | | | | | 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
* Don't use free() on memory allocated by LocalFree()Stef Walter2013-04-031-1/+1
| | | | ihttps://bugs.freedesktop.org/show_bug.cgi?id=63046
* Separate library init from message codeStef Walter2013-04-0311-102/+234
| | | | | | | | | | | 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
* Don't use library locks from p11-kit toolStef Walter2013-04-031-4/+0
| | | | | | | The global library p11_library_mutex is for libraries to use, so don't use it from any code in common/, which is also used by the p11-kit tool 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.
* Don't try to guess at overflowing time values on 32-bit systemsStef Walter2013-03-281-3/+3
| | | | | | | | | Since CKA_START_DATE and CKA_END_DATE are the only places where we want to parse out times, and these are optional, just leave blank if the time overflows what libc can handle on a 32-bit system. https://bugs.freedesktop.org/show_bug.cgi?id=62825
* 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-205-1/+11
|
* Fix invalid memory accesses reported by 'make memcheck'Stef Walter2013-03-203-18/+31
| | | | These are things that showed up in valgrind while running the tests.
* Add a bit of infrastructure for running valgrindStef Walter2013-03-202-3/+2
| | | | | * make memcheck: Runs basic memory checking * make leakcheck: Also runs leak checking
* attrs: Print out the CKA_VALUE for certificates when debuggingStef Walter2013-03-203-14/+51
| | | | | | | | 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-207-30/+215
| | | | | | | | | | | 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-206-42/+42
| | | | | 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-194-24/+131
| | | | | | Both are nasty. Do our own, and test it a bit https://bugs.freedesktop.org/show_bug.cgi?id=62479
* Release version 0.17.1Stef Walter2013-03-181-1/+21
| | | | * Fix distcheck bugs surrounding the strndup() workaround
* attrs: Change p11_attrs_to_string() to allow static templatesStef Walter2013-03-183-7/+15
| | | | | 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.
* compat: Fix trivial commentStef Walter2013-03-181-1/+1
|
* Use the nickname x-distrusted for CKA_X_DISTRUSTEDStef Walter2013-03-181-1/+1
| | | | | This is a non-standard PKCS#11 attribute, so has the X prefix like the other ones we've added.
* Refine looking up of attributes in arraysStef Walter2013-03-184-80/+91
| | | | | | | | 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
|
* trust: Update frob-nss-tool so it can compare modules for trust infoStef Walter2013-03-152-0/+25
| | | | | Can run with two modules now so that it can compare tokens NSS trust info.
* trust: Support a p11-kit specific serialization formatStef Walter2013-03-153-0/+27
| | | | | | | This is documented in doc/internals/ subdirectory Add tests for the format as well. https://bugs.freedesktop.org/show_bug.cgi?id=62156
* url: Split out the URL encoding and decoding functionsStef Walter2013-03-155-0/+369
| | | | | | | 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-155-0/+605
| | | | | | This lexer will be used in our PKCS#11 persistence format as well. https://bugs.freedesktop.org/show_bug.cgi?id=62156
* trust: Use a SHA-1 hash of subjectPublicKeyInfo as CKA_ID by defaultStef Walter2013-03-152-0/+27
| | | | | | | This is what's recommended by the spec, and allows stapled extensions to hang off a predictable CKA_ID. https://bugs.freedesktop.org/show_bug.cgi?id=62329
* attrs: Add info functions for constant names and valuesStef Walter2013-03-156-232/+566
| | | | | | | * 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-153-6/+153
| | | | | | | 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-153-0/+177
| | | | | | | | | 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-152-0/+62
| | | | | | | * 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-153-11/+221
| | | | | When bringing over the BSD base64 code, there was a regression. In addition add some tests for the base64 stuff.
* trust: Use the new NSS PKCS#11 extension codesStef Walter2013-03-082-67/+68
| | | | | NSS had subtly changed the values of the distrust CK_TRUST codes so update them to stay in sync.
* Don't shove messages into debug output if they're already displayedStef Walter2013-03-081-2/+2
|
* tools: Add a bit of debugging to the PEM extract handlerStef Walter2013-03-081-0/+1
|
* x509: Don't break when cA field of BasicConstraints is missingStef Walter2013-03-071-2/+9
| | | | | | | The field defaults to FALSE. It sucks that libtasn1 doesn't fill this in for us. https://bugs.freedesktop.org/show_bug.cgi?id=61975
* Build with the libtasn1 CFLAGS properlyStef Walter2013-03-042-0/+7
| | | | | | Tweaks by: Roman Bogorodskiy <bogorodskiy@gmail.com> https://bugs.freedesktop.org/show_bug.cgi?id=61739
* Redo mock.h header in order to relicenseStef Walter2013-03-041-667/+686
| | | | | Rewrite the mock.h header to relicense it. It is based on the BSD licensed mock.c file, so this isn't a big issue.
* Don't use wchar_t for storing unicode charactersStef Walter2013-03-031-35/+36
| | | | | On Win32 wchar_t is only 2 bytes, which breaks our UTF-8 conversion functions.
* Fix syntax errors in OS_WIN32 ifdefsStef Walter2013-03-032-5/+5
|
* Open files in binary mode on windowsStef Walter2013-03-031-0/+4
| | | | So that the Windows' C library doesn't munge line endings
* Add compat gmtime_r() and timegm() functionsStef Walter2013-03-032-0/+70
| | | | Not available on Win32 or ancient unixes
* Add compat mkstemp() and mkdtemp() functionsStef Walter2013-03-032-0/+156
| | | | Not available on Win32 or ancient unixes
* Add compat vasprintf() and asprintf() functionsStef Walter2013-03-032-0/+83
| | | | These are not available on Win32 and ancient unixes
* Add compat strndup() functionStef Walter2013-03-032-0/+29
| | | | Not available on Win32 and ancient unixes
* Abstract mmap() into a compat APIStef Walter2013-03-033-58/+151
| | | | | 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()
* Add compat implementation of basename()Stef Walter2013-03-032-0/+68
| | | | For Win32 and older unixes
* Rename p11_module_xxx() compat functions to p11_dl_xxx()Stef Walter2013-03-032-19/+19
| | | | | | | For clarity. In addition, make p11_dl_close() able to be used as a destroyer callback. Also make p11_dl_error() return an allocated string
* Update the pkcs11.h header for missing mechanismsStef Walter2013-02-202-1/+26
|
* Only do shared object and DLL initialization in librariesStef Walter2013-02-202-49/+13
| | | | | | Don't do library initialization on shared object load when not running in a library. We'll want to plug into this and do different things per library in the future.