21 #include "apr_pools.h" 22 #include "apr_tables.h" 42 #ifndef APU_CRYPTO_RECOMMENDED_DRIVER 44 #define APU_CRYPTO_RECOMMENDED_DRIVER "openssl" 47 #define APU_CRYPTO_RECOMMENDED_DRIVER "nss" 50 #define APU_CRYPTO_RECOMMENDED_DRIVER "mscng" 53 #define APU_CRYPTO_RECOMMENDED_DRIVER "mscapi" 104 APR_KEY_NONE, APR_KEY_3DES_192,
120 typedef struct apr_crypto_driver_t apr_crypto_driver_t;
121 typedef struct apr_crypto_t apr_crypto_t;
122 typedef struct apr_crypto_config_t apr_crypto_config_t;
123 typedef struct apr_crypto_key_t apr_crypto_key_t;
124 typedef struct apr_crypto_block_t apr_crypto_block_t;
164 const apr_crypto_driver_t **driver,
165 const char *name,
const char *params,
const apu_err_t **result,
175 const apr_crypto_driver_t *driver);
185 const apr_crypto_t *f);
203 const apr_crypto_driver_t *driver,
const char *params,
215 const apr_crypto_t *f);
226 const apr_crypto_t *f);
257 apr_size_t *ivSize,
const char *pass, apr_size_t passLen,
258 const unsigned char * salt, apr_size_t saltLen,
259 const apr_crypto_block_key_type_e type,
260 const apr_crypto_block_key_mode_e mode,
const int doPad,
261 const int iterations,
const apr_crypto_t *f, apr_pool_t *p);
280 apr_crypto_block_t **ctx,
const unsigned char **iv,
281 const apr_crypto_key_t *key, apr_size_t *blockSize, apr_pool_t *p);
302 apr_size_t *outlen,
const unsigned char *in, apr_size_t inlen,
303 apr_crypto_block_t *ctx);
324 apr_size_t *outlen, apr_crypto_block_t *ctx);
340 apr_crypto_block_t **ctx, apr_size_t *blockSize,
341 const unsigned char *iv,
const apr_crypto_key_t *key, apr_pool_t *p);
362 apr_size_t *outlen,
const unsigned char *in, apr_size_t inlen,
363 apr_crypto_block_t *ctx);
384 apr_size_t *outlen, apr_crypto_block_t *ctx);
409 const apr_crypto_driver_t *driver);
apr_status_t apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, const char *params, apr_pool_t *pool)
Create a context for supporting encryption. Keys, certificates, algorithms and other parameters will ...
Definition: apr_crypto.h:107
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)
Decrypt data provided by in, write it to out.
apr_crypto_block_key_type_e
Definition: apr_crypto.h:102
apr_status_t apr_crypto_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)
Initialise a context for decrypting arbitrary data using the given key.
apr_status_t apr_crypto_cleanup(apr_crypto_t *f)
Clean encryption / decryption context.
apr_status_t apr_crypto_block_decrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx)
Decrypt final data block, write it to out.
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)
Get the driver struct for a name.
apr_status_t apr_crypto_get_block_key_modes(apr_hash_t **modes, const apr_crypto_t *f)
Get a hash table of key modes, keyed by the name of the mode against an integer pointer constant...
apr_status_t apr_crypto_error(const apu_err_t **result, const apr_crypto_t *f)
Get the result of the last operation on a context. If the result is NULL, the operation was successfu...
Definition: apr_crypto.h:115
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, const apr_crypto_t *f, apr_pool_t *p)
Create a key from the given passphrase. By default, the PBKDF2 algorithm is used to generate the key ...
const char * apr_crypto_driver_name(const apr_crypto_driver_t *driver)
Return the name of the driver.
Definition: apr_crypto.h:105
Definition: apr_crypto.h:114
Definition: apr_crypto.h:106
apr_status_t apr_crypto_clear(apr_pool_t *pool, void *buffer, apr_size_t size)
Register a cleanup to zero out the buffer provided when the pool is cleaned up.
Definition: apu_errno.h:161
apr_status_t apr_crypto_shutdown(const apr_crypto_driver_t *driver)
Shutdown the crypto library.
apr_status_t apr_crypto_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)
Initialise a context for encrypting arbitrary data using the given key.
apr_status_t apr_crypto_block_cleanup(apr_crypto_block_t *ctx)
Clean encryption / decryption context.
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)
Encrypt data provided by in, write it to out.
apr_status_t apr_crypto_get_block_key_types(apr_hash_t **types, const apr_crypto_t *f)
Get a hash table of key types, keyed by the name of the type against an integer pointer constant...
apr_crypto_block_key_mode_e
Definition: apr_crypto.h:111
apr_status_t apr_crypto_init(apr_pool_t *pool)
Perform once-only initialisation. Call once only.
apr_status_t apr_crypto_block_encrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx)
Encrypt final data block, write it to out.