41 #if APU_HAVE_CRYPTO || defined(DOXYGEN)
43 #ifndef APU_CRYPTO_RECOMMENDED_DRIVER
44 #if APU_HAVE_COMMONCRYPTO
46 #define APU_CRYPTO_RECOMMENDED_DRIVER "commoncrypto"
50 #define APU_CRYPTO_RECOMMENDED_DRIVER "openssl"
54 #define APU_CRYPTO_RECOMMENDED_DRIVER "nss"
58 #define APU_CRYPTO_RECOMMENDED_DRIVER "mscng"
62 #define APU_CRYPTO_RECOMMENDED_DRIVER "mscapi"
364 const unsigned char *
v;
518 const
char **version);
577 const
char *name, const
char *params, const
apu_err_t **result,
729 const
unsigned char * salt,
apr_size_t saltLen,
985 #if APU_HAVE_CRYPTO_PRNG
1007 #define APR_CRYPTO_PRNG_SEED_SIZE 32
1009 #define APR_CRYPTO_PRNG_LOCKED (0x1)
1010 #define APR_CRYPTO_PRNG_PER_THREAD (0x2)
1011 #define APR_CRYPTO_PRNG_MASK (0x3)
1014 typedef struct apr_crypto_prng_t apr_crypto_prng_t;
1090 int flags, const
unsigned char seed[],
apr_pool_t *pool);
1117 const
unsigned char seed[]);
1120 #define APR_CRYPTO_FORK_INPARENT 0
1121 #define APR_CRYPTO_FORK_INCHILD 1
apr_crypto_cipher_e
Definition: apr_crypto.h:164
int pad
Definition: apr_crypto.h:450
struct apr_crypto_block_key_digest_t apr_crypto_block_key_digest_t
Definition: apr_crypto.h:218
struct apr_crypto_block_key_mode_t apr_crypto_block_key_mode_t
Definition: apr_crypto.h:425
Definition: apr_crypto.h:140
apr_crypto_block_key_digest_e type
Definition: apr_crypto.h:154
apr_crypto_digest_type_e dtype
Definition: apr_crypto.h:499
apr_size_t saltLen
Definition: apr_crypto.h:254
Definition: apr_crypto.h:343
apr_crypto_digest_sign_t sign
Definition: apr_crypto.h:503
const unsigned char * secret
Definition: apr_crypto.h:315
Definition: apr_crypto.h:442
struct apr_crypto_key_t apr_crypto_key_t
Definition: apr_crypto.h:197
apr_crypto_block_key_type_e type
Definition: apr_crypto.h:446
apr_status_t apr_crypto_digest(const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, const unsigned char *in, apr_size_t inlen, apr_pool_t *p)
One shot digest on a single memory buffer.
Definition: apr_crypto.h:232
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_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 a pointer to apr_crypto_block_ke...
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:555
struct apr_crypto_t apr_crypto_t
Definition: apr_crypto.h:183
apr_size_t secretLen
Definition: apr_crypto.h:275
apr_status_t apr_crypto_key(apr_crypto_key_t **key, const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p)
Create a key from the provided secret or passphrase. The key is cleaned up when the context is cleane...
apr_size_t vlen
Definition: apr_crypto.h:366
Definition: apr_crypto.h:328
apr_crypto_block_key_type_e type
Definition: apr_crypto.h:220
Definition: apr_crypto.h:418
Definition: apr_crypto.h:118
apr_status_t apr_crypto_clear(apr_pool_t *pool, void *buffer, apr_size_t size)
Zero out the buffer provided when the pool is cleaned up.
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.
struct apr_crypto_digest_t apr_crypto_digest_t
Definition: apr_crypto.h:213
apr_crypto_key_type
Definition: apr_crypto.h:375
Definition: apr_crypto.h:144
apr_crypto_digest_verify_t verify
Definition: apr_crypto.h:504
Definition: apr_crypto.h:405
int blocksize
Definition: apr_crypto.h:224
Definition: apr_crypto.h:152
apr_crypto_block_key_digest_e digest
Definition: apr_crypto.h:334
Definition: apr_crypto.h:130
Definition: apr_crypto.h:269
Definition: apr_crypto.h:131
apr_crypto_block_key_mode_e
Definition: apr_crypto.h:127
Definition: apr_crypto.h:129
dav_buffer apr_size_t size
Definition: mod_dav.h:460
struct apr_crypto_key_rec_t apr_crypto_key_rec_t
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_size_t slen
Definition: apr_crypto.h:347
Definition: apr_crypto.h:145
Definition: apr_crypto.h:497
int iterations
Definition: apr_crypto.h:256
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.
Definition: apr_crypto.h:246
Definition: apr_crypto.h:142
struct apr_crypto_driver_t apr_crypto_driver_t
Definition: apr_crypto.h:176
Definition: apr_crypto.h:141
Definition: apr_crypto.h:167
Definition: apr_crypto.h:168
const unsigned char * salt
Definition: apr_crypto.h:252
apr_crypto_key_hash_t hash
Definition: apr_crypto.h:472
apr_size_t secretLen
Definition: apr_crypto.h:301
apr_crypto_secret_t secret
Definition: apr_crypto.h:466
apr_crypto_digest_rec_t * apr_crypto_digest_rec_make(apr_crypto_digest_type_e dtype, apr_pool_t *p)
Create a digest record to be passed to apr_crypto_digest_init().
apr_size_t slen
Definition: apr_crypto.h:332
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 a pointer to apr_crypto_block_ke...
int apr_crypto_lib_is_active(const char *name)
int digestsize
Definition: apr_crypto.h:156
struct apr_crypto_key_cmac_t apr_crypto_key_cmac_t
apr_crypto_digest_type_e
Definition: apr_crypto.h:412
struct apr_crypto_secret_t apr_crypto_secret_t
apr_crypto_key_type ktype
Definition: apr_crypto.h:444
Definition: apr_crypto.h:399
Definition: apr_crypto.h:117
Definition: apr_crypto.h:117
struct apr_crypto_digest_rec_t apr_crypto_digest_rec_t
unsigned char * s
Definition: apr_crypto.h:330
apr_crypto_block_key_type_e
Definition: apr_crypto.h:115
Definition: apr_crypto.h:381
struct apr_crypto_block_t apr_crypto_block_t
Definition: apr_crypto.h:206
apr_size_t secretLen
Definition: apr_crypto.h:317
unsigned char * s
Definition: apr_crypto.h:360
apr_status_t apr_crypto_init(apr_pool_t *pool)
Perform once-only initialisation. Call once only.
apr_crypto_block_key_digest_e digest
Definition: apr_crypto.h:319
struct apr_crypto_block_key_type_t apr_crypto_block_key_type_t
struct apr_hash_t apr_hash_t
Definition: apr_hash.h:52
const unsigned char * v
Definition: apr_crypto.h:364
const char * pass
Definition: apr_crypto.h:248
Definition: apr_crypto.h:166
apr_crypto_digest_hash_t hash
Definition: apr_crypto.h:502
unsigned char * s
Definition: apr_crypto.h:345
const unsigned char * secret
Definition: apr_crypto.h:299
union apr_crypto_digest_rec_t::@17 d
apr_status_t apr_crypto_memzero(void *buffer, apr_size_t size)
Always zero out the buffer provided, without being optimized out by the compiler. ...
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 ...
APR Thread and Process Library.
struct apr_crypto_key_hash_t apr_crypto_key_hash_t
apr_status_t apr_crypto_cleanup(apr_crypto_t *f)
Clean encryption / decryption context.
Definition: apr_crypto.h:120
apr_size_t passLen
Definition: apr_crypto.h:250
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...
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 ...
Definition: apr_crypto.h:432
struct apr_crypto_digest_sign_t apr_crypto_digest_sign_t
apr_crypto_block_key_digest_e digest
Definition: apr_crypto.h:368
apr_status_t apr_crypto_lib_term(const char *name)
union apr_crypto_key_rec_t::@16 k
Definition: apr_crypto.h:393
apr_crypto_passphrase_t passphrase
Definition: apr_crypto.h:459
Definition: apr_crypto.h:313
#define APR_DECLARE(x)
Definition: macros.h:6
struct apr_crypto_digest_verify_t apr_crypto_digest_verify_t
const char * apr_crypto_driver_name(const apr_crypto_driver_t *driver)
Return the name of the driver.
apr_crypto_block_key_digest_e
Definition: apr_crypto.h:138
apr_status_t apr_crypto_digest_cleanup(apr_crypto_digest_t *ctx)
Clean digest context.
struct apr_crypto_key_hmac_t apr_crypto_key_hmac_t
apr_crypto_block_key_digest_e digest
Definition: apr_crypto.h:303
apr_crypto_block_key_digest_e digest
Definition: apr_crypto.h:349
apr_status_t apr_crypto_digest_final(apr_crypto_digest_t *digest)
Finalise the digest and write the result.
apr_status_t apr_crypto_lib_version(const char *name, const char **version)
const char * name
Definition: mod_dav.h:805
Definition: apu_errno.h:169
apr_status_t apr_crypto_digest_init(apr_crypto_digest_t **d, const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p)
Initialise a context for hashing, signing or verifying arbitrary data.
apr_status_t apr_crypto_block_cleanup(apr_crypto_block_t *ctx)
Clean encryption / decryption context.
struct apr_crypto_digest_hash_t apr_crypto_digest_hash_t
int ivsize
Definition: apr_crypto.h:226
apr_crypto_key_cmac_t cmac
Definition: apr_crypto.h:484
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int blocksize
Definition: apr_crypto.h:158
Definition: apr_crypto.h:387
apr_crypto_key_hmac_t hmac
Definition: apr_crypto.h:478
int apr_crypto_equals(const void *buf1, const void *buf2, apr_size_t size)
Timing attacks safe buffers comparison, where the executing time does not depend on the bytes compare...
int apr_status_t
Definition: apr_errno.h:44
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_digest_e digest
Definition: apr_crypto.h:287
apr_status_t apr_crypto_digest_update(apr_crypto_digest_t *digest, const unsigned char *in, apr_size_t inlen)
Update the digest with data provided by in.
apr_status_t apr_crypto_shutdown(const apr_crypto_driver_t *driver)
Shutdown the crypto library.
Definition: apr_crypto.h:358
apr_crypto_block_key_mode_e mode
Definition: apr_crypto.h:448
struct apr_crypto_config_t apr_crypto_config_t
Definition: apr_crypto.h:189
apr_crypto_key_rec_t * apr_crypto_key_rec_make(apr_crypto_key_type ktype, apr_pool_t *p)
Create a key record to be passed to apr_crypto_key().
Definition: apr_crypto.h:119
apr_crypto_block_key_mode_e mode
Definition: apr_crypto.h:234
apr_status_t apr_crypto_lib_init(const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool)
Definition: apr_crypto.h:285
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1452
Definition: apr_crypto.h:297
const unsigned char * secret
Definition: apr_crypto.h:273
Definition: apr_crypto.h:143
Definition: apr_crypto.h:146
apr_size_t slen
Definition: apr_crypto.h:362
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_block_decrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx)
Decrypt final data block, write it to out.
int keysize
Definition: apr_crypto.h:222
struct apr_crypto_passphrase_t apr_crypto_passphrase_t
apr_status_t apr_crypto_get_block_key_digests(apr_hash_t **digests, const apr_crypto_t *f)
Get a hash table of key digests, keyed by the name of the digest against a pointer to apr_crypto_bloc...