summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/apr_buckets.h11
-rw-r--r--include/apr_crypto.h273
-rw-r--r--include/apr_hooks.h120
-rw-r--r--include/apr_ldap.h.in2
-rw-r--r--include/apr_memcache.h22
-rw-r--r--include/apr_reslist.h10
-rw-r--r--include/apr_xml.h4
-rw-r--r--include/apu_version.h2
-rw-r--r--include/private/apr_crypto_internal.h130
-rw-r--r--include/private/apr_dbd_odbc_v2.h50
10 files changed, 335 insertions, 289 deletions
diff --git a/include/apr_buckets.h b/include/apr_buckets.h
index fb87635c..b1d18613 100644
--- a/include/apr_buckets.h
+++ b/include/apr_buckets.h
@@ -679,10 +679,11 @@ APU_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b);
APU_DECLARE(apr_status_t) apr_brigade_cleanup(void *data);
/**
- * Move the buckets from the tail end of the existing brigade @param b into
- * the brigade @param a. If @param a is NULL a new brigade is created. Buckets
- * from @param e to the last bucket (inclusively) of brigade @param b are moved
- * from @param b to the returned brigade @param a.
+ * Move the buckets from the tail end of the existing brigade @a b into
+ * the brigade @a a. If @a a is NULL a new brigade is created. Buckets
+ * from @a e to the last bucket (inclusively) of brigade @a b are moved
+ * from @a b to the returned brigade @a a.
+ *
* @param b The brigade to split
* @param e The first bucket to move
* @param a The brigade which should be used for the result or NULL if
@@ -774,7 +775,7 @@ APU_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut,
apr_off_t maxbytes);
/**
- * create an iovec of the elements in a bucket_brigade... return number
+ * Create an iovec of the elements in a bucket_brigade... return number
* of elements used. This is useful for writing to a file or to the
* network efficiently.
* @param b The bucket brigade to create the iovec from
diff --git a/include/apr_crypto.h b/include/apr_crypto.h
index 2577248c..9c5778be 100644
--- a/include/apr_crypto.h
+++ b/include/apr_crypto.h
@@ -20,6 +20,7 @@
#include "apu.h"
#include "apr_pools.h"
#include "apr_tables.h"
+#include "apr_hash.h"
#include "apu_errno.h"
#ifdef __cplusplus
@@ -36,49 +37,6 @@ extern "C" {
* @{
*/
-/** CA certificate type unknown */
-#define APR_CRYPTO_CA_TYPE_UNKNOWN 0
-/** binary DER encoded CA certificate */
-#define APR_CRYPTO_CA_TYPE_DER 1
-/** PEM encoded CA certificate */
-#define APR_CRYPTO_CA_TYPE_BASE64 2
-/** Netscape/Mozilla cert7.db CA certificate database */
-#define APR_CRYPTO_CA_TYPE_CERT7_DB 3
-/** Netscape/Mozilla secmod file */
-#define APR_CRYPTO_CA_TYPE_SECMOD 4
-/** Client certificate type unknown */
-#define APR_CRYPTO_CERT_TYPE_UNKNOWN 5
-/** binary DER encoded client certificate */
-#define APR_CRYPTO_CERT_TYPE_DER 6
-/** PEM encoded client certificate */
-#define APR_CRYPTO_CERT_TYPE_BASE64 7
-/** Netscape/Mozilla key3.db client certificate database */
-#define APR_CRYPTO_CERT_TYPE_KEY3_DB 8
-/** Netscape/Mozilla client certificate nickname */
-#define APR_CRYPTO_CERT_TYPE_NICKNAME 9
-/** Private key type unknown */
-#define APR_CRYPTO_KEY_TYPE_UNKNOWN 10
-/** binary DER encoded private key */
-#define APR_CRYPTO_KEY_TYPE_DER 11
-/** PEM encoded private key */
-#define APR_CRYPTO_KEY_TYPE_BASE64 12
-/** PKCS#12 encoded client certificate */
-#define APR_CRYPTO_CERT_TYPE_PFX 13
-/** PKCS#12 encoded private key */
-#define APR_CRYPTO_KEY_TYPE_PFX 14
-/** Openldap directory full of base64-encoded cert
- * authorities with hashes in corresponding .0 directory
- */
-#define APR_CRYPTO_CA_TYPE_CACERTDIR_BASE64 15
-/** CMS Key Database with private key and cert chain */
-#define APR_CRYPTO_CA_TYPE_CMS 16
-/** Symmetrical key */
-#define APR_CRYPTO_KEY_TYPE_SYM 17
-/** Netscape/Mozilla certificate database directory */
-#define APR_CRYPTO_CA_TYPE_DIR 18
-/** Crypto engine */
-#define APR_CRYPTO_ENGINE 101
-
#if APU_HAVE_CRYPTO
#ifndef APU_CRYPTO_RECOMMENDED_DRIVER
@@ -141,77 +99,71 @@ extern "C" {
* aligned data, use 3DES_192/CBC, AES_256/CBC or AES_256/ECB.
*/
-typedef enum {
- KEY_NONE, KEY_3DES_192, /** 192 bit (3-Key) 3DES */
- KEY_AES_128, /** 128 bit AES */
- KEY_AES_192, /** 192 bit AES */
- KEY_AES_256
+typedef enum
+{
+ APR_KEY_NONE, APR_KEY_3DES_192, /** 192 bit (3-Key) 3DES */
+ APR_KEY_AES_128, /** 128 bit AES */
+ APR_KEY_AES_192, /** 192 bit AES */
+ APR_KEY_AES_256
/** 256 bit AES */
} apr_crypto_block_key_type_e;
-typedef enum {
- MODE_NONE, /** An error condition */
- MODE_ECB, /** Electronic Code Book */
- MODE_CBC
+typedef enum
+{
+ APR_MODE_NONE, /** An error condition */
+ APR_MODE_ECB, /** Electronic Code Book */
+ APR_MODE_CBC
/** Cipher Block Chaining */
} apr_crypto_block_key_mode_e;
-/**
- * Certificate and private key structure.
- *
- * The various crypto backends expect certificates and keys in a wide
- * array of formats. This structure is analogous to apr_ldap_opt_tls_cert_t
- * from the LDAP interface. Ultimately that interface should be meshed with
- * this one.
- * @param type Type of certificate APR_CRYPTO_*_TYPE_*
- * @param path Path, file or nickname of the certificate
- * @param password Optional password, can be NULL
- */
-typedef struct apr_crypto_param_t {
- int type;
- const char *path;
- const char *password;
-} apr_crypto_param_t;
-
/* These are opaque structs. Instantiation is up to each backend */
typedef struct apr_crypto_driver_t apr_crypto_driver_t;
+typedef struct apr_crypto_t apr_crypto_t;
typedef struct apr_crypto_config_t apr_crypto_config_t;
typedef struct apr_crypto_key_t apr_crypto_key_t;
typedef struct apr_crypto_block_t apr_crypto_block_t;
/**
- * Public factory API, common to all backends.
- */
-typedef struct apr_crypto_t {
- apr_pool_t *pool;
- apu_err_t *result;
- apr_array_header_t *keys;
- apr_crypto_config_t *config;
-} apr_crypto_t;
-
-/**
* @brief Perform once-only initialisation. Call once only.
*
* @param pool - pool to register any shutdown cleanups, etc
* @return APR_NOTIMPL in case of no crypto support.
*/
-APU_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool,
- const apr_array_header_t *params);
+APU_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool);
+
+/**
+ * @brief Register a cleanup to zero out the buffer provided
+ * when the pool is cleaned up.
+ *
+ * @param pool - pool to register the cleanup
+ * @param buffer - buffer to zero out
+ * @param size - size of the buffer to zero out
+ */
+APR_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, void *buffer,
+ apr_size_t size);
/**
* @brief Get the driver struct for a name
*
- * @param pool - (process) pool to register cleanup
- * @param name - driver name
* @param driver - pointer to driver struct.
+ * @param name - driver name
+ * @param params - array of initialisation parameters
+ * @param result - result and error message on failure
+ * @param pool - (process) pool to register cleanup
* @return APR_SUCCESS for success
* @return APR_ENOTIMPL for no driver (when DSO not enabled)
* @return APR_EDSOOPEN if DSO driver file can't be opened
* @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver
+ * @remarks NSS: the params can have "dir", "key3", "cert7" and "secmod"
+ * keys, each followed by an equal sign and a value. Such key/value pairs can
+ * be delimited by space or tab. If the value contains a space, surround the
+ * whole key value pair in quotes: "dir=My Directory".
+ * @remarks OpenSSL: currently no params are supported.
*/
-APU_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *name,
- const apr_crypto_driver_t **driver, const apr_array_header_t *params,
- const apu_err_t **result);
+APU_DECLARE(apr_status_t) apr_crypto_get_driver(
+ const apr_crypto_driver_t **driver,
+ const char *name, const char *params, const apu_err_t **result,
+ apr_pool_t *pool);
/**
* @brief Return the name of the driver.
@@ -219,33 +171,59 @@ APU_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *na
* @param driver - The driver in use.
* @return The name of the driver.
*/
-APU_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driver);
+APU_DECLARE(const char *) apr_crypto_driver_name(
+ const apr_crypto_driver_t *driver);
/**
- * @brief Get the result of the last operation on a factory. If the result
+ * @brief Get the result of the last operation on a context. If the result
* is NULL, the operation was successful.
- * @param driver - driver to use
- * @param factory - factory pointer will be written here
* @param result - the result structure
+ * @param f - context pointer
* @return APR_SUCCESS for success
*/
-APU_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f,
- const apu_err_t **result);
+APU_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result,
+ const apr_crypto_t *f);
/**
* @brief Create a context for supporting encryption. Keys, certificates,
* algorithms and other parameters will be set per context. More than
* one context can be created at one time. A cleanup will be automatically
* registered with the given pool to guarantee a graceful shutdown.
+ * @param f - context pointer will be written here
* @param driver - driver to use
- * @param pool - process pool
* @param params - array of key parameters
- * @param factory - factory pointer will be written here
+ * @param pool - process pool
* @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE
* if the engine cannot be initialised.
+ * @remarks NSS: currently no params are supported.
+ * @remarks OpenSSL: the params can have "engine" as a key, followed by an equal
+ * sign and a value.
+ */
+APU_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f,
+ const apr_crypto_driver_t *driver, const char *params,
+ apr_pool_t *pool);
+
+/**
+ * @brief Get a hash table of key types, keyed by the name of the type against
+ * an integer pointer constant.
+ *
+ * @param types - hashtable of key types keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
+ */
+APU_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types,
+ const apr_crypto_t *f);
+
+/**
+ * @brief Get a hash table of key modes, keyed by the name of the mode against
+ * an integer pointer constant.
+ *
+ * @param modes - hashtable of key modes keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
*/
-APU_DECLARE(apr_status_t) apr_crypto_factory(const apr_crypto_driver_t *driver,
- apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f);
+APU_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes,
+ const apr_crypto_t *f);
/**
* @brief Create a key from the given passphrase. By default, the PBKDF2
@@ -256,9 +234,9 @@ APU_DECLARE(apr_status_t) apr_crypto_factory(const apr_crypto_driver_t *driver,
* operations.
* @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If
* *key is not NULL, *key must point at a previously created structure.
- * @param driver - driver to use
- * @param p The pool to use.
- * @param f The context to use.
+ * @param key The key returned, see note.
+ * @param ivSize The size of the initialisation vector will be returned, based
+ * on whether an IV is relevant for this type of crypto.
* @param pass The passphrase to use.
* @param passLen The passphrase length in bytes
* @param salt The salt to use.
@@ -266,45 +244,41 @@ APU_DECLARE(apr_status_t) apr_crypto_factory(const apr_crypto_driver_t *driver,
* @param type 3DES_192, AES_128, AES_192, AES_256.
* @param mode Electronic Code Book / Cipher Block Chaining.
* @param doPad Pad if necessary.
- * @param key The key returned, see note.
- * @param ivSize The size of the initialisation vector will be returned, based
- * on whether an IV is relevant for this type of crypto.
+ * @param iterations Number of iterations to use in algorithm
+ * @param f The context to use.
+ * @param p The pool to use.
* @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend
* error occurred while generating the key. APR_ENOCIPHER if the type or mode
* is not supported by the particular backend. APR_EKEYTYPE if the key type is
* not known. APR_EPADDING if padding was requested but is not supported.
* APR_ENOTIMPL if not implemented.
*/
-APU_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *driver,
- apr_pool_t *p, const apr_crypto_t *f, const char *pass,
- apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen,
+APU_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key,
+ apr_size_t *ivSize, const char *pass, apr_size_t passLen,
+ const unsigned char * salt, apr_size_t saltLen,
const apr_crypto_block_key_type_e type,
const apr_crypto_block_key_mode_e mode, const int doPad,
- const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize);
+ const int iterations, const apr_crypto_t *f, apr_pool_t *p);
/**
* @brief Initialise a context for encrypting arbitrary data using the given key.
* @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
* *ctx is not NULL, *ctx must point at a previously created structure.
- * @param driver - driver to use
- * @param p The pool to use.
- * @param f The block factory to use.
- * @param key The key structure to use.
+ * @param ctx The block context returned, see note.
* @param iv Optional initialisation vector. If the buffer pointed to is NULL,
* an IV will be created at random, in space allocated from the pool.
* If the buffer pointed to is not NULL, the IV in the buffer will be
* used.
- * @param ctx The block context returned, see note.
+ * @param key The key structure to use.
* @param blockSize The block size of the cipher.
+ * @param p The pool to use.
* @return Returns APR_ENOIV if an initialisation vector is required but not specified.
* Returns APR_EINIT if the backend failed to initialise the context. Returns
* APR_ENOTIMPL if not implemented.
*/
APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(
- const apr_crypto_driver_t *driver, apr_pool_t *p,
- const apr_crypto_t *f, const apr_crypto_key_t *key,
- const unsigned char **iv, apr_crypto_block_t **ctx,
- apr_size_t *blockSize);
+ apr_crypto_block_t **ctx, const unsigned char **iv,
+ const apr_crypto_key_t *key, apr_size_t *blockSize, apr_pool_t *p);
/**
* @brief Encrypt data provided by in, write it to out.
@@ -315,20 +289,18 @@ APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(
* to NULL, a buffer sufficiently large will be created from
* the pool provided. If *out points to a not-NULL value, this
* value will be used as a buffer instead.
- * @param driver - driver to use
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written,
* see note.
* @param outlen Length of the output will be written here.
* @param in Address of the buffer to read.
* @param inlen Length of the buffer to read.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
* not implemented.
*/
-APU_DECLARE(apr_status_t) apr_crypto_block_encrypt(
- const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx,
- unsigned char **out, apr_size_t *outlen, const unsigned char *in,
- apr_size_t inlen);
+APU_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out,
+ apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
+ apr_crypto_block_t *ctx);
/**
* @brief Encrypt final data block, write it to out.
@@ -338,41 +310,35 @@ APU_DECLARE(apr_status_t) apr_crypto_block_encrypt(
* number of bytes returned as actually written by the
* apr_crypto_block_encrypt() call. After this call, the context
* is cleaned and can be reused by apr_crypto_block_encrypt_init().
- * @param driver - driver to use
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written. This
* buffer must already exist, and is usually the same
* buffer used by apr_evp_crypt(). See note.
* @param outlen Length of the output will be written here.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred.
* @return APR_EPADDING if padding was enabled and the block was incorrectly
* formatted.
* @return APR_ENOTIMPL if not implemented.
*/
-APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(
- const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx,
- unsigned char *out, apr_size_t *outlen);
+APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out,
+ apr_size_t *outlen, apr_crypto_block_t *ctx);
/**
* @brief Initialise a context for decrypting arbitrary data using the given key.
* @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
* *ctx is not NULL, *ctx must point at a previously created structure.
- * @param driver - driver to use
- * @param p The pool to use.
- * @param f The block factory to use.
- * @param key The key structure to use.
- * @param iv Optional initialisation vector.
* @param ctx The block context returned, see note.
* @param blockSize The block size of the cipher.
+ * @param iv Optional initialisation vector.
+ * @param key The key structure to use.
+ * @param p The pool to use.
* @return Returns APR_ENOIV if an initialisation vector is required but not specified.
* Returns APR_EINIT if the backend failed to initialise the context. Returns
* APR_ENOTIMPL if not implemented.
*/
APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(
- const apr_crypto_driver_t *driver, apr_pool_t *p,
- const apr_crypto_t *f, const apr_crypto_key_t *key,
- const unsigned char *iv, apr_crypto_block_t **ctx,
- apr_size_t *blockSize);
+ apr_crypto_block_t **ctx, apr_size_t *blockSize,
+ const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p);
/**
* @brief Decrypt data provided by in, write it to out.
@@ -383,20 +349,18 @@ APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(
* to NULL, a buffer sufficiently large will be created from
* the pool provided. If *out points to a not-NULL value, this
* value will be used as a buffer instead.
- * @param driver - driver to use
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written,
* see note.
* @param outlen Length of the output will be written here.
* @param in Address of the buffer to read.
* @param inlen Length of the buffer to read.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
* not implemented.
*/
-APU_DECLARE(apr_status_t) apr_crypto_block_decrypt(
- const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx,
- unsigned char **out, apr_size_t *outlen, const unsigned char *in,
- apr_size_t inlen);
+APU_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out,
+ apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
+ apr_crypto_block_t *ctx);
/**
* @brief Decrypt final data block, write it to out.
@@ -406,50 +370,43 @@ APU_DECLARE(apr_status_t) apr_crypto_block_decrypt(
* number of bytes returned as actually written by the
* apr_crypto_block_decrypt() call. After this call, the context
* is cleaned and can be reused by apr_crypto_block_decrypt_init().
- * @param driver - driver to use
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written. This
* buffer must already exist, and is usually the same
* buffer used by apr_evp_crypt(). See note.
* @param outlen Length of the output will be written here.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred.
* @return APR_EPADDING if padding was enabled and the block was incorrectly
* formatted.
* @return APR_ENOTIMPL if not implemented.
*/
-APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(
- const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx,
- unsigned char *out, apr_size_t *outlen);
+APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out,
+ apr_size_t *outlen, apr_crypto_block_t *ctx);
/**
* @brief Clean encryption / decryption context.
* @note After cleanup, a context is free to be reused if necessary.
- * @param driver - driver to use
* @param ctx The block context to use.
* @return Returns APR_ENOTIMPL if not supported.
*/
-APU_DECLARE(apr_status_t) apr_crypto_block_cleanup(
- const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx);
+APU_DECLARE(apr_status_t) apr_crypto_block_cleanup(apr_crypto_block_t *ctx);
/**
- * @brief Clean encryption / decryption factory.
- * @note After cleanup, a factory is free to be reused if necessary.
- * @param driver - driver to use
- * @param f The factory to use.
+ * @brief Clean encryption / decryption context.
+ * @note After cleanup, a context is free to be reused if necessary.
+ * @param f The context to use.
* @return Returns APR_ENOTIMPL if not supported.
*/
-APU_DECLARE(apr_status_t) apr_crypto_cleanup(const apr_crypto_driver_t *driver,
- apr_crypto_t *f);
+APU_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f);
/**
* @brief Shutdown the crypto library.
* @note After shutdown, it is expected that the init function can be called again.
* @param driver - driver to use
- * @param p The pool to use.
* @return Returns APR_ENOTIMPL if not supported.
*/
-APU_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver,
- apr_pool_t *p);
+APU_DECLARE(apr_status_t) apr_crypto_shutdown(
+ const apr_crypto_driver_t *driver);
#endif /* APU_HAVE_CRYPTO */
diff --git a/include/apr_hooks.h b/include/apr_hooks.h
index 9f2a8075..b675711e 100644
--- a/include/apr_hooks.h
+++ b/include/apr_hooks.h
@@ -21,23 +21,6 @@
/* For apr_array_header_t */
#include "apr_tables.h"
-#ifdef APR_DTRACE_PROVIDER
-#include <sys/sdt.h>
-#ifndef OLD_DTRACE_PROBE
-#define OLD_DTRACE_PROBE(name) __dtrace_ap___##name()
-#endif
-#ifndef OLD_DTRACE_PROBE1
-#define OLD_DTRACE_PROBE1(name,a) __dtrace_ap___##name(a)
-#endif
-#ifndef OLD_DTRACE_PROBE2
-#define OLD_DTRACE_PROBE2(name,a,b) __dtrace_ap___##name(a,b)
-#endif
-#else
-#define OLD_DTRACE_PROBE(a)
-#define OLD_DTRACE_PROBE1(a,b)
-#define OLD_DTRACE_PROBE2(a,b,c)
-#endif
-
/**
* @file apr_hooks.h
* @brief Apache hook functions
@@ -51,6 +34,82 @@ extern "C" {
* @ingroup APR_Util
* @{
*/
+
+/**
+ * @defgroup apr_hook_probes Hook probe capability
+ * APR hooks provide a trace probe capability for capturing
+ * the flow of control and return values with hooks.
+ *
+ * In order to use this facility, the application must define
+ * the symbol APR_HOOK_PROBES_ENABLED and the four APR_HOOK_PROBE_
+ * macros described below before including apr_hooks.h in files
+ * that use the APR_IMPLEMENT_EXTERNAL_HOOK_* macros.
+ *
+ * This probe facility is not provided for APR optional hooks.
+ * @{
+ */
+
+#ifdef APR_HOOK_PROBES_ENABLED
+#define APR_HOOK_INT_DCL_UD void *ud = NULL
+#else
+/** internal implementation detail to avoid the ud declaration when
+ * hook probes are not used
+ */
+#define APR_HOOK_INT_DCL_UD
+/**
+ * User-defined hook probe macro that is invoked when the hook
+ * is run, before calling any hook functions.
+ * @param ud A void * user data field that should be filled in by
+ * this macro, and will be provided to the other hook probe macros.
+ * @param ns The namespace prefix of the hook functions
+ * @param name The name of the hook
+ * @param args The argument list to the hook functions, with enclosing
+ * parens.
+ */
+#define APR_HOOK_PROBE_ENTRY(ud,ns,name,args)
+/**
+ * User-defined hook probe macro that is invoked after the hook
+ * has run.
+ * @param ud A void * user data field that was filled in by the user-
+ * provided APR_HOOK_PROBE_ENTRY().
+ * @param ns The namespace prefix of the hook functions
+ * @param name The name of the hook
+ * @param rv The return value of the hook, or 0 if the hook is void.
+ * @param args The argument list to the hook functions, with enclosing
+ * parens.
+ */
+#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv,args)
+/**
+ * User-defined hook probe macro that is invoked before calling a
+ * hook function.
+ * @param ud A void * user data field that was filled in by the user-
+ * provided APR_HOOK_PROBE_ENTRY().
+ * @param ns The namespace prefix of the hook functions
+ * @param name The name of the hook
+ * @param src The value of apr_hook_debug_current at the time the function
+ * was hooked (usually the source file implementing the hook function).
+ * @param args The argument list to the hook functions, with enclosing
+ * parens.
+ */
+#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src,args)
+/**
+ * User-defined hook probe macro that is invoked after calling a
+ * hook function.
+ * @param ud A void * user data field that was filled in by the user-
+ * provided APR_HOOK_PROBE_ENTRY().
+ * @param ns The namespace prefix of the hook functions
+ * @param name The name of the hook
+ * @param src The value of apr_hook_debug_current at the time the function
+ * was hooked (usually the source file implementing the hook function).
+ * @param rv The return value of the hook function, or 0 if the hook is void.
+ * @param args The argument list to the hook functions, with enclosing
+ * parens.
+ */
+#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv,args)
+#endif
+
+/** @} */
+
/** macro to return the prototype of the hook function */
#define APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \
link##_DECLARE(apr_array_header_t *) ns##_hook_get_##name(void)
@@ -123,21 +182,22 @@ link##_DECLARE(void) ns##_run_##name args_decl \
{ \
ns##_LINK_##name##_t *pHook; \
int n; \
+ APR_HOOK_INT_DCL_UD; \
\
- OLD_DTRACE_PROBE(name##__entry); \
+ APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \
\
if(_hooks.link_##name) \
{ \
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
{ \
- OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \
+ APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \
pHook[n].pFunc args_use; \
- OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, 0); \
+ APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, 0, args_use); \
} \
} \
\
- OLD_DTRACE_PROBE1(name##__return, 0); \
+ APR_HOOK_PROBE_RETURN(ud, ns, name, 0, args_use); \
\
}
@@ -166,24 +226,25 @@ link##_DECLARE(ret) ns##_run_##name args_decl \
ns##_LINK_##name##_t *pHook; \
int n; \
ret rv = ok; \
+ APR_HOOK_INT_DCL_UD; \
\
- OLD_DTRACE_PROBE(name##__entry); \
+ APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \
\
if(_hooks.link_##name) \
{ \
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
{ \
- OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \
+ APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \
rv=pHook[n].pFunc args_use; \
- OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, rv); \
+ APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \
if(rv != ok && rv != decline) \
break; \
rv = ok; \
} \
} \
\
- OLD_DTRACE_PROBE1(name##__return, rv); \
+ APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \
\
return rv; \
}
@@ -210,24 +271,25 @@ link##_DECLARE(ret) ns##_run_##name args_decl \
ns##_LINK_##name##_t *pHook; \
int n; \
ret rv = decline; \
+ APR_HOOK_INT_DCL_UD; \
\
- OLD_DTRACE_PROBE(name##__entry); \
+ APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \
\
if(_hooks.link_##name) \
{ \
pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
{ \
- OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \
+ APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \
rv=pHook[n].pFunc args_use; \
- OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, rv); \
+ APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \
\
if(rv != decline) \
break; \
} \
} \
\
- OLD_DTRACE_PROBE1(name##__return, rv); \
+ APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \
\
return rv; \
}
diff --git a/include/apr_ldap.h.in b/include/apr_ldap.h.in
index 6087783d..e30d3448 100644
--- a/include/apr_ldap.h.in
+++ b/include/apr_ldap.h.in
@@ -192,6 +192,6 @@ typedef struct apr_ldap_err_t {
#include "apr_ldap_option.h"
#include "apr_ldap_rebind.h"
-/** @} */
#endif /* APR_HAS_LDAP */
+/** @} */
#endif /* APU_LDAP_H */
diff --git a/include/apr_memcache.h b/include/apr_memcache.h
index 6efcfc35..82878825 100644
--- a/include/apr_memcache.h
+++ b/include/apr_memcache.h
@@ -120,6 +120,7 @@ typedef struct
/**
* Creates a crc32 hash used to split keys between servers
+ * @param mc The memcache client object to use
* @param data Data to be hashed
* @param data_len Length of the data to use
* @return crc32 hash of data
@@ -150,21 +151,20 @@ APU_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton,
* @return server that controls specified hash
* @see apr_memcache_hash
*/
-APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash(apr_memcache_t *mc,
+APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash(apr_memcache_t *mc,
const apr_uint32_t hash);
/**
* server selection compatible with the standard Perl Client.
*/
-APU_DECLARE(apr_memcache_server_t *)
-apr_memcache_find_server_hash_default(void *baton,
- apr_memcache_t *mc,
- const apr_uint32_t hash);
+APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash_default(void *baton,
+ apr_memcache_t *mc,
+ const apr_uint32_t hash);
/**
* Adds a server to a client object
* @param mc The memcache client object to use
- * @param ms Server to add
+ * @param server Server to add
* @remark Adding servers is not thread safe, and should be done once at startup.
* @warning Changing servers after startup may cause keys to go to
* different servers.
@@ -284,7 +284,7 @@ APU_DECLARE(apr_status_t) apr_memcache_multgetp(apr_memcache_t *mc,
* @param mc client to use
* @param key null terminated string containing the key
* @param baton data to store on the server
- * @param len length of data at baton
+ * @param data_size length of data at baton
* @param timeout time in seconds for the data to live on the server
* @param flags any flags set by the client for this key
*/
@@ -300,7 +300,7 @@ APU_DECLARE(apr_status_t) apr_memcache_set(apr_memcache_t *mc,
* @param mc client to use
* @param key null terminated string containing the key
* @param baton data to store on the server
- * @param len length of data at baton
+ * @param data_size length of data at baton
* @param timeout time for the data to live on the server
* @param flags any flags set by the client for this key
* @return APR_SUCCESS if the key was added, APR_EEXIST if the key
@@ -318,7 +318,7 @@ APU_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc,
* @param mc client to use
* @param key null terminated string containing the key
* @param baton data to store on the server
- * @param len length of data at baton
+ * @param data_size length of data at baton
* @param timeout time for the data to live on the server
* @param flags any flags set by the client for this key
* @return APR_SUCCESS if the key was added, APR_EEXIST if the key
@@ -326,7 +326,7 @@ APU_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc,
*/
APU_DECLARE(apr_status_t) apr_memcache_replace(apr_memcache_t *mc,
const char *key,
- char *data,
+ char *baton,
const apr_size_t data_size,
apr_uint32_t timeout,
apr_uint16_t flags);
@@ -357,7 +357,7 @@ APU_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc,
* @param mc client to use
* @param key null terminated string containing the key
* @param n number to decrement by
- * @param nv new value after decrementing
+ * @param new_value new value after decrementing
*/
APU_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc,
const char *key,
diff --git a/include/apr_reslist.h b/include/apr_reslist.h
index 72349ff0..1e30a538 100644
--- a/include/apr_reslist.h
+++ b/include/apr_reslist.h
@@ -69,11 +69,13 @@ typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params,
* list will be stored.
* @param min Allowed minimum number of available resources. Zero
* creates new resources only when needed.
- * @param smax Resources will be destroyed to meet this maximum
- * restriction as they expire.
+ * @param smax Resources will be destroyed during reslist maintenance to
+ * meet this maximum restriction as they expire (reach their ttl).
* @param hmax Absolute maximum limit on the number of total resources.
- * @param ttl If non-zero, sets the maximum amount of time in microseconds a
- * resource may be available while exceeding the soft limit.
+ * @param ttl If non-zero, sets the maximum amount of time in microseconds an
+ * unused resource is valid. Any resource which has exceeded this
+ * time will be destroyed, either when encountered by
+ * apr_reslist_acquire() or during reslist maintenance.
* @param con Constructor routine that is called to create a new resource.
* @param de Destructor routine that is called to destroy an expired resource.
* @param params Passed to constructor and deconstructor
diff --git a/include/apr_xml.h b/include/apr_xml.h
index 829f0fd2..ac7f003b 100644
--- a/include/apr_xml.h
+++ b/include/apr_xml.h
@@ -304,10 +304,10 @@ APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p,
/**
* quote an XML string
- * Replace '<', '>', and '&' with '&lt;', '&gt;', and '&amp;'.
+ * Replace '\<', '\>', and '\&' with '\&lt;', '\&gt;', and '\&amp;'.
* @param p The pool to allocate out of
* @param s The string to quote
- * @param quotes If quotes is true, then replace '"' with '&quot;'.
+ * @param quotes If quotes is true, then replace '&quot;' with '\&quot;'.
* @return The quoted string
* @note If the string does not contain special characters, it is not
* duplicated into the pool and the original string is returned.
diff --git a/include/apu_version.h b/include/apu_version.h
index fc70b883..6c1760d1 100644
--- a/include/apu_version.h
+++ b/include/apu_version.h
@@ -66,7 +66,7 @@
* "development" copies of APU. It is undefined for released versions
* of APU.
*/
-#define APU_IS_DEV_VERSION
+/* #define APU_IS_DEV_VERSION */
#if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN)
diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h
index de109de5..b571451a 100644
--- a/include/private/apr_crypto_internal.h
+++ b/include/private/apr_crypto_internal.h
@@ -36,24 +36,47 @@ struct apr_crypto_driver_t {
* @brief: allow driver to perform once-only initialisation.
* Called once only.
* @param pool The pool to register the cleanup in.
- * @param params An array of optional init parameters.
+ * @param params Optional init parameter string.
+ * @param rc Driver-specific additional error code
*/
- apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc);
+ apr_status_t (*init)(apr_pool_t *pool, const char *params, int *rc);
/**
* @brief Create a context for supporting encryption. Keys, certificates,
* algorithms and other parameters will be set per context. More than
* one context can be created at one time. A cleanup will be automatically
* registered with the given pool to guarantee a graceful shutdown.
- * @param driver - driver to use
- * @param pool - process pool
- * @param params - array of key parameters
* @param f - context pointer will be written here
+ * @param provider - provider to use
+ * @param params - array of key parameters
+ * @param pool - process pool
* @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE
* if the engine cannot be initialised.
*/
- apr_status_t (*factory)(apr_pool_t *pool, const apr_array_header_t *params,
- apr_crypto_t **f);
+ apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider,
+ const char *params, apr_pool_t *pool);
+
+ /**
+ * @brief Get a hash table of key types, keyed by the name of the type against
+ * an integer pointer constant.
+ *
+ * @param types - hashtable of key types keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
+ */
+ apr_status_t (*get_block_key_types)(apr_hash_t **types,
+ const apr_crypto_t *f);
+
+ /**
+ * @brief Get a hash table of key modes, keyed by the name of the mode against
+ * an integer pointer constant.
+ *
+ * @param modes - hashtable of key modes keyed to constants.
+ * @param f - encryption context
+ * @return APR_SUCCESS for success
+ */
+ apr_status_t (*get_block_key_modes)(apr_hash_t **modes,
+ const apr_crypto_t *f);
/**
* @brief Create a key from the given passphrase. By default, the PBKDF2
@@ -64,9 +87,9 @@ struct apr_crypto_driver_t {
* operations.
* @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If
* *key is not NULL, *key must point at a previously created structure.
- * @param driver - driver to use
- * @param p The pool to use.
- * @param f The context to use.
+ * @param key The key returned, see note.
+ * @param ivSize The size of the initialisation vector will be returned, based
+ * on whether an IV is relevant for this type of crypto.
* @param pass The passphrase to use.
* @param passLen The passphrase length in bytes
* @param salt The salt to use.
@@ -74,43 +97,40 @@ struct apr_crypto_driver_t {
* @param type 3DES_192, AES_128, AES_192, AES_256.
* @param mode Electronic Code Book / Cipher Block Chaining.
* @param doPad Pad if necessary.
- * @param key The key returned, see note.
- * @param ivSize The size of the initialisation vector will be returned, based
- * on whether an IV is relevant for this type of crypto.
+ * @param iterations Iteration count
+ * @param f The context to use.
+ * @param p The pool to use.
* @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend
* error occurred while generating the key. APR_ENOCIPHER if the type or mode
* is not supported by the particular backend. APR_EKEYTYPE if the key type is
* not known. APR_EPADDING if padding was requested but is not supported.
* APR_ENOTIMPL if not implemented.
*/
- apr_status_t (*passphrase)(apr_pool_t *p, const apr_crypto_t *f,
+ apr_status_t (*passphrase)(apr_crypto_key_t **key, apr_size_t *ivSize,
const char *pass, apr_size_t passLen, const unsigned char * salt,
apr_size_t saltLen, const apr_crypto_block_key_type_e type,
const apr_crypto_block_key_mode_e mode, const int doPad,
- const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize);
+ const int iterations, const apr_crypto_t *f, apr_pool_t *p);
/**
* @brief Initialise a context for encrypting arbitrary data using the given key.
* @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
* *ctx is not NULL, *ctx must point at a previously created structure.
- * @param p The pool to use.
- * @param f The block factory to use.
- * @param key The key structure.
+ * @param ctx The block context returned, see note.
* @param iv Optional initialisation vector. If the buffer pointed to is NULL,
* an IV will be created at random, in space allocated from the pool.
* If the buffer pointed to is not NULL, the IV in the buffer will be
* used.
- * @param ctx The block context returned, see note.
- * @param ivSize The size of the initialisation vector will be returned, based
- * on whether an IV is relevant for this type of crypto.
+ * @param key The key structure.
* @param blockSize The block size of the cipher.
+ * @param p The pool to use.
* @return Returns APR_ENOIV if an initialisation vector is required but not specified.
* Returns APR_EINIT if the backend failed to initialise the context. Returns
* APR_ENOTIMPL if not implemented.
*/
- apr_status_t (*block_encrypt_init)(apr_pool_t *p, const apr_crypto_t *f,
- const apr_crypto_key_t *key, const unsigned char **iv,
- apr_crypto_block_t **ctx, apr_size_t *blockSize);
+ apr_status_t (*block_encrypt_init)(apr_crypto_block_t **ctx,
+ const unsigned char **iv, const apr_crypto_key_t *key,
+ apr_size_t *blockSize, apr_pool_t *p);
/**
* @brief Encrypt data provided by in, write it to out.
@@ -121,17 +141,17 @@ struct apr_crypto_driver_t {
* to NULL, a buffer sufficiently large will be created from
* the pool provided. If *out points to a not-NULL value, this
* value will be used as a buffer instead.
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written,
* see note.
* @param outlen Length of the output will be written here.
* @param in Address of the buffer to read.
* @param inlen Length of the buffer to read.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
* not implemented.
*/
- apr_status_t (*block_encrypt)(apr_crypto_block_t *ctx, unsigned char **out,
- apr_size_t *outlen, const unsigned char *in, apr_size_t inlen);
+ apr_status_t (*block_encrypt)(unsigned char **out, apr_size_t *outlen,
+ const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
/**
* @brief Encrypt final data block, write it to out.
@@ -141,38 +161,37 @@ struct apr_crypto_driver_t {
* number of bytes returned as actually written by the
* apr_crypto_block_encrypt() call. After this call, the context
* is cleaned and can be reused by apr_crypto_block_encrypt_init().
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written. This
* buffer must already exist, and is usually the same
* buffer used by apr_evp_crypt(). See note.
* @param outlen Length of the output will be written here.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred.
* @return APR_EPADDING if padding was enabled and the block was incorrectly
* formatted.
* @return APR_ENOTIMPL if not implemented.
*/
- apr_status_t (*block_encrypt_finish)(apr_crypto_block_t *ctx,
- unsigned char *out, apr_size_t *outlen);
+ apr_status_t (*block_encrypt_finish)(unsigned char *out,
+ apr_size_t *outlen, apr_crypto_block_t *ctx);
/**
* @brief Initialise a context for decrypting arbitrary data using the given key.
* @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
* *ctx is not NULL, *ctx must point at a previously created structure.
- * @param p The pool to use.
- * @param f The block factory to use.
- * @param key The key structure.
+ * @param ctx The block context returned, see note.
+ * @param blockSize The block size of the cipher.
* @param iv Optional initialisation vector. If the buffer pointed to is NULL,
* an IV will be created at random, in space allocated from the pool.
* If the buffer is not NULL, the IV in the buffer will be used.
- * @param ctx The block context returned, see note.
- * @param blockSize The block size of the cipher.
+ * @param key The key structure.
+ * @param p The pool to use.
* @return Returns APR_ENOIV if an initialisation vector is required but not specified.
* Returns APR_EINIT if the backend failed to initialise the context. Returns
* APR_ENOTIMPL if not implemented.
*/
- apr_status_t (*block_decrypt_init)(apr_pool_t *p, const apr_crypto_t *f,
- const apr_crypto_key_t *key, const unsigned char *iv,
- apr_crypto_block_t **ctx, apr_size_t *blockSize);
+ apr_status_t (*block_decrypt_init)(apr_crypto_block_t **ctx,
+ apr_size_t *blockSize, const unsigned char *iv,
+ const apr_crypto_key_t *key, apr_pool_t *p);
/**
* @brief Decrypt data provided by in, write it to out.
@@ -183,17 +202,17 @@ struct apr_crypto_driver_t {
* to NULL, a buffer sufficiently large will be created from
* the pool provided. If *out points to a not-NULL value, this
* value will be used as a buffer instead.
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written,
* see note.
* @param outlen Length of the output will be written here.
* @param in Address of the buffer to read.
* @param inlen Length of the buffer to read.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
* not implemented.
*/
- apr_status_t (*block_decrypt)(apr_crypto_block_t *ctx, unsigned char **out,
- apr_size_t *outlen, const unsigned char *in, apr_size_t inlen);
+ apr_status_t (*block_decrypt)(unsigned char **out, apr_size_t *outlen,
+ const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
/**
* @brief Decrypt final data block, write it to out.
@@ -203,44 +222,49 @@ struct apr_crypto_driver_t {
* number of bytes returned as actually written by the
* apr_crypto_block_decrypt() call. After this call, the context
* is cleaned and can be reused by apr_crypto_block_decrypt_init().
- * @param ctx The block context to use.
* @param out Address of a buffer to which data will be written. This
* buffer must already exist, and is usually the same
* buffer used by apr_evp_crypt(). See note.
* @param outlen Length of the output will be written here.
+ * @param ctx The block context to use.
* @return APR_ECRYPT if an error occurred.
* @return APR_EPADDING if padding was enabled and the block was incorrectly
* formatted.
* @return APR_ENOTIMPL if not implemented.
*/
- apr_status_t (*block_decrypt_finish)(apr_crypto_block_t *ctx,
- unsigned char *out, apr_size_t *outlen);
+ apr_status_t (*block_decrypt_finish)(unsigned char *out,
+ apr_size_t *outlen, apr_crypto_block_t *ctx);
/**
* @brief Clean encryption / decryption context.
* @note After cleanup, a context is free to be reused if necessary.
- * @param driver - driver to use
* @param ctx The block context to use.
* @return Returns APR_ENOTIMPL if not supported.
*/
apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx);
/**
- * @brief Clean encryption / decryption factory.
- * @note After cleanup, a factory is free to be reused if necessary.
- * @param driver - driver to use
- * @param f The factory to use.
+ * @brief Clean encryption / decryption context.
+ * @note After cleanup, a context is free to be reused if necessary.
+ * @param f The context to use.
* @return Returns APR_ENOTIMPL if not supported.
*/
apr_status_t (*cleanup)(apr_crypto_t *f);
/**
- * @brief Clean encryption / decryption factory.
- * @note After cleanup, a factory is free to be reused if necessary.
- * @param pool The pool to use.
+ * @brief Clean encryption / decryption context.
+ * @note After cleanup, a context is free to be reused if necessary.
* @return Returns APR_ENOTIMPL if not supported.
*/
- apr_status_t (*shutdown)(apr_pool_t *p);
+ apr_status_t (*shutdown)(void);
+
+ /**
+ * @brief: fetch the most recent error from this driver.
+ * @param result - the result structure
+ * @param f - context pointer
+ * @return APR_SUCCESS for success.
+ */
+ apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f);
};
diff --git a/include/private/apr_dbd_odbc_v2.h b/include/private/apr_dbd_odbc_v2.h
index dc7bc9c9..b8da7b18 100644
--- a/include/private/apr_dbd_odbc_v2.h
+++ b/include/private/apr_dbd_odbc_v2.h
@@ -17,13 +17,13 @@
/* ONLY USED FOR ODBC Version 2 -DODBCV2
*
-* Re-define everything to work (more-or-less) in an ODBC V2 environment
+* Re-define everything to work (more-or-less) in an ODBC V2 environment
* Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select() cannot
* have a 'random' argument of 1. apr_dbd_get_row() must always pass rownum as 0 (get next row)
*
*/
-#define SQLHANDLE SQLHENV // Presumes that ENV, DBC, and STMT handles are all the same datatype
+#define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */
#define SQL_NULL_HANDLE 0
#define SQL_HANDLE_STMT 1
#define SQL_HANDLE_DBC 2
@@ -87,32 +87,32 @@
#undef SQLColAttribute
#define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n)
-#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
-#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
-#define SQL_ATTR_CONNECTION_TIMEOUT 113
-#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
-#define SQL_ATTR_DISCONNECT_BEHAVIOR 114
-#define SQL_ATTR_ENLIST_IN_DTC 1207
-#define SQL_ATTR_ENLIST_IN_XA 1208
-
-#define SQL_ATTR_CONNECTION_DEAD 1209
-#define SQL_CD_TRUE 1L /* Connection is closed/dead */
-#define SQL_CD_FALSE 0L /* Connection is open/available */
-
-#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
-#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
-#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
-#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
-#define SQL_ATTR_TRACE SQL_OPT_TRACE
-#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
-#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
-#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
-#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
+#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
+#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
+#define SQL_ATTR_CONNECTION_TIMEOUT 113
+#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
+#define SQL_ATTR_DISCONNECT_BEHAVIOR 114
+#define SQL_ATTR_ENLIST_IN_DTC 1207
+#define SQL_ATTR_ENLIST_IN_XA 1208
+
+#define SQL_ATTR_CONNECTION_DEAD 1209
+#define SQL_CD_TRUE 1L /* Connection is closed/dead */
+#define SQL_CD_FALSE 0L /* Connection is open/available */
+
+#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
+#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
+#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
+#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
+#define SQL_ATTR_TRACE SQL_OPT_TRACE
+#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
+#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
+#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
+#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
#define SQL_ATTR_CURSOR_SCROLLABLE -1
-#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
-#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
+#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
+#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
#define SQL_FALSE 0
#define SQL_TRUE 1