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
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
20
_ __ ___ ___ __| | ___ ___| | mod_ssl
21
| '_ ` _ \ / _ \ / _` | / __/ __| | Apache Interface to OpenSSL
22
| | | | | | (_) | (_| | \__ \__ \ |
23
|_| |_| |_|\___/ \__,_|___|___/___/_|
26
* @file ssl_util_ssl.h
27
* @brief Additional Utility Functions for OpenSSL
29
* @defgroup MOD_SSL_UTIL Utilities
34
#ifndef __SSL_UTIL_SSL_H__
35
#define __SSL_UTIL_SSL_H__
38
* Determine SSL library version number
40
#ifdef OPENSSL_VERSION_NUMBER
41
#define SSL_LIBRARY_VERSION OPENSSL_VERSION_NUMBER
42
#define SSL_LIBRARY_NAME "OpenSSL"
43
#define SSL_LIBRARY_TEXT OPENSSL_VERSION_TEXT
44
#elif !defined(SSL_LIBRARY_VERSION)
45
#define SSL_LIBRARY_VERSION 0x0000
46
#define SSL_LIBRARY_NAME "OtherSSL"
47
#define SSL_LIBRARY_TEXT "OtherSSL 0.0.0 00 XXX 0000"
51
* Maximum length of a DER encoded session.
52
* FIXME: There is no define in OpenSSL, but OpenSSL uses 1024*10,
53
* so this value should be ok. Although we have no warm feeling.
55
#define SSL_SESSION_MAX_DER 1024*10
57
/** max length for SSL_SESSION_id2sz */
58
#define SSL_SESSION_ID_STRING_LEN \
59
((SSL_MAX_SSL_SESSION_ID_LENGTH + 1) * 2)
62
* Additional Functions
64
void SSL_init_app_data2_idx(void);
65
void *SSL_get_app_data2(SSL *);
66
void SSL_set_app_data2(SSL *, void *);
67
X509 *SSL_read_X509(char *, X509 **, modssl_read_bio_cb_fn *);
68
EVP_PKEY *SSL_read_PrivateKey(char *, EVP_PKEY **, modssl_read_bio_cb_fn *, void *);
69
int SSL_smart_shutdown(SSL *ssl);
70
X509_STORE *SSL_X509_STORE_create(char *, char *);
71
int SSL_X509_STORE_lookup(X509_STORE *, int, X509_NAME *, X509_OBJECT *);
72
char *SSL_make_ciphersuite(apr_pool_t *, SSL *);
73
BOOL SSL_X509_isSGC(X509 *);
74
BOOL SSL_X509_getBC(X509 *, int *, int *);
75
BOOL SSL_X509_getCN(apr_pool_t *, X509 *, char **);
76
BOOL SSL_X509_INFO_load_file(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);
77
BOOL SSL_X509_INFO_load_path(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);
78
int SSL_CTX_use_certificate_chain(SSL_CTX *, char *, int, modssl_read_bio_cb_fn *);
79
char *SSL_SESSION_id2sz(unsigned char *, int, char *, int);
81
/** util functions for OpenSSL+sslc compat */
82
int modssl_session_get_time(SSL_SESSION *session);
84
DH *modssl_dh_configure(unsigned char *p, int plen,
85
unsigned char *g, int glen);
87
#endif /* __SSL_UTIL_SSL_H__ */