]> granicus.if.org Git - apache/blob - modules/filters/mod_crypto.h
A little odd having that warning buried under the machine-readable
[apache] / modules / filters / mod_crypto.h
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 _MOD_CRYPTO_H_
18 #define _MOD_CRYPTO_H_
19
20 /* Create a set of CRYPTO_DECLARE(type), CRYPTO_DECLARE_NONSTD(type) and
21  * CRYPTO_DECLARE_DATA with appropriate export and import tags for the platform
22  */
23 #if !defined(WIN32)
24 #define CRYPTO_DECLARE(type)        type
25 #define CRYPTO_DECLARE_NONSTD(type) type
26 #define CRYPTO_DECLARE_DATA
27 #elif defined(CRYPTO_DECLARE_STATIC)
28 #define CRYPTO_DECLARE(type)        type __stdcall
29 #define CRYPTO_DECLARE_NONSTD(type) type
30 #define CRYPTO_DECLARE_DATA
31 #elif defined(CRYPTO_DECLARE_EXPORT)
32 #define CRYPTO_DECLARE(type)        __declspec(dllexport) type __stdcall
33 #define CRYPTO_DECLARE_NONSTD(type) __declspec(dllexport) type
34 #define CRYPTO_DECLARE_DATA         __declspec(dllexport)
35 #else
36 #define CRYPTO_DECLARE(type)        __declspec(dllimport) type __stdcall
37 #define CRYPTO_DECLARE_NONSTD(type) __declspec(dllimport) type
38 #define CRYPTO_DECLARE_DATA         __declspec(dllimport)
39 #endif
40
41 /**
42  * @file  mod_crypto.h
43  * @brief Crypto Module for Apache
44  *
45  * @defgroup MOD_CRYPTO mod_crypto
46  * @ingroup  APACHE_MODS
47  * @{
48  */
49
50 #include "apr.h"
51 #include "apr_hooks.h"
52 #include "apr_optional.h"
53 #include "apr_tables.h"
54 #include "apr_uuid.h"
55 #include "apr_pools.h"
56 #include "apr_time.h"
57 #include "apr_crypto.h"
58
59 #include "httpd.h"
60 #include "http_config.h"
61 #include "ap_config.h"
62
63 /**
64  * Hook to provide a key.
65  *
66  * @param r The request
67  * @param cipher The cipher to use with this key
68  * @param rec Pointer to the key record from which to derive the key
69  */
70 APR_DECLARE_EXTERNAL_HOOK(ap, CRYPTO, apr_status_t, crypto_key,
71                           (request_rec *r,
72                            apr_crypto_block_key_type_t * cipher,
73                            apr_crypto_block_key_mode_t * mode, int pad,
74                            const apr_crypto_key_rec_t ** rec));
75
76 /**
77  * Hook to provide an initialization vector (IV).
78  *
79  * @param r The request
80  * @param size The block size of the expected IV.
81  * @param iv A pointer to where the iv will be returned
82  */
83 APR_DECLARE_EXTERNAL_HOOK(ap, CRYPTO, apr_status_t, crypto_iv,
84                           (request_rec *r,
85                            apr_crypto_block_key_type_t * cipher,
86                            const unsigned char **iv));
87
88 /**
89  * The name of the module.
90  */
91 extern module AP_MODULE_DECLARE_DATA crypto_module;
92
93 /** @} */
94
95 #endif