]> granicus.if.org Git - apache/blob - modules/ssl/ssl_util_ssl.h
mod_cache: Don't add cached/revalidated entity headers to a 304 response.
[apache] / modules / ssl / ssl_util_ssl.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 /**
18  * @verbatim
19                         _             _
20     _ __ ___   ___   __| |    ___ ___| |  mod_ssl
21    | '_ ` _ \ / _ \ / _` |   / __/ __| |  Apache Interface to OpenSSL
22    | | | | | | (_) | (_| |   \__ \__ \ |
23    |_| |_| |_|\___/ \__,_|___|___/___/_|
24                         |_____|
25    @endverbatim
26  * @file  ssl_util_ssl.h
27  * @brief Additional Utility Functions for OpenSSL
28  *
29  * @defgroup MOD_SSL_UTIL Utilities
30  * @ingroup MOD_SSL
31  * @{
32  */
33
34 #ifndef __SSL_UTIL_SSL_H__
35 #define __SSL_UTIL_SSL_H__
36
37 /**
38  * SSL library version number
39  */
40
41 #define SSL_LIBRARY_VERSION OPENSSL_VERSION_NUMBER
42 #define SSL_LIBRARY_NAME    "OpenSSL"
43 #define SSL_LIBRARY_TEXT    OPENSSL_VERSION_TEXT
44 #define SSL_LIBRARY_DYNTEXT SSLeay_version(SSLEAY_VERSION)
45
46 /**
47  *  Maximum length of a DER encoded session.
48  *  FIXME: There is no define in OpenSSL, but OpenSSL uses 1024*10,
49  *         so this value should be ok. Although we have no warm feeling.
50  */
51 #define SSL_SESSION_MAX_DER 1024*10
52
53 /** max length for SSL_SESSION_id2sz */
54 #define SSL_SESSION_ID_STRING_LEN \
55     ((SSL_MAX_SSL_SESSION_ID_LENGTH + 1) * 2)
56
57 /**
58  *  Additional Functions
59  */
60 void        SSL_init_app_data2_idx(void);
61 void       *SSL_get_app_data2(SSL *);
62 void        SSL_set_app_data2(SSL *, void *);
63 EVP_PKEY   *SSL_read_PrivateKey(const char *, EVP_PKEY **, pem_password_cb *, void *);
64 int         SSL_smart_shutdown(SSL *ssl);
65 BOOL        SSL_X509_getBC(X509 *, int *, int *);
66 char       *SSL_X509_NAME_ENTRY_to_string(apr_pool_t *p, X509_NAME_ENTRY *xsne);
67 char       *SSL_X509_NAME_to_string(apr_pool_t *, X509_NAME *, int);
68 BOOL        SSL_X509_getIDs(apr_pool_t *, X509 *, apr_array_header_t **);
69 BOOL        SSL_X509_match_name(apr_pool_t *, X509 *, const char *, BOOL, server_rec *);
70 BOOL        SSL_X509_INFO_load_file(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);
71 BOOL        SSL_X509_INFO_load_path(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);
72 int         SSL_CTX_use_certificate_chain(SSL_CTX *, char *, int, pem_password_cb *);
73 char       *SSL_SESSION_id2sz(unsigned char *, int, char *, int);
74
75 #endif /* __SSL_UTIL_SSL_H__ */
76 /** @} */
77