summaryrefslogtreecommitdiff
path: root/crypto/apr_crypto.c
Commit message (Collapse)AuthorAgeFilesLines
* apr_crypto: Add support for digest functions, with hashing, signingminfrin2018-07-221-0/+74
| | | | | | | and verifying. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1836439 13f79535-47bb-0310-9956-ffa450edef68
* Make sure we compile in the absence of APU_HAVE_CRYPTO_PRNG. Make sure we don'tminfrin2018-07-221-1/+5
| | | | | | | segfault if the PRNG does not initialise. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1836438 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: follow up to r1833359: fix some root pool scopes (possible leaks).ylavic2018-06-141-33/+51
| | | | | | | | | | | | | | | | Keep the root pool scope for things that need it only (global lists of drivers or libs), but otherwise use the passed in pool (crypto libs, default PRNG, errors). This allows the caller to control the scope of initialization functions, and for instance be able to re-initialize when apr_crypto is unloaded/reloaded from a DSO attached to the passed-in pool (e.g. mod_ssl in httpd). apu_dso_load() needs to return its handles when called multiple times (EINIT), it's not the caller's job (like crypto drivers) to maintain them. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1833525 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: follow up to r1833359: helper to get crypto lib version.ylavic2018-06-131-2/+45
| | | | | | | | | While at it, also fix bad copy/paste function names for MSCNG/MSCAPI. (BTW, those libs are totally ENOTIMPL/unplugged for now). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1833456 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: follow up to r1833359: reuse crypto_lib_free() code.ylavic2018-06-131-6/+11
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1833451 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: follow up to r1833359: don't ignore lib->term() return value.ylavic2018-06-131-3/+6
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1833450 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: follow up to r1833359: crypto libs initialization scope.ylavic2018-06-131-38/+115
| | | | | | | | | | | | The crypto libs initialized on (and terminated with) the given pool, not the root pool. The latter is used only to maintain the active libs. This allows the users to control the scope of the lib, e.g. when itself is called by dynamic linking or DSO. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1833449 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: follow up to r1833359.ylavic2018-06-121-2/+154
| | | | | | | | | | | | | | | | | | | | | Link underlying crypto libraries (openssl, nss, and commoncrypto) with libapr when the corresponding --with is configured. This allows to initialize, terminate or check whether initialized respectively with apr_crypto_lib_init(), apr_crypto_lib_term() or apr_crypto_lib_is_initialized(). Users can now control the (un)initialization of those libraries, notably when they also use them independently and that doing this multiple times can cause leaks or unexpected behaviour. The initialization code is moved from "apr_crypto_{openssl,nss,commoncrypto}.c" where previously loaded dynamically (DSO) to "apr_crypto_internal.c" which is linked with libapr. Also apr_crypto_prng_init() can make sure the underlying crypto lib is ready. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1833421 13f79535-47bb-0310-9956-ffa450edef68
* Cryptographic Pseudo Random Number Generator (CPRNG).ylavic2018-06-111-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | New apr_crypto_prng API and apr_crypto[_thread]_random_bytes() functions. Allows to generate cryptographically secure random bytes indefinitely given an initial seed of APR_CRYPTO_PRNG_SEED_SIZE bytes (32), which is either provided by the caller or automatically gathered from the system. The CPRNG can also be re-seeded at any time, or after a process is fork()ed. The internal key is renewed every APR_CRYPTO_PRNG_SEED_SIZE random bytes produced and those data once returned to the caller are cleared from the internal state, which ensures forward secrecy. This CPRNG is fast, based on a stream cipher, and will never block besides the initial seed or any reseed if it depends on the system entropy. Finally, it can be used either globally (locked in multithread environment), per-thread (a lock free instance is automatically created for each thread on first use), or created as standalone instance (manageable independently). For now it's only implemented with the OpenSSL library as underlying crypto, that is --with-crypto --with-openssl needs to be configured, and the latter links libcrypto with APR. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1833359 13f79535-47bb-0310-9956-ffa450edef68
* crypto: provide apr_crypto_equals(), a timing attacks safe buffers comparisonylavic2016-10-061-0/+15
| | | | | | | | function. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1763669 13f79535-47bb-0310-9956-ffa450edef68
* crypto: provide apr_crypto_memzero, garanteed to not be optimized out byylavic2016-10-061-1/+33
| | | | | | | | compilers. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1763665 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Add apr_crypto_key() function which supports keysminfrin2016-07-091-2/+26
| | | | | | | | generated from a passphrase or a raw secret provided by the caller. Deprecate apr_crypto_passphrase(). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1752008 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Don't cache the driver if initialisation fails. Thisminfrin2016-07-071-5/+8
| | | | | | | | stops the second and subsequent attempt to use the API from failing claiming the library is not initialised. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1751806 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto_get_driver(): Fix invalid storage referencetrawick2014-08-211-1/+1
| | | | | | | | | | on error path. Submitted by: Philip Martin <philip.martin wandisco.com> Reviewed by: trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1619438 13f79535-47bb-0310-9956-ffa450edef68
* APR DSOs have .dll extension on Cygwin too.trawick2013-10-051-1/+1
| | | | | | | | | PR: 55587 Submitted by: Carlo Bramini <carlo.bramix libero.it> Reviewed by: trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1529554 13f79535-47bb-0310-9956-ffa450edef68
* Fix forever loop on NetWare when trying to get parent pool.fuankg2013-05-071-1/+3
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1479836 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Add a native CommonCrypto implementation for iOS and OSXminfrin2012-10-051-0/+5
| | | | | | | where OpenSSL has been deprecated. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1394552 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Ensure that the if/else that governs the staticminfrin2012-04-021-3/+3
| | | | | | | | initialisation of each crypto driver works when the first driver isn't in use. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1308318 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Ensure the *driver variable is initialised when a staticallyminfrin2012-04-011-5/+6
| | | | | | | compiled library is initialised for the first time. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1308131 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Ensure the *driver variable is initialised when the libraryminfrin2012-04-011-15/+7
| | | | | | | has already been loaded. Fix ported from apr_dbd. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1308087 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Move the static initialisation of DRIVER_LOAD fromminfrin2011-12-081-24/+35
| | | | | | | | apr_crypto_init() to apr_crypto_get_driver(), so that we don't lose the parameters. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1211987 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Clear out buffers that are allocated by us when the pool fromminfrin2011-12-051-0/+30
| | | | | | | which the memory was allocated from is cleaned up. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1210524 13f79535-47bb-0310-9956-ffa450edef68
* Formatting, no functional change.minfrin2011-10-231-19/+26
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1187932 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Replace the LDAP inspired constant-based parameter passing withminfrin2011-10-231-4/+7
| | | | | | | the apr_dbd inspired string passing, and simplify configuration. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1187914 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Remove an unused parameter from the apr_crypto_init() function.minfrin2011-06-081-2/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1133587 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: Add apr_crypto_get_block_key_types() andminfrin2011-05-301-0/+28
| | | | | | | | | apr_crypto_get_block_key_modes() to provide a way to programmatically query what key types and modes are supported by a provider, either per mode/type, or by iterating through a hashtable. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1129433 13f79535-47bb-0310-9956-ffa450edef68
* Remove the apr_crypto_t context from calls where the apr_crypto_block_t isminfrin2011-05-151-25/+29
| | | | | | | passed. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1103382 13f79535-47bb-0310-9956-ffa450edef68
* Remove the pool from the apr_crypto shutdown call.minfrin2011-05-151-4/+3
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1103367 13f79535-47bb-0310-9956-ffa450edef68
* Reorder parameters. No functional change.minfrin2011-05-151-75/+81
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1103258 13f79535-47bb-0310-9956-ffa450edef68
* Add the APR_TYPEDEF_STRUCT macro to provide an implementation ofminfrin2010-01-161-27/+28
| | | | | | | | | complete types where only an incomplete type is available. Remove the driver parameter from the apr_crypto API, the driver is now wrapped inside the apr_crypto_t. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@899910 13f79535-47bb-0310-9956-ffa450edef68
* revert typo from r892984wrowe2009-12-211-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@893012 13f79535-47bb-0310-9956-ffa450edef68
* Refactor away apu_version legacy cruftwrowe2009-12-211-4/+4
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@892984 13f79535-47bb-0310-9956-ffa450edef68
* Two missed APU_MODULE_DECLARE_DATA fixeswrowe2009-12-171-2/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@891841 13f79535-47bb-0310-9956-ffa450edef68
* Refactor the apr_crypto.h interface so that the apr_crypto_t structureminfrin2009-12-151-16/+16
| | | | | | | | remains private. Correctly reference the apr_crypto_t context as a context and not a factory. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@890579 13f79535-47bb-0310-9956-ffa450edef68
* Convert various APU_DECLARE into APR_DECLARE.bojan2009-07-161-15/+15
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@794523 13f79535-47bb-0310-9956-ffa450edef68
* APR->APU conversion of DSO buildfoo; rename --disable-util-dso tojorton2009-03-241-8/+8
| | | | | | | | | | | | | | | | | | | | | --disable-modular-dso: * configure.in, Makefile.in: Use APR_DSO_MODULES for set of DSOs to build. * util-misc/apu_dso.c, include/private/apu_internal.h: Use macro APR_HAVE_MODULAR_DSO to determine whether modular DSO build is used. * build/dso.m4 (APR_MODULAR_DSO): Renamed from APU_CHECK_UTIL_DSO. Define APR_HAVE_MODULAR_DSO if modular DSO biuld is used. Add to LIBS not APRUTIL_LIBS. Rename configure flag to --disable-modular-dso to disable modular DSO build. * ldap/*.c, dbm/*.c, dbd/*.c, crypto/*.c: Adjust to use APR_HAVE_MODULAR_DSO. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@757884 13f79535-47bb-0310-9956-ffa450edef68
* Merge strmatch, xlate, crypto and xml directories from apr-util.jorton2009-03-241-0/+441
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@757729 13f79535-47bb-0310-9956-ffa450edef68