summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Relicense the buffer code appropriate for inclusion in p11-kitStef Walter2013-02-122-46/+68
| | | | | * All original lines in this file upon arrival in the p11-kit project were written by me, and copyright held by me.
* Fix dereference of varargs in p11_attrs_build()Stef Walter2013-02-111-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=60473
* Remove unnecessary code to be more compatible with various libtasn1 versionsStef Walter2013-02-111-4/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=60434
* Fix various clang analyzer warningsStef Walter2013-02-062-1/+15
| | | | | * Add annotations to our precondition functions so that they don't make the analyzer complain
* Use the CN, OU or O of certificates to generate a labelStef Walter2013-02-059-0/+886
| | | | | * This is in cases where the certificate information does not already have a friendly name or alias.
* Implement code for writing PEMStef Walter2013-02-055-4/+237
| | | | | | | * 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
* Add public iterator API to p11-kitStef Walter2013-02-052-8/+142
|
* Move the X.509 extension parsing code in common/Stef Walter2013-02-053-12/+255
| | | | * So it can be used by other code, in addition to the trust stuff
* Add p11_array_clear() functionStef Walter2013-02-053-7/+43
| | | | * Clears an array without freeing the array itself
* Implement trust assertion PKCS#11 objectsStef Walter2013-02-053-10/+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-059-3/+1135
|
* Fill in certificate authority and trust data correctlyStef Walter2013-02-051-5/+4
| | | | | | | | | | | | * Fill in CKA_CERTIFICATE_CATEGORY properly for authorities based on the presence of BasicConstraints and/or v1 certificates * Fill in CKA_TRUSTED and CKA_X_DISTRUSTED based on whether the parser is running for anchors or blacklist * In addition support the concept of blacklisted certificates mixed in with the anchors (without any purposes) since that's what exists in the real world. * We do this after the various hooks have had a chance to mess with the certificate extensions and such.
* Implement stapled certificate extensions internallyStef Walter2013-02-059-21/+556
| | | | | | | | | | | | * 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 openssl TRUSTED CERTIFICATE PEM filesStef Walter2013-02-053-0/+58
|
* Add support for parsing PEM filesStef Walter2013-02-057-5/+801
|
* Add basic trust moduleStef Walter2013-02-0511-8/+1519
| | | | | | 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-055-0/+764
| | | | | | 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.
* Remove the unused err() function and friendsStef Walter2013-02-052-187/+0
| | | | | We want to use p11_message in our commands anyway, since that allows us control with --verbose and --quiet.
* Add internal function for turning on messagesStef Walter2013-02-052-0/+10
| | | | To be used from tests
* Add more mock-module implementationStef Walter2013-02-043-0/+3818
| | | | | * Move mock code into the common/ directory to be used by multiple components of p11-kit
* Further tweaks and cleanup for functions dealing with PKCS#11 attributesStef Walter2013-02-043-70/+910
| | | | | | | | * 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-045-0/+478
| | | | Represents a block of memory that can be added to, parsed and so on
* Use the stdbool.h C99 bool typeStef Walter2013-01-2310-104/+119
| | | | | | 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..
* Only initialize p11-kit libraries onceStef Walter2013-01-092-6/+14
| | | | * Make the gcc constructor call p11_library_init_once()
* Set strict debug preconditions during testingStef Walter2013-01-091-0/+4
|
* Add common functions for manipulating CK_ATTRIBUTE arraysStef Walter2013-01-095-0/+916
|
* Move the pkcs11.h header files into common directoryStef Walter2013-01-093-0/+1535
| | | | | | | * Allows use of them across the whole project * Put a stub file in the p11-kit/ directory, so we can still refer to the headers using that path, which is what it will be at when in the installed includes directory.
* Build common code into noinst librariesStef Walter2013-01-092-11/+15
| | | | | | * 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-0914-0/+2320
| | | | | | | | | | | 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.
* Fix build on solarisRob McMahon2012-07-311-0/+4
| | | | | | | * Conditional inclusion of the errno.h header * Link librt when appropriate for nanosleep https://bugs.freedesktop.org/show_bug.cgi?id=52261
* Fix getprogname() running under wineStef Walter2012-07-171-2/+5
| | | | * Wine uses normal slashes instead of backslashes on windows
* Win32 build fixesStef Walter2012-06-291-4/+7
| | | | | | * Remove unused functions * Use getprogname() instead of calc_progname() which no longer exists * Fix up exporting of functions in the mock module
* Use gcc extensions to check varargs during compileStef Walter2012-05-131-6/+18
| | | | | * Add macros GNUC_PRINTF and GNUC_NULL_TERMINATED to check correct printf and NULL terminated style varargs
* Provide compat getprogname() implementations on other OS'sStef Walter2012-05-012-26/+71
| | | | * And use them in our replacement err() and p11_kit_set_progname()