Apache HTTPD
ssl_util_ssl.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
34#ifndef __SSL_UTIL_SSL_H__
35#define __SSL_UTIL_SSL_H__
36
41#define MODSSL_LIBRARY_VERSION OPENSSL_VERSION_NUMBER
42#define MODSSL_LIBRARY_NAME "OpenSSL"
43#define MODSSL_LIBRARY_TEXT OPENSSL_VERSION_TEXT
44#if MODSSL_USE_OPENSSL_PRE_1_1_API
45#define MODSSL_LIBRARY_DYNTEXT SSLeay_version(SSLEAY_VERSION)
46#else
47#define MODSSL_LIBRARY_DYNTEXT OpenSSL_version(OPENSSL_VERSION)
48#endif
49
55#define MODSSL_SESSION_MAX_DER 1024*10
56
58#define MODSSL_SESSION_ID_STRING_LEN \
59 ((SSL_MAX_SSL_SESSION_ID_LENGTH + 1) * 2)
60
66void modssl_set_app_data2(SSL *, void *);
67
68/* Read private key from filename in either PEM or raw base64(DER)
69 * format, using password entry callback cb and userdata. */
71
73BOOL modssl_X509_getBC(X509 *, int *, int *);
75 int raw);
77BOOL modssl_X509_getSAN(apr_pool_t *, X509 *, int, const char *, int, apr_array_header_t **);
79char *modssl_SSL_SESSION_id2sz(IDCONST unsigned char *, int, char *, int);
80
81/* Reads the remaining data in BIO, if not empty, and copies it into a
82 * pool-allocated string. If empty, returns NULL. BIO_free(bio) is
83 * called for both cases. */
85
86/* Read a single certificate and its private key from the given string in PEM format.
87 * If `key_pem` is NULL, it will expect the key in `cert_pem`.
88 */
90 const char *cert_pem, const char *key_pem,
91 pem_password_cb *cb, void *ud,
92 X509 **pcert, EVP_PKEY **pkey);
93
94/* Convert a certificate (and optionally a second) into a PEM string.
95 * @param p pool for allocations
96 * @param cert1 the certificate to convert
97 * @param cert2 a second cert to add to the PEM afterwards or NULL.
98 * @param ppem the certificate(s) in PEM format, NUL-terminated.
99 * @return APR_SUCCESS if ppem is valid.
100 */
102 X509 *cert1, X509 *cert2,
103 const char **ppem);
104
105#endif /* __SSL_UTIL_SSL_H__ */
apr_datum_t * pkey
Definition apr_dbm.h:158
#define IDCONST
#define BOOL
Definition ssl_private.h:81
apr_status_t modssl_read_cert(apr_pool_t *p, const char *cert_pem, const char *key_pem, pem_password_cb *cb, void *ud, X509 **pcert, EVP_PKEY **pkey)
void modssl_init_app_data2_idx(void)
char * modssl_SSL_SESSION_id2sz(IDCONST unsigned char *, int, char *, int)
BOOL modssl_X509_match_name(apr_pool_t *, X509 *, const char *, BOOL, server_rec *)
BOOL modssl_X509_getBC(X509 *, int *, int *)
void modssl_set_app_data2(SSL *, void *)
apr_status_t modssl_cert_get_pem(apr_pool_t *p, X509 *cert1, X509 *cert2, const char **ppem)
char * modssl_X509_NAME_to_string(apr_pool_t *, X509_NAME *, int)
int modssl_smart_shutdown(SSL *ssl)
EVP_PKEY * modssl_read_privatekey(const char *filename, pem_password_cb *cb, void *ud)
char * modssl_bio_free_read(apr_pool_t *p, BIO *bio)
BOOL modssl_X509_getSAN(apr_pool_t *, X509 *, int, const char *, int, apr_array_header_t **)
char * modssl_X509_NAME_ENTRY_to_string(apr_pool_t *p, X509_NAME_ENTRY *xsne, int raw)
void * modssl_get_app_data2(SSL *)
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
apr_size_t const char * filename
Definition apr_shm.h:72
apr_pool_t * p
Definition md_event.c:32
A structure to store information for each virtual server.
Definition httpd.h:1322