Apache HTTPD
apr_crypto.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef APR_CRYPTO_H
18#define APR_CRYPTO_H
19
20#include "apu.h"
21#include "apr_pools.h"
22#include "apr_tables.h"
23#include "apr_hash.h"
24#include "apu_errno.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
40#if APU_HAVE_CRYPTO
41
42#ifndef APU_CRYPTO_RECOMMENDED_DRIVER
43#if APU_HAVE_COMMONCRYPTO
44#define APU_CRYPTO_RECOMMENDED_DRIVER "commoncrypto"
45#else
46#if APU_HAVE_OPENSSL
47#define APU_CRYPTO_RECOMMENDED_DRIVER "openssl"
48#else
49#if APU_HAVE_NSS
50#define APU_CRYPTO_RECOMMENDED_DRIVER "nss"
51#else
52#if APU_HAVE_MSCNG
53#define APU_CRYPTO_RECOMMENDED_DRIVER "mscng"
54#else
55#if APU_HAVE_MSCAPI
56#define APU_CRYPTO_RECOMMENDED_DRIVER "mscapi"
57#else
58#endif
59#endif
60#endif
61#endif
62#endif
63#endif
64
106typedef enum
107{
114
115typedef enum
116{
122
123/* These are opaque structs. Instantiation is up to each backend */
125typedef struct apr_crypto_t apr_crypto_t;
129
130typedef struct apr_crypto_block_key_type_t {
132 int keysize;
133 int blocksize;
134 int ivsize;
136
137typedef struct apr_crypto_block_key_mode_t {
140
141typedef struct apr_crypto_passphrase_t {
142 const char *pass;
144 const unsigned char * salt;
146 int iterations;
148
149typedef struct apr_crypto_secret_t {
150 const unsigned char *secret;
153
154typedef enum {
160
161typedef struct apr_crypto_key_rec_t {
165 int pad;
166 union {
169 } k;
171
179
189
198
208APU_DECLARE(int) apr_crypto_equals(const void *buf1, const void *buf2,
210
231 const char *name, const char *params, const apu_err_t **result,
233
242
251 const apr_crypto_t *f);
252
269 const apr_crypto_driver_t *driver, const char *params,
271
282 const apr_crypto_t *f);
283
294 const apr_crypto_t *f);
295
314
345 apr_size_t *ivSize, const char *pass, apr_size_t passLen,
346 const unsigned char * salt, apr_size_t saltLen,
348 const apr_crypto_block_key_mode_e mode, const int doPad,
349 const int iterations, const apr_crypto_t *f, apr_pool_t *p);
350
368 apr_crypto_block_t **ctx, const unsigned char **iv,
370
390 apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
392
413
429 const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p);
430
450 apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
452
473
481
489
498
499#endif /* APU_HAVE_CRYPTO */
500
503#ifdef __cplusplus
504}
505#endif
506
507#endif
APR Hash Tables.
APR memory allocation.
APU_DECLARE(void)
Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
Definition apr_sha1.c:206
APR Table library.
APR-Util Error Codes.
const char * salt
Definition apr_md5.h:139
apr_file_t * f
apr_brigade_flush void * ctx
const char const apr_dbd_driver_t ** driver
Definition apr_dbd.h:106
apr_dbd_transaction_t int mode
Definition apr_dbd.h:261
apr_pool_t const char * params
Definition apr_dbd.h:141
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
const char * key
int type
char * buffer
apr_array_header_t ** result
void * rec
Definition apr_hash.h:270
apr_int32_t in
apr_pool_t * p
Definition md_event.c:32
static unsigned char * secret
static apr_file_t * out
Definition mod_info.c:85
static const char *const types[]
char * name