Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ssl_private.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 SSL_PRIVATE_H
18 #define SSL_PRIVATE_H
19 
30 #include "httpd.h"
31 #include "http_config.h"
32 #include "http_core.h"
33 #include "http_log.h"
34 #include "http_main.h"
35 #include "http_connection.h"
36 #include "http_request.h"
37 #include "http_protocol.h"
38 #include "http_vhost.h"
39 #include "util_script.h"
40 #include "util_filter.h"
41 #include "util_ebcdic.h"
42 #include "util_mutex.h"
43 #include "apr.h"
44 #include "apr_strings.h"
45 #define APR_WANT_STRFUNC
46 #define APR_WANT_MEMFUNC
47 #include "apr_want.h"
48 #include "apr_tables.h"
49 #include "apr_lib.h"
50 #include "apr_fnmatch.h"
51 #include "apr_strings.h"
52 #include "apr_global_mutex.h"
53 #include "apr_optional.h"
54 #include "ap_socache.h"
55 #include "mod_auth.h"
56 
57 /* The #ifdef macros are only defined AFTER including the above
58  * therefore we cannot include these system files at the top :-(
59  */
60 #if APR_HAVE_STDLIB_H
61 #include <stdlib.h>
62 #endif
63 #if APR_HAVE_SYS_TIME_H
64 #include <sys/time.h>
65 #endif
66 #if APR_HAVE_UNISTD_H
67 #include <unistd.h> /* needed for STDIN_FILENO et.al., at least on FreeBSD */
68 #endif
69 
70 #ifndef FALSE
71 #define FALSE 0
72 #endif
73 
74 #ifndef TRUE
75 #define TRUE !FALSE
76 #endif
77 
78 #ifndef BOOL
79 #define BOOL unsigned int
80 #endif
81 
82 #include "ap_expr.h"
83 
84 /* OpenSSL headers */
85 #include <openssl/opensslv.h>
86 #if (OPENSSL_VERSION_NUMBER >= 0x10001000)
87 /* must be defined before including ssl.h */
88 #define OPENSSL_NO_SSL_INTERN
89 #endif
90 #include <openssl/ssl.h>
91 #include <openssl/err.h>
92 #include <openssl/x509.h>
93 #include <openssl/pem.h>
94 #include <openssl/crypto.h>
95 #include <openssl/evp.h>
96 #include <openssl/rand.h>
97 #include <openssl/x509v3.h>
98 #include <openssl/x509_vfy.h>
99 #include <openssl/ocsp.h>
100 
101 /* Avoid tripping over an engine build installed globally and detected
102  * when the user points at an explicit non-engine flavor of OpenSSL
103  */
104 #if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
105 #include <openssl/engine.h>
106 #endif
107 
108 #if (OPENSSL_VERSION_NUMBER < 0x0090801f)
109 #error mod_ssl requires OpenSSL 0.9.8a or later
110 #endif
111 
118 #if (OPENSSL_VERSION_NUMBER >= 0x10000000)
119 #define MODSSL_SSL_CIPHER_CONST const
120 #define MODSSL_SSL_METHOD_CONST const
121 #else
122 #define MODSSL_SSL_CIPHER_CONST
123 #define MODSSL_SSL_METHOD_CONST
124 #endif
125 
126 #if defined(LIBRESSL_VERSION_NUMBER)
127 /* Missing from LibreSSL */
128 #if LIBRESSL_VERSION_NUMBER < 0x2060000f
129 #define SSL_CTRL_SET_MIN_PROTO_VERSION 123
130 #define SSL_CTRL_SET_MAX_PROTO_VERSION 124
131 #define SSL_CTX_set_min_proto_version(ctx, version) \
132  SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL)
133 #define SSL_CTX_set_max_proto_version(ctx, version) \
134  SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL)
135 #endif /* LIBRESSL_VERSION_NUMBER < 0x2060000f */
136 /* LibreSSL before 2.7 declares OPENSSL_VERSION_NUMBER == 2.0 but does not
137  * include most changes from OpenSSL >= 1.1 (new functions, macros,
138  * deprecations, ...), so we have to work around this...
139  */
140 #define MODSSL_USE_OPENSSL_PRE_1_1_API (LIBRESSL_VERSION_NUMBER < 0x2080000f)
141 #else /* defined(LIBRESSL_VERSION_NUMBER) */
142 #define MODSSL_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L)
143 #endif
144 
145 #if defined(OPENSSL_FIPS)
146 #define HAVE_FIPS
147 #endif
148 
149 #if defined(SSL_OP_NO_TLSv1_2)
150 #define HAVE_TLSV1_X
151 #endif
152 
153 #if defined(SSL_CONF_FLAG_FILE)
154 #define HAVE_SSL_CONF_CMD
155 #endif
156 
157 /* session id constness */
158 #if MODSSL_USE_OPENSSL_PRE_1_1_API
159 #define IDCONST
160 #else
161 #define IDCONST const
162 #endif
163 
168 #if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_set_tlsext_host_name)
169 
170 #define HAVE_TLSEXT
171 
172 /* ECC: make sure we have at least 1.0.0 */
173 #if !defined(OPENSSL_NO_EC) && defined(TLSEXT_ECPOINTFORMAT_uncompressed)
174 #define HAVE_ECC
175 #endif
176 
177 /* OCSP stapling */
178 #if !defined(OPENSSL_NO_OCSP) && defined(SSL_CTX_set_tlsext_status_cb)
179 #define HAVE_OCSP_STAPLING
180 /* All exist but are no longer macros since OpenSSL 1.1.0 */
181 #if OPENSSL_VERSION_NUMBER < 0x10100000L
182 /* backward compatibility with OpenSSL < 1.0 */
183 #ifndef sk_OPENSSL_STRING_num
184 #define sk_OPENSSL_STRING_num sk_num
185 #endif
186 #ifndef sk_OPENSSL_STRING_value
187 #define sk_OPENSSL_STRING_value sk_value
188 #endif
189 #ifndef sk_OPENSSL_STRING_pop
190 #define sk_OPENSSL_STRING_pop sk_pop
191 #endif
192 #endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L */
193 #endif /* if !defined(OPENSSL_NO_OCSP) && defined(SSL_CTX_set_tlsext_status_cb) */
194 
195 /* TLS session tickets */
196 #if defined(SSL_CTX_set_tlsext_ticket_key_cb)
197 #define HAVE_TLS_SESSION_TICKETS
198 #define TLSEXT_TICKET_KEY_LEN 48
199 #ifndef tlsext_tick_md
200 #ifdef OPENSSL_NO_SHA256
201 #define tlsext_tick_md EVP_sha1
202 #else
203 #define tlsext_tick_md EVP_sha256
204 #endif
205 #endif
206 #endif
207 
208 /* Secure Remote Password */
209 #if !defined(OPENSSL_NO_SRP) && defined(SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB)
210 #define HAVE_SRP
211 #include <openssl/srp.h>
212 #endif
213 
214 /* ALPN Protocol Negotiation */
215 #if defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
216 #define HAVE_TLS_ALPN
217 #endif
218 
219 #endif /* !defined(OPENSSL_NO_TLSEXT) && defined(SSL_set_tlsext_host_name) */
220 
221 #if MODSSL_USE_OPENSSL_PRE_1_1_API
222 #define BN_get_rfc2409_prime_768 get_rfc2409_prime_768
223 #define BN_get_rfc2409_prime_1024 get_rfc2409_prime_1024
224 #define BN_get_rfc3526_prime_1536 get_rfc3526_prime_1536
225 #define BN_get_rfc3526_prime_2048 get_rfc3526_prime_2048
226 #define BN_get_rfc3526_prime_3072 get_rfc3526_prime_3072
227 #define BN_get_rfc3526_prime_4096 get_rfc3526_prime_4096
228 #define BN_get_rfc3526_prime_6144 get_rfc3526_prime_6144
229 #define BN_get_rfc3526_prime_8192 get_rfc3526_prime_8192
230 #define BIO_set_init(x,v) (x->init=v)
231 #define BIO_get_data(x) (x->ptr)
232 #define BIO_set_data(x,v) (x->ptr=v)
233 #define BIO_get_shutdown(x) (x->shutdown)
234 #define BIO_set_shutdown(x,v) (x->shutdown=v)
235 #define DH_bits(x) (BN_num_bits(x->p))
236 #else
237 void init_bio_methods(void);
238 void free_bio_methods(void);
239 #endif
240 
241 #if OPENSSL_VERSION_NUMBER < 0x10002000L || \
242  (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000f)
243 #define X509_STORE_CTX_get0_store(x) (x->ctx)
244 #endif
245 
246 #if OPENSSL_VERSION_NUMBER < 0x10000000L
247 #ifndef X509_STORE_CTX_get0_current_issuer
248 #define X509_STORE_CTX_get0_current_issuer(x) (x->current_issuer)
249 #endif
250 #endif
251 
252 /* mod_ssl headers */
253 #include "ssl_util_ssl.h"
254 
255 APLOG_USE_MODULE(ssl);
256 
257 /*
258  * Provide reasonable default for some defines
259  */
260 #ifndef UNSET
261 #define UNSET (-1)
262 #endif
263 #ifndef NUL
264 #define NUL '\0'
265 #endif
266 #ifndef RAND_MAX
267 #include <limits.h>
268 #define RAND_MAX INT_MAX
269 #endif
270 
274 #ifndef UCHAR
275 #define UCHAR unsigned char
276 #endif
277 
281 #define strEQ(s1,s2) (strcmp(s1,s2) == 0)
282 #define strNE(s1,s2) (strcmp(s1,s2) != 0)
283 #define strEQn(s1,s2,n) (strncmp(s1,s2,n) == 0)
284 #define strNEn(s1,s2,n) (strncmp(s1,s2,n) != 0)
285 
286 #define strcEQ(s1,s2) (strcasecmp(s1,s2) == 0)
287 #define strcNE(s1,s2) (strcasecmp(s1,s2) != 0)
288 #define strcEQn(s1,s2,n) (strncasecmp(s1,s2,n) == 0)
289 #define strcNEn(s1,s2,n) (strncasecmp(s1,s2,n) != 0)
290 
291 #define strIsEmpty(s) (s == NULL || s[0] == NUL)
292 
293 #define myConnConfig(c) \
294  ((SSLConnRec *)ap_get_module_config(c->conn_config, &ssl_module))
295 #define myConnConfigSet(c, val) \
296  ap_set_module_config(c->conn_config, &ssl_module, val)
297 #define mySrvConfig(srv) \
298  ((SSLSrvConfigRec *)ap_get_module_config(srv->module_config, &ssl_module))
299 #define myDirConfig(req) \
300  ((SSLDirConfigRec *)ap_get_module_config(req->per_dir_config, &ssl_module))
301 #define myCtxConfig(sslconn, sc) \
302  (sslconn->is_proxy ? sslconn->dc->proxy : sc->server)
303 #define myModConfig(srv) mySrvConfig((srv))->mc
304 #define mySrvFromConn(c) myConnConfig(c)->server
305 #define myDirConfigFromConn(c) myConnConfig(c)->dc
306 #define mySrvConfigFromConn(c) mySrvConfig(mySrvFromConn(c))
307 #define myModConfigFromConn(c) myModConfig(mySrvFromConn(c))
308 
312 #ifndef SSL_SESSION_CACHE_TIMEOUT
313 #define SSL_SESSION_CACHE_TIMEOUT 300
314 #endif
315 
316 /* Default setting for per-dir reneg buffer. */
317 #ifndef DEFAULT_RENEG_BUFFER_SIZE
318 #define DEFAULT_RENEG_BUFFER_SIZE (128 * 1024)
319 #endif
320 
321 /* Default for OCSP response validity */
322 #ifndef DEFAULT_OCSP_MAX_SKEW
323 #define DEFAULT_OCSP_MAX_SKEW (60 * 5)
324 #endif
325 
326 /* Default timeout for OCSP queries */
327 #ifndef DEFAULT_OCSP_TIMEOUT
328 #define DEFAULT_OCSP_TIMEOUT 10
329 #endif
330 
334 #define SSL_OPT_NONE (0)
335 #define SSL_OPT_RELSET (1<<0)
336 #define SSL_OPT_STDENVVARS (1<<1)
337 #define SSL_OPT_EXPORTCERTDATA (1<<3)
338 #define SSL_OPT_FAKEBASICAUTH (1<<4)
339 #define SSL_OPT_STRICTREQUIRE (1<<5)
340 #define SSL_OPT_OPTRENEGOTIATE (1<<6)
341 #define SSL_OPT_LEGACYDNFORMAT (1<<7)
342 typedef int ssl_opt_t;
343 
347 #define SSL_PROTOCOL_NONE (0)
348 #ifndef OPENSSL_NO_SSL3
349 #define SSL_PROTOCOL_SSLV3 (1<<1)
350 #endif
351 #define SSL_PROTOCOL_TLSV1 (1<<2)
352 #ifndef OPENSSL_NO_SSL3
353 #define SSL_PROTOCOL_BASIC (SSL_PROTOCOL_SSLV3|SSL_PROTOCOL_TLSV1)
354 #else
355 #define SSL_PROTOCOL_BASIC (SSL_PROTOCOL_TLSV1)
356 #endif
357 #ifdef HAVE_TLSV1_X
358 #define SSL_PROTOCOL_TLSV1_1 (1<<3)
359 #define SSL_PROTOCOL_TLSV1_2 (1<<4)
360 #define SSL_PROTOCOL_TLSV1_3 (1<<5)
361 
362 #ifdef SSL_OP_NO_TLSv1_3
363 #define SSL_HAVE_PROTOCOL_TLSV1_3 (1)
364 #define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC| \
365  SSL_PROTOCOL_TLSV1_1|SSL_PROTOCOL_TLSV1_2|SSL_PROTOCOL_TLSV1_3)
366 #else
367 #define SSL_HAVE_PROTOCOL_TLSV1_3 (0)
368 #define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC| \
369  SSL_PROTOCOL_TLSV1_1|SSL_PROTOCOL_TLSV1_2)
370 #endif
371 #else
372 #define SSL_PROTOCOL_ALL (SSL_PROTOCOL_BASIC)
373 #endif
374 #ifndef OPENSSL_NO_SSL3
375 #define SSL_PROTOCOL_DEFAULT (SSL_PROTOCOL_ALL & ~SSL_PROTOCOL_SSLV3)
376 #else
377 #define SSL_PROTOCOL_DEFAULT (SSL_PROTOCOL_ALL)
378 #endif
379 typedef int ssl_proto_t;
380 
384 typedef enum {
390 } ssl_verify_t;
391 
392 #define SSL_VERIFY_PEER_STRICT \
393  (SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT)
394 
395 #define ssl_verify_error_is_optional(errnum) \
396  ((errnum == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) \
397  || (errnum == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN) \
398  || (errnum == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY) \
399  || (errnum == X509_V_ERR_CERT_UNTRUSTED) \
400  || (errnum == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE))
401 
405 typedef enum {
407  SSL_CRLCHECK_LEAF = (1 << 0),
408  SSL_CRLCHECK_CHAIN = (1 << 1),
409 
410 #define SSL_CRLCHECK_FLAGS (~0x3)
413 
417 typedef enum {
419  SSL_OCSPCHECK_LEAF = (1 << 0),
423 
427 typedef enum {
432 } ssl_pphrase_t;
433 
437 #define SSL_PCM_EXISTS 1
438 #define SSL_PCM_ISREG 2
439 #define SSL_PCM_ISDIR 4
440 #define SSL_PCM_ISNONZERO 8
441 typedef unsigned int ssl_pathcheck_t;
442 
446 typedef enum {
451 } ssl_enabled_t;
452 
456 typedef struct {
457  const char *cpExpr;
459 } ssl_require_t;
460 
464 typedef enum {
467 } ssl_rsctx_t;
468 typedef enum {
473 } ssl_rssrc_t;
474 typedef struct {
477  char *cpPath;
478  int nBytes;
480 
484 typedef struct {
485  long int nData;
486  unsigned char *cpData;
488 } ssl_asn1_t;
489 
497 
498 typedef enum {
504 
505 typedef struct {
506  SSL *ssl;
507  const char *client_dn;
508  X509 *client_cert;
510  const char *verify_info;
511  const char *verify_error;
513  int is_proxy;
514  int disabled;
515  enum {
516  NON_SSL_OK = 0, /* is SSL request, or error handling completed */
517  NON_SSL_SEND_REQLINE, /* Need to send the fake request line */
518  NON_SSL_SEND_HDR_SEP, /* Need to send the header separator */
519  NON_SSL_SET_ERROR_MSG /* Need to set the error message */
520  } non_ssl_request;
521 
522  /* Track the handshake/renegotiation state for the connection so
523  * that all client-initiated renegotiations can be rejected, as a
524  * partial fix for CVE-2009-3555. */
525  enum {
526  RENEG_INIT = 0, /* Before initial handshake */
527  RENEG_REJECT, /* After initial handshake; any client-initiated
528  * renegotiation should be rejected */
529  RENEG_ALLOW, /* A server-initiated renegotiation is taking
530  * place (as dictated by configuration) */
531  RENEG_ABORT /* Renegotiation initiated by client, abort the
532  * connection */
533  } reneg_state;
534 
537 
538  const char *cipher_suite; /* cipher suite used in last reneg */
539  int service_unavailable; /* thouugh we negotiate SSL, no requests will be served */
540 } SSLConnRec;
541 
542 /* BIG FAT WARNING: SSLModConfigRec has unusual memory lifetime: it is
543  * allocated out of the "process" pool and only a single such
544  * structure is created and used for the lifetime of the process.
545  * (The process pool is s->process->pool and is stored in the .pPool
546  * field.) Most members of this structure are likewise allocated out
547  * of the process pool, but notably sesscache and sesscache_context
548  * are not.
549  *
550  * The structure is treated as mostly immutable after a single config
551  * parse has completed; the post_config hook (ssl_init_Module) flips
552  * the bFixed flag to true and subsequent invocations of the config
553  * callbacks hence do nothing.
554  *
555  * This odd lifetime strategy is used so that encrypted private keys
556  * can be decrypted once at startup and continue to be used across
557  * subsequent server reloads where the interactive password prompt is
558  * not possible.
559 
560  * It is really an ABI nightmare waiting to happen since DSOs are
561  * reloaded across restarts, and nothing prevents the struct type
562  * changing across such reloads, yet the cached structure will be
563  * assumed to match regardless.
564  *
565  * This should really be fixed using a smaller structure which only
566  * stores that which is absolutely necessary (the private keys, maybe
567  * the random seed), and have that structure be strictly ABI-versioned
568  * for safety.
569  */
570 typedef struct {
571  pid_t pid;
574 
575  /* OpenSSL SSL_SESS_CACHE_* flags: */
577 
578  /* The configured provider, and associated private data
579  * structure. */
582 
586 
587  /* A hash table of pointers to ssl_asn1_t structures. The structures
588  * are used to store private keys in raw DER format (serialized OpenSSL
589  * PrivateKey structures). The table is indexed by (vhost-id,
590  * index), for example the string "vhost.example.com:443:0". */
592 
593 #if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
594  const char *szCryptoDevice;
595 #endif
596 
597 #ifdef HAVE_OCSP_STAPLING
598  const ap_socache_provider_t *stapling_cache;
599  ap_socache_instance_t *stapling_cache_context;
600  apr_global_mutex_t *stapling_cache_mutex;
601  apr_global_mutex_t *stapling_refresh_mutex;
602 #endif
603 
605 
608 typedef struct {
609  /* Lists of configured certs and keys for this server */
612 
615  const char *ca_name_path;
616  const char *ca_name_file;
617 
618  /* TLS service for this server is suspended */
621 
622 typedef struct {
624  const char *cert_file;
625  const char *cert_path;
626  const char *ca_cert_file;
627  STACK_OF(X509_INFO) *certs; /* Contains End Entity certs */
628  STACK_OF(X509) **ca_certs; /* Contains ONLY chain certs for
629  * each item in certs.
630  * (ptr to array of ptrs) */
632 
634 typedef struct {
636  const char *ca_cert_path;
637  const char *ca_cert_file;
638 
639  const char *cipher_suite;
640 
644 
648  const char *tls13_ciphers;
650 
651 #ifdef HAVE_TLS_SESSION_TICKETS
652 typedef struct {
653  const char *file_path;
654  unsigned char key_name[16];
655  unsigned char hmac_secret[16];
656  unsigned char aes_key[16];
657 } modssl_ticket_key_t;
658 #endif
659 
660 #ifdef HAVE_SSL_CONF_CMD
661 typedef struct {
662  const char *name;
663  const char *value;
664 } ssl_ctx_param_t;
665 #endif
666 
667 typedef struct {
669  SSL_CTX *ssl_ctx;
670 
674 
675 #ifdef HAVE_TLS_SESSION_TICKETS
676  modssl_ticket_key_t *ticket_key;
677 #endif
678 
681 
684  const char *pphrase_dialog_path;
685 
686  const char *cert_chain;
687 
689  const char *crl_path;
690  const char *crl_file;
692 
693 #ifdef HAVE_OCSP_STAPLING
694 
695  BOOL stapling_enabled;
696  long stapling_resptime_skew;
697  long stapling_resp_maxage;
698  int stapling_cache_timeout;
699  BOOL stapling_return_errors;
700  BOOL stapling_fake_trylater;
701  int stapling_errcache_timeout;
702  apr_interval_time_t stapling_responder_timeout;
703  const char *stapling_force_url;
704 #endif
705 
706 #ifdef HAVE_SRP
707  char *srp_vfile;
708  char *srp_unknown_user_seed;
709  SRP_VBASE *srp_vbase;
710 #endif
711 
713 
715  BOOL ocsp_force_default; /* true if the default responder URL is
716  * used regardless of per-cert URL */
717  const char *ocsp_responder; /* default responder URL */
723 
724  BOOL ocsp_noverify; /* true if skipping OCSP certification verification like openssl -noverify */
725  /* Declare variables for using OCSP Responder Certs for OCSP verification */
726  int ocsp_verify_flags; /* Flags to use when verifying OCSP response */
727  const char *ocsp_certs_file; /* OCSP other certificates filename */
728  STACK_OF(X509) *ocsp_certs; /* OCSP other certificates */
729 
730 #ifdef HAVE_SSL_CONF_CMD
731  SSL_CONF_CTX *ssl_ctx_config; /* Configuration context */
732  apr_array_header_t *ssl_ctx_param; /* parameters to pass to SSL_CTX */
733 #endif
734 
738 } modssl_ctx_t;
739 
743  const char *vhost_id;
749 #ifdef HAVE_TLSEXT
750  ssl_enabled_t strict_sni_vhost_check;
751 #endif
752 #ifdef HAVE_FIPS
753  BOOL fips;
754 #endif
755 #ifndef OPENSSL_NO_COMP
757 #endif
759 
760 };
761 
773  const char *szCipherSuite;
776  const char *szUserName;
778 
782 };
783 
785 
792 
798 void *ssl_config_server_merge(apr_pool_t *, void *, void *);
799 void *ssl_config_perdir_create(apr_pool_t *, char *);
800 void *ssl_config_perdir_merge(apr_pool_t *, void *, void *);
803 const char *ssl_cmd_SSLPolicyApply(cmd_parms *, void *, const char *);
804 const char *ssl_cmd_SSLPassPhraseDialog(cmd_parms *, void *, const char *);
805 const char *ssl_cmd_SSLCryptoDevice(cmd_parms *, void *, const char *);
806 const char *ssl_cmd_SSLRandomSeed(cmd_parms *, void *, const char *, const char *, const char *);
807 const char *ssl_cmd_SSLEngine(cmd_parms *, void *, const char *);
808 const char *ssl_cmd_SSLCipherSuite(cmd_parms *, void *, const char *, const char *);
809 const char *ssl_cmd_SSLCertificateFile(cmd_parms *, void *, const char *);
810 const char *ssl_cmd_SSLCertificateKeyFile(cmd_parms *, void *, const char *);
811 const char *ssl_cmd_SSLCertificateChainFile(cmd_parms *, void *, const char *);
812 const char *ssl_cmd_SSLCACertificatePath(cmd_parms *, void *, const char *);
813 const char *ssl_cmd_SSLCACertificateFile(cmd_parms *, void *, const char *);
814 const char *ssl_cmd_SSLCADNRequestPath(cmd_parms *, void *, const char *);
815 const char *ssl_cmd_SSLCADNRequestFile(cmd_parms *, void *, const char *);
816 const char *ssl_cmd_SSLCARevocationPath(cmd_parms *, void *, const char *);
817 const char *ssl_cmd_SSLCARevocationFile(cmd_parms *, void *, const char *);
818 const char *ssl_cmd_SSLCARevocationCheck(cmd_parms *, void *, const char *);
819 const char *ssl_cmd_SSLHonorCipherOrder(cmd_parms *cmd, void *dcfg, int flag);
820 const char *ssl_cmd_SSLCompression(cmd_parms *, void *, int flag);
821 const char *ssl_cmd_SSLSessionTickets(cmd_parms *, void *, int flag);
822 const char *ssl_cmd_SSLVerifyClient(cmd_parms *, void *, const char *);
823 const char *ssl_cmd_SSLVerifyDepth(cmd_parms *, void *, const char *);
824 const char *ssl_cmd_SSLSessionCache(cmd_parms *, void *, const char *);
825 const char *ssl_cmd_SSLSessionCacheTimeout(cmd_parms *, void *, const char *);
826 const char *ssl_cmd_SSLProtocol(cmd_parms *, void *, const char *);
827 const char *ssl_cmd_SSLOptions(cmd_parms *, void *, const char *);
828 const char *ssl_cmd_SSLRequireSSL(cmd_parms *, void *);
829 const char *ssl_cmd_SSLRequire(cmd_parms *, void *, const char *);
830 const char *ssl_cmd_SSLUserName(cmd_parms *, void *, const char *);
831 const char *ssl_cmd_SSLRenegBufferSize(cmd_parms *cmd, void *dcfg, const char *arg);
832 const char *ssl_cmd_SSLStrictSNIVHostCheck(cmd_parms *cmd, void *dcfg, int flag);
833 const char *ssl_cmd_SSLInsecureRenegotiation(cmd_parms *cmd, void *dcfg, int flag);
834 
835 const char *ssl_cmd_SSLProxyEngine(cmd_parms *cmd, void *dcfg, int flag);
836 const char *ssl_cmd_SSLProxyProtocol(cmd_parms *, void *, const char *);
837 const char *ssl_cmd_SSLProxyCipherSuite(cmd_parms *, void *, const char *, const char *);
838 const char *ssl_cmd_SSLProxyVerify(cmd_parms *, void *, const char *);
839 const char *ssl_cmd_SSLProxyVerifyDepth(cmd_parms *, void *, const char *);
840 const char *ssl_cmd_SSLProxyCACertificatePath(cmd_parms *, void *, const char *);
841 const char *ssl_cmd_SSLProxyCACertificateFile(cmd_parms *, void *, const char *);
842 const char *ssl_cmd_SSLProxyCARevocationPath(cmd_parms *, void *, const char *);
843 const char *ssl_cmd_SSLProxyCARevocationFile(cmd_parms *, void *, const char *);
844 const char *ssl_cmd_SSLProxyCARevocationCheck(cmd_parms *, void *, const char *);
845 const char *ssl_cmd_SSLProxyMachineCertificatePath(cmd_parms *, void *, const char *);
846 const char *ssl_cmd_SSLProxyMachineCertificateFile(cmd_parms *, void *, const char *);
847 const char *ssl_cmd_SSLProxyMachineCertificateChainFile(cmd_parms *, void *, const char *);
848 #ifdef HAVE_TLS_SESSION_TICKETS
849 const char *ssl_cmd_SSLSessionTicketKeyFile(cmd_parms *cmd, void *dcfg, const char *arg);
850 #endif
851 const char *ssl_cmd_SSLProxyCheckPeerExpire(cmd_parms *cmd, void *dcfg, int flag);
852 const char *ssl_cmd_SSLProxyCheckPeerCN(cmd_parms *cmd, void *dcfg, int flag);
853 const char *ssl_cmd_SSLProxyCheckPeerName(cmd_parms *cmd, void *dcfg, int flag);
854 
855 const char *ssl_cmd_SSLOCSPOverrideResponder(cmd_parms *cmd, void *dcfg, int flag);
856 const char *ssl_cmd_SSLOCSPDefaultResponder(cmd_parms *cmd, void *dcfg, const char *arg);
857 const char *ssl_cmd_SSLOCSPResponseTimeSkew(cmd_parms *cmd, void *dcfg, const char *arg);
858 const char *ssl_cmd_SSLOCSPResponseMaxAge(cmd_parms *cmd, void *dcfg, const char *arg);
859 const char *ssl_cmd_SSLOCSPResponderTimeout(cmd_parms *cmd, void *dcfg, const char *arg);
860 const char *ssl_cmd_SSLOCSPUseRequestNonce(cmd_parms *cmd, void *dcfg, int flag);
861 const char *ssl_cmd_SSLOCSPEnable(cmd_parms *cmd, void *dcfg, const char *arg);
862 const char *ssl_cmd_SSLOCSPProxyURL(cmd_parms *cmd, void *dcfg, const char *arg);
863 
864 /* Declare OCSP Responder Certificate Verification Directive */
865 const char *ssl_cmd_SSLOCSPNoVerify(cmd_parms *cmd, void *dcfg, int flag);
866 /* Declare OCSP Responder Certificate File Directive */
867 const char *ssl_cmd_SSLOCSPResponderCertificateFile(cmd_parms *cmd, void *dcfg, const char *arg);
868 
869 #ifdef HAVE_SSL_CONF_CMD
870 const char *ssl_cmd_SSLOpenSSLConfCmd(cmd_parms *cmd, void *dcfg, const char *arg1, const char *arg2);
871 #endif
872 
873 #ifdef HAVE_SRP
874 const char *ssl_cmd_SSLSRPVerifierFile(cmd_parms *cmd, void *dcfg, const char *arg);
875 const char *ssl_cmd_SSLSRPUnknownUserSeed(cmd_parms *cmd, void *dcfg, const char *arg);
876 #endif
877 
878 const char *ssl_cmd_SSLFIPS(cmd_parms *cmd, void *dcfg, int flag);
879 
887  apr_pool_t *ptemp, server_rec *s,
888  ap_conf_vector_t *section_config);
889 STACK_OF(X509_NAME)
890  *ssl_init_FindCAList(server_rec *, apr_pool_t *, const char *, const char *);
893 
901 void ssl_hook_ConfigTest(apr_pool_t *pconf, server_rec *s);
902 
906 
908 DH *ssl_callback_TmpDH(SSL *, int, int);
909 int ssl_callback_SSLVerify(int, X509_STORE_CTX *);
910 int ssl_callback_SSLVerify_CRL(int, X509_STORE_CTX *, conn_rec *);
911 int ssl_callback_proxy_cert(SSL *ssl, X509 **x509, EVP_PKEY **pkey);
912 int ssl_callback_NewSessionCacheEntry(SSL *, SSL_SESSION *);
913 SSL_SESSION *ssl_callback_GetSessionCacheEntry(SSL *, IDCONST unsigned char *, int, int *);
914 void ssl_callback_DelSessionCacheEntry(SSL_CTX *, SSL_SESSION *);
915 void ssl_callback_Info(const SSL *, int, int);
916 #ifdef HAVE_TLSEXT
917 int ssl_callback_ServerNameIndication(SSL *, int *, modssl_ctx_t *);
918 #endif
919 #ifdef HAVE_TLS_SESSION_TICKETS
920 int ssl_callback_SessionTicket(SSL *, unsigned char *, unsigned char *,
921  EVP_CIPHER_CTX *, HMAC_CTX *, int);
922 #endif
923 
924 #ifdef HAVE_TLS_ALPN
925 int ssl_callback_alpn_select(SSL *ssl, const unsigned char **out,
926  unsigned char *outlen, const unsigned char *in,
927  unsigned int inlen, void *arg);
928 #endif
929 
935  apr_time_t, SSL_SESSION *, apr_pool_t *);
936 SSL_SESSION *ssl_scache_retrieve(server_rec *, IDCONST UCHAR *, int, apr_pool_t *);
938  apr_pool_t *);
939 
941 #ifdef HAVE_OCSP_STAPLING
942 const char *ssl_cmd_SSLStaplingCache(cmd_parms *, void *, const char *);
943 const char *ssl_cmd_SSLUseStapling(cmd_parms *, void *, int);
944 const char *ssl_cmd_SSLStaplingResponseTimeSkew(cmd_parms *, void *, const char *);
945 const char *ssl_cmd_SSLStaplingResponseMaxAge(cmd_parms *, void *, const char *);
946 const char *ssl_cmd_SSLStaplingStandardCacheTimeout(cmd_parms *, void *, const char *);
947 const char *ssl_cmd_SSLStaplingErrorCacheTimeout(cmd_parms *, void *, const char *);
948 const char *ssl_cmd_SSLStaplingReturnResponderErrors(cmd_parms *, void *, int);
949 const char *ssl_cmd_SSLStaplingFakeTryLater(cmd_parms *, void *, int);
950 const char *ssl_cmd_SSLStaplingResponderTimeout(cmd_parms *, void *, const char *);
951 const char *ssl_cmd_SSLStaplingForceURL(cmd_parms *, void *, const char *);
952 apr_status_t modssl_init_stapling(server_rec *, apr_pool_t *, apr_pool_t *, modssl_ctx_t *);
953 void ssl_stapling_certinfo_hash_init(apr_pool_t *);
954 int ssl_stapling_init_cert(server_rec *, apr_pool_t *, apr_pool_t *,
955  modssl_ctx_t *, X509 *);
956 #endif
957 #ifdef HAVE_SRP
958 int ssl_callback_SRPServerParams(SSL *, int *, void *);
959 #endif
960 
962 void ssl_io_filter_init(conn_rec *, request_rec *r, SSL *);
964 long ssl_io_data_cb(BIO *, int, const char *, int, long, long);
965 
966 /* ssl_io_buffer_fill fills the setaside buffering of the HTTP request
967  * to allow an SSL renegotiation to take place. */
969 
972 
975 apr_file_t *ssl_util_ppopen(server_rec *, apr_pool_t *, const char *,
976  const char * const *);
978 char *ssl_util_readfilter(server_rec *, apr_pool_t *, const char *,
979  const char * const *);
980 BOOL ssl_util_path_check(ssl_pathcheck_t, const char *, apr_pool_t *);
981 #if APR_HAS_THREADS && MODSSL_USE_OPENSSL_PRE_1_1_API
984 #endif
986 
987 BOOL ssl_util_vhost_matches(const char *servername, server_rec *s);
988 
991  const char *, apr_array_header_t **);
992 
993 /* Load public and/or private key from the configured ENGINE. Private
994  * key returned as *pkey. certid can be NULL, in which case *pubkey
995  * is not altered. Errors logged on failure. */
997  const char *vhostid,
998  const char *certid, const char *keyid,
999  X509 **pubkey, EVP_PKEY **privkey);
1000 
1002 DH *ssl_dh_GetParamFromFile(const char *);
1003 #ifdef HAVE_ECC
1004 EC_GROUP *ssl_ec_GetParamFromFile(const char *);
1005 #endif
1006 
1007 /* Store the EVP_PKEY key (serialized into DER) in the hash table with
1008  * key, returning the ssl_asn1_t structure pointer. */
1009 ssl_asn1_t *ssl_asn1_table_set(apr_hash_t *table, const char *key,
1010  EVP_PKEY *pkey);
1011 /* Retrieve the ssl_asn1_t structure with given key from the hash. */
1012 ssl_asn1_t *ssl_asn1_table_get(apr_hash_t *table, const char *key);
1013 /* Remove and free the ssl_asn1_t structure with given key. */
1014 void ssl_asn1_table_unset(apr_hash_t *table, const char *key);
1015 
1019 int ssl_mutex_on(server_rec *);
1020 int ssl_mutex_off(server_rec *);
1021 
1023 
1024 /* mutex type names for Mutex directive */
1025 #define SSL_CACHE_MUTEX_TYPE "ssl-cache"
1026 #define SSL_STAPLING_CACHE_MUTEX_TYPE "ssl-stapling"
1027 #define SSL_STAPLING_REFRESH_MUTEX_TYPE "ssl-stapling-refresh"
1028 
1030 
1032 void ssl_log_ssl_error(const char *, int, int, server_rec *);
1033 
1034 /* ssl_log_xerror, ssl_log_cxerror and ssl_log_rxerror are wrappers for the
1035  * respective ap_log_*error functions and take a certificate as an
1036  * additional argument (whose details are appended to the log message).
1037  * The other arguments are interpreted exactly as with their ap_log_*error
1038  * counterparts. */
1039 void ssl_log_xerror(const char *file, int line, int level,
1041  X509 *cert, const char *format, ...)
1042  __attribute__((format(printf,8,9)));
1043 
1044 void ssl_log_cxerror(const char *file, int line, int level,
1045  apr_status_t rv, conn_rec *c, X509 *cert,
1046  const char *format, ...)
1047  __attribute__((format(printf,7,8)));
1048 
1049 void ssl_log_rxerror(const char *file, int line, int level,
1050  apr_status_t rv, request_rec *r, X509 *cert,
1051  const char *format, ...)
1052  __attribute__((format(printf,7,8)));
1053 
1054 #define SSLLOG_MARK __FILE__,__LINE__
1055 
1058 /* Register variables for the lifetime of the process pool 'p'. */
1059 void ssl_var_register(apr_pool_t *p);
1060 char *ssl_var_lookup(apr_pool_t *, server_rec *, conn_rec *, request_rec *, char *);
1061 apr_array_header_t *ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer, const char *extension);
1062 
1064 
1065 /* Extract SSL_*_DN_* variables into table 't' from SSL object 'ssl',
1066  * allocating from 'p': */
1067 void modssl_var_extract_dns(apr_table_t *t, SSL *ssl, apr_pool_t *p);
1068 
1069 /* Extract SSL_*_SAN_* variables (subjectAltName entries) into table 't'
1070  * from SSL object 'ssl', allocating from 'p'. */
1072 
1073 #ifndef OPENSSL_NO_OCSP
1074 /* Perform OCSP validation of the current cert in the given context.
1075  * Returns non-zero on success or zero on failure. On failure, the
1076  * context error code is set. */
1077 int modssl_verify_ocsp(X509_STORE_CTX *ctx, SSLSrvConfigRec *sc,
1078  server_rec *s, conn_rec *c, apr_pool_t *pool);
1079 
1080 /* OCSP helper interface; dispatches the given OCSP request to the
1081  * responder at the given URI. Returns the decoded OCSP response
1082  * object, or NULL on error (in which case, errors will have been
1083  * logged). Pool 'p' is used for temporary allocations. */
1084 OCSP_RESPONSE *modssl_dispatch_ocsp_request(const apr_uri_t *uri,
1085  apr_interval_time_t timeout,
1086  OCSP_REQUEST *request,
1087  conn_rec *c, apr_pool_t *p);
1088 
1089 /* Initialize OCSP trusted certificate list */
1091 
1092 #endif
1093 
1094 /* Retrieve DH parameters for given key length. Return value should
1095  * be treated as unmutable, since it is stored in process-global
1096  * memory. */
1097 DH *modssl_get_dh_params(unsigned keylen);
1098 
1099 /* Returns non-zero if the request was made over SSL/TLS. If sslconn
1100  * is non-NULL and the request is using SSL/TLS, sets *sslconn to the
1101  * corresponding SSLConnRec structure for the connection. */
1102 int modssl_request_is_tls(const request_rec *r, SSLConnRec **sslconn);
1103 
1104 /* Returns non-zero if the cert/key filename should be handled through
1105  * the configured ENGINE. */
1106 int modssl_is_engine_id(const char *name);
1107 
1108 #if HAVE_VALGRIND
1109 extern int ssl_running_on_valgrind;
1110 #endif
1111 
1112 int ssl_is_challenge(conn_rec *c, const char *servername,
1113  X509 **pcert, EVP_PKEY **pkey);
1114 
1115 #endif /* SSL_PRIVATE_H */
1116 
apr_pool_t * pPool
Definition: ssl_private.h:572
Definition: ssl_private.h:469
const char * ssl_cmd_SSLRequire(cmd_parms *, void *, const char *)
Definition: ap_socache.h:89
ssl_rsctx_t nCtx
Definition: ssl_private.h:475
Definition: ssl_private.h:389
Definition: ssl_private.h:411
ssl_proto_t protocol
Definition: ssl_private.h:679
size_t apr_size_t
Definition: apr.h:375
const char * ca_name_path
Definition: ssl_private.h:615
Definition: ssl_private.h:429
const char * cpExpr
Definition: ssl_private.h:457
Definition: ssl_private.h:387
apr_status_t modssl_load_engine_keypair(server_rec *s, apr_pool_t *p, const char *vhostid, const char *certid, const char *keyid, X509 **pubkey, EVP_PKEY **privkey)
Definition: ssl_private.h:408
const char * ssl_cmd_SSLOCSPEnable(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLSessionCache(cmd_parms *, void *, const char *)
void ssl_init_Child(apr_pool_t *, server_rec *)
Definition: ssl_private.h:622
server_rec * server
Definition: ssl_private.h:535
apr_array_header_t * aRandSeed
Definition: ssl_private.h:584
SSL_SESSION * ssl_scache_retrieve(server_rec *, IDCONST UCHAR *, int, apr_pool_t *)
int ssl_hook_Upgrade(request_rec *)
int verify_depth
Definition: ssl_private.h:512
int is_proxy
Definition: ssl_private.h:513
DH * ssl_dh_GetParamFromFile(const char *)
Apache Configuration.
const char * ssl_cmd_SSLProxyProtocol(cmd_parms *, void *, const char *)
const char * ocsp_responder
Definition: ssl_private.h:717
int ssl_callback_SSLVerify(int, X509_STORE_CTX *)
const char * ssl_cmd_SSLCADNRequestFile(cmd_parms *, void *, const char *)
modssl_ctx_t * proxy
Definition: ssl_private.h:779
#define IDCONST
Definition: ssl_private.h:159
Definition: ssl_private.h:407
const char * ssl_cmd_SSLProxyCACertificatePath(cmd_parms *, void *, const char *)
ssl_opt_t nOptions
Definition: ssl_private.h:770
const char * ssl_cmd_SSLProxyMachineCertificateFile(cmd_parms *, void *, const char *)
Definition: apr_arch_file_io.h:107
const char * ssl_cmd_SSLProxyCheckPeerCN(cmd_parms *cmd, void *dcfg, int flag)
Definition: apr_tables.h:62
module AP_MODULE_DECLARE_DATA ssl_module
const char * ca_cert_file
Definition: ssl_private.h:626
Definition: ssl_private.h:529
ssl_enabled_t enabled
Definition: ssl_private.h:742
const ap_socache_provider_t * sesscache
Definition: ssl_private.h:580
Definition: ap_expr.h:41
Definition: ssl_private.h:447
const char * ssl_cmd_SSLFIPS(cmd_parms *cmd, void *dcfg, int flag)
int ssl_rand_seed(server_rec *, apr_pool_t *, ssl_rsctx_t, char *)
void * ssl_config_perdir_merge(apr_pool_t *, void *, void *)
int ssl_is_challenge(conn_rec *c, const char *servername, X509 **pcert, EVP_PKEY **pkey)
apr_size_t nRenegBufferSize
Definition: ssl_private.h:777
Definition: ssl_private.h:431
Definition: ssl_private.h:420
ap_socache_instance_t * sesscache_context
Definition: ssl_private.h:581
const char * ssl_cmd_SSLPolicyApply(cmd_parms *, void *, const char *)
const char * ssl_cmd_SSLCryptoDevice(cmd_parms *, void *, const char *)
const char * cert_chain
Definition: ssl_private.h:686
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:552
ssl_verify_t nVerifyClient
Definition: ssl_private.h:774
long ssl_io_data_cb(BIO *, int, const char *, int, long, long)
void ssl_config_global_fix(SSLModConfigRec *)
long ocsp_resp_maxage
Definition: ssl_private.h:719
BOOL insecure_reneg
Definition: ssl_private.h:747
const char * ssl_cmd_SSLOCSPNoVerify(cmd_parms *cmd, void *dcfg, int flag)
ssl_verify_t verify_mode
Definition: ssl_private.h:643
const char * ssl_cmd_SSLCertificateChainFile(cmd_parms *, void *, const char *)
long int nData
Definition: ssl_private.h:485
const dav_resource dav_lockdb dav_lock * request
Definition: mod_dav.h:1332
const char * ssl_cmd_SSLSessionTickets(cmd_parms *, void *, int flag)
const char * ssl_cmd_SSLOCSPResponseTimeSkew(cmd_parms *cmd, void *dcfg, const char *arg)
BOOL compression
Definition: ssl_private.h:756
BOOL proxy_post_config
Definition: ssl_private.h:781
const char * ssl_cmd_SSLHonorCipherOrder(cmd_parms *cmd, void *dcfg, int flag)
const char * verify_info
Definition: ssl_private.h:510
SSLSrvConfigRec * sc
Definition: ssl_private.h:668
apr_status_t ssl_die(server_rec *)
int modssl_request_is_tls(const request_rec *r, SSLConnRec **sslconn)
Definition: ssl_private.h:428
void ssl_var_register(apr_pool_t *p)
apr_status_t ssl_init_Engine(server_rec *, apr_pool_t *)
SSL * ssl
Definition: ssl_private.h:506
const char * ocsp_certs_file
Definition: ssl_private.h:727
void ssl_util_ppclose(server_rec *, apr_pool_t *, apr_file_t *)
const char * ssl_cmd_SSLOCSPResponderTimeout(cmd_parms *cmd, void *dcfg, const char *arg)
APR Standard Headers Support.
apr_status_t ssl_init_ConfigureServer(server_rec *, apr_pool_t *, apr_pool_t *, SSLSrvConfigRec *, apr_array_header_t *)
const char * crl_path
Definition: ssl_private.h:689
modssl_ctx_t * server
Definition: ssl_private.h:748
Definition: ssl_private.h:518
CORE HTTP Daemon.
ssl_asn1_t * ssl_asn1_table_get(apr_hash_t *table, const char *key)
ssl_shutdown_type_e shutdown_type
Definition: ssl_private.h:509
int nVerifyDepth
Definition: ssl_private.h:775
Apache connection library.
const char * ssl_cmd_SSLProxyCipherSuite(cmd_parms *, void *, const char *, const char *)
int ssl_hook_Auth(request_rec *)
Utilities for EBCDIC conversion.
const char * ssl_cmd_SSLProxyVerify(cmd_parms *, void *, const char *)
const char * szCipherSuite
Definition: ssl_private.h:773
apr_array_header_t * key_files
Definition: ssl_private.h:611
const char const char * uri
Definition: mod_dav.h:614
Definition: mod_auth.h:104
Definition: ssl_private.h:472
void ssl_callback_DelSessionCacheEntry(SSL_CTX *, SSL_SESSION *)
int vhost_id_len
Definition: ssl_private.h:744
const char * ssl_cmd_SSLSessionCacheTimeout(cmd_parms *, void *, const char *)
const char * ca_name_file
Definition: ssl_private.h:616
Definition: ssl_private.h:767
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
void void ssl_log_cxerror(const char *file, int line, int level, apr_status_t rv, conn_rec *c, X509 *cert, const char *format,...) __attribute__((format(printf
BOOL ocsp_noverify
Definition: ssl_private.h:724
void modssl_var_extract_dns(apr_table_t *t, SSL *ssl, apr_pool_t *p)
int modssl_is_engine_id(const char *name)
Structure to store things which are per connection.
Definition: httpd.h:1124
Definition: ssl_private.h:470
int modssl_verify_ocsp(X509_STORE_CTX *ctx, SSLSrvConfigRec *sc, server_rec *s, conn_rec *c, apr_pool_t *pool)
APLOG_USE_MODULE(ssl)
const char * ssl_cmd_SSLInsecureRenegotiation(cmd_parms *cmd, void *dcfg, int flag)
Virtual Host package.
APR-UTIL registration of functions exported by modules.
const char * ssl_cmd_SSLCertificateFile(cmd_parms *, void *, const char *)
modssl_pk_proxy_t * pkp
Definition: ssl_private.h:673
const char * cert_file
Definition: ssl_private.h:624
int verify_depth
Definition: ssl_private.h:642
const char * ssl_cmd_SSLOptions(cmd_parms *, void *, const char *)
Definition: ssl_private.h:388
ssl_rssrc_t
Definition: ssl_private.h:468
void ssl_io_filter_init(conn_rec *, request_rec *r, SSL *)
apr_file_t * ssl_util_ppopen(server_rec *, apr_pool_t *, const char *, const char *const *)
Definition: ssl_private.h:386
BOOL ssl_util_vhost_matches(const char *servername, server_rec *s)
apr_global_mutex_t * pMutex
Definition: ssl_private.h:583
Definition: ssl_private.h:466
Definition: apr_arch_global_mutex.h:23
Definition: ssl_private.h:500
const char * ssl_cmd_SSLProxyCARevocationPath(cmd_parms *, void *, const char *)
void * ssl_config_perdir_create(apr_pool_t *, char *)
const char * ssl_cmd_SSLCARevocationFile(cmd_parms *, void *, const char *)
BOOL proxy_enabled
Definition: ssl_private.h:780
Apache Logging library.
const char * ssl_cmd_SSLCADNRequestPath(cmd_parms *, void *, const char *)
Definition: http_config.h:295
Apache script tools.
apr_status_t ssl_load_encrypted_pkey(server_rec *, apr_pool_t *, int, const char *, apr_array_header_t **)
apr_int64_t apr_time_t
Definition: apr_time.h:45
const char * ssl_cmd_SSLProtocol(cmd_parms *, void *, const char *)
Expression parser.
Command line options.
void ssl_util_thread_setup(apr_pool_t *)
ssl_enabled_t
Definition: ssl_private.h:446
APR Global Locking Routines.
Definition: ssl_private.h:499
ssl_rssrc_t nSrc
Definition: ssl_private.h:476
void ssl_config_proxy_merge(apr_pool_t *, SSLDirConfigRec *, SSLDirConfigRec *)
apr_array_header_t * aRequirement
Definition: ssl_private.h:769
HTTP Daemon routines.
const char * cipher_suite
Definition: ssl_private.h:538
modssl_auth_ctx_t auth
Definition: ssl_private.h:712
Definition: ssl_private.h:448
int ssl_opt_t
Definition: ssl_private.h:342
Definition: ssl_private.h:634
const char * ssl_cmd_SSLCARevocationPath(cmd_parms *, void *, const char *)
int ocsp_verify_flags
Definition: ssl_private.h:726
ssl_shutdown_type_e
Definition: ssl_private.h:498
modssl_pk_server_t * pks
Definition: ssl_private.h:672
SSLModConfigRec * mc
Definition: ssl_private.h:741
A structure to store information for each virtual server.
Definition: httpd.h:1311
const char * ssl_cmd_SSLOCSPDefaultResponder(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOCSPResponseMaxAge(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ca_cert_file
Definition: ssl_private.h:637
const char * ssl_cmd_SSLRandomSeed(cmd_parms *, void *, const char *, const char *, const char *)
int protocol_set
Definition: ssl_private.h:680
Definition: ssl_private.h:502
const char * ssl_cmd_SSLStrictSNIVHostCheck(cmd_parms *cmd, void *dcfg, int flag)
Definition: ssl_private.h:608
Definition: ssl_private.h:527
BOOL session_tickets
Definition: ssl_private.h:758
void ssl_var_log_config_register(apr_pool_t *p)
const char * ssl_cmd_SSLEngine(cmd_parms *, void *, const char *)
int service_unavailable
Definition: ssl_private.h:539
int nBytes
Definition: ssl_private.h:478
void ssl_util_thread_id_setup(apr_pool_t *)
const char * verify_error
Definition: ssl_private.h:511
const char * tls13_ciphers
Definition: ssl_private.h:648
const char * ssl_cmd_SSLProxyCARevocationFile(cmd_parms *, void *, const char *)
const char * ssl_cmd_SSLVerifyClient(cmd_parms *, void *, const char *)
int ssl_hook_Access(request_rec *)
BOOL bFixed
Definition: ssl_private.h:573
int ssl_hook_Fixup(request_rec *)
APR Table library.
char * ssl_var_lookup(apr_pool_t *, server_rec *, conn_rec *, request_rec *, char *)
pid_t pid
Definition: ssl_private.h:571
Small object cache provider interface.
char * cpPath
Definition: ssl_private.h:477
const char * ssl_cmd_SSLRenegBufferSize(cmd_parms *cmd, void *dcfg, const char *arg)
Definition: ssl_private.h:465
Definition: ssl_private.h:419
ssl_verify_t
Definition: ssl_private.h:384
DH * ssl_callback_TmpDH(SSL *, int, int)
APR FNMatch Functions.
const char * ssl_cmd_SSLPassPhraseDialog(cmd_parms *, void *, const char *)
BOOL ssl_util_path_check(ssl_pathcheck_t, const char *, apr_pool_t *)
Definition: ssl_private.h:471
X509 * client_cert
Definition: ssl_private.h:508
APR Platform Definitions.
void ssl_init_ocsp_certificates(server_rec *s, modssl_ctx_t *mctx)
Definition: ssl_private.h:667
const authz_provider ssl_authz_provider_verify_client
void ssl_callback_Info(const SSL *, int, int)
apr_uri_t * proxy_uri
Definition: ssl_private.h:722
APR general purpose library routines.
const char * ssl_cmd_SSLCARevocationCheck(cmd_parms *, void *, const char *)
SSLDirConfigRec * dc
Definition: ssl_private.h:536
OCSP_RESPONSE * modssl_dispatch_ocsp_request(const apr_uri_t *uri, apr_interval_time_t timeout, OCSP_REQUEST *request, conn_rec *c, apr_pool_t *p)
const char * ssl_cmd_SSLRequireSSL(cmd_parms *, void *)
#define BOOL
Definition: ssl_private.h:79
int ssl_stapling_mutex_reinit(server_rec *, apr_pool_t *)
Authentication and Authorization Extension for Apache.
const char * ssl_cmd_SSLProxyVerifyDepth(cmd_parms *, void *, const char *)
BOOL cipher_server_pref
Definition: ssl_private.h:746
apr_hash_t * tPrivateKey
Definition: ssl_private.h:591
char * ssl_util_vhostid(apr_pool_t *, server_rec *)
const char * pphrase_dialog_path
Definition: ssl_private.h:684
struct apr_hash_t apr_hash_t
Definition: apr_hash.h:52
HTTP protocol handling.
BOOL ssl_config_global_isfixed(SSLModConfigRec *)
int disabled
Definition: ssl_private.h:514
const char * szUserName
Definition: ssl_private.h:776
apr_time_t source_mtime
Definition: ssl_private.h:487
Definition: apr_uri.h:85
const char * ssl_cmd_SSLProxyCARevocationCheck(cmd_parms *, void *, const char *)
char * ssl_util_readfilter(server_rec *, apr_pool_t *, const char *, const char *const *)
const char * ssl_cmd_SSLProxyCheckPeerExpire(cmd_parms *cmd, void *dcfg, int flag)
Definition: ssl_private.h:421
apr_pool_t * p
apr_status_t ssl_init_CheckServers(server_rec *, apr_pool_t *)
int ssl_proto_t
Definition: ssl_private.h:379
const char * ssl_cmd_SSLOCSPUseRequestNonce(cmd_parms *cmd, void *dcfg, int flag)
ssl_opt_t nOptionsDel
Definition: ssl_private.h:772
* ssl_init_FindCAList(server_rec *, apr_pool_t *, const char *, const char *)
ssl_crlcheck_t
Definition: ssl_private.h:405
Apache Mutex support library.
const char * ssl_cmd_SSLOCSPOverrideResponder(cmd_parms *cmd, void *dcfg, int flag)
long ocsp_resptime_skew
Definition: ssl_private.h:718
ssl_asn1_t * ssl_asn1_table_set(apr_hash_t *table, const char *key, EVP_PKEY *pkey)
void ssl_io_filter_register(apr_pool_t *)
void * ssl_config_server_create(apr_pool_t *, server_rec *)
const char * ssl_cmd_SSLOCSPProxyURL(cmd_parms *cmd, void *dcfg, const char *arg)
#define SSL_CRLCHECK_FLAGS
Definition: ssl_private.h:410
#define AP_MODULE_DECLARE_DATA
Definition: macros.h:16
Definition: ssl_private.h:501
Definition: ssl_private.h:484
int ssl_mutex_init(server_rec *, apr_pool_t *)
SSLSrvConfigRec * ssl_policy_lookup(apr_pool_t *pool, const char *name)
const char * client_dn
Definition: ssl_private.h:507
apr_status_t ssl_init_Module(apr_pool_t *, apr_pool_t *, apr_pool_t *, server_rec *)
const char * ssl_cmd_SSLCompression(cmd_parms *, void *, int flag)
unsigned char * cpData
Definition: ssl_private.h:486
const char * ssl_cmd_SSLCACertificatePath(cmd_parms *, void *, const char *)
#define UCHAR
Definition: ssl_private.h:275
Apache Request library.
A structure that represents the current request.
Definition: httpd.h:811
apr_array_header_t * cert_files
Definition: ssl_private.h:610
void modssl_var_extract_san_entries(apr_table_t *t, SSL *ssl, apr_pool_t *p)
Definition: ssl_private.h:449
const char * cert_path
Definition: ssl_private.h:625
Apache filter library.
Definition: ssl_private.h:517
long sesscache_mode
Definition: ssl_private.h:576
apr_interval_time_t ocsp_responder_timeout
Definition: ssl_private.h:720
Definition: ssl_private.h:740
APR Strings library.
int ssl_mutex_off(server_rec *)
apr_status_t ssl_init_ModuleKill(void *data)
int ssl_proxy_section_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s, ap_conf_vector_t *section_config)
ap_expr_info_t * mpExpr
Definition: ssl_private.h:458
BOOL ocsp_force_default
Definition: ssl_private.h:715
const char * ssl_cmd_SSLOCSPResponderCertificateFile(cmd_parms *cmd, void *dcfg, const char *arg)
BOOL ssl_check_peer_name
Definition: ssl_private.h:736
int ssl_callback_proxy_cert(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
Definition: ssl_private.h:570
const char * ssl_cmd_SSLCACertificateFile(cmd_parms *, void *, const char *)
void ssl_scache_status_register(apr_pool_t *p)
apr_array_header_t * ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer, const char *extension)
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
BOOL ssl_check_peer_expire
Definition: ssl_private.h:737
#define __attribute__(__x)
Definition: apr.h:63
const char * name
Definition: mod_dav.h:726
int service_unavailable
Definition: ssl_private.h:619
Definition: ssl_private.h:406
void ssl_hook_ConfigTest(apr_pool_t *pconf, server_rec *s)
const char * vhost_id
Definition: ssl_private.h:743
void ssl_asn1_table_unset(apr_hash_t *table, const char *key)
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
const char * ca_cert_path
Definition: ssl_private.h:636
Definition: http_config.h:355
apr_status_t ssl_scache_init(server_rec *, apr_pool_t *)
int ssl_callback_NewSessionCacheEntry(SSL *, SSL_SESSION *)
const char * ssl_cmd_SSLCertificateKeyFile(cmd_parms *, void *, const char *)
BOOL ssl_check_peer_cn
Definition: ssl_private.h:735
int apr_status_t
Definition: apr_errno.h:44
ssl_opt_t nOptionsAdd
Definition: ssl_private.h:771
const authz_provider ssl_authz_provider_require_ssl
request_rec * r
Definition: mod_dav.h:515
ssl_ocspcheck_t
Definition: ssl_private.h:417
BOOL ssl_scache_store(server_rec *, IDCONST UCHAR *, int, apr_time_t, SSL_SESSION *, apr_pool_t *)
int ssl_hook_ReadReq(request_rec *)
void ssl_log_xerror(const char *file, int line, int level, apr_status_t rv, apr_pool_t *p, server_rec *s, X509 *cert, const char *format,...) __attribute__((format(printf
const char * ssl_cmd_SSLVerifyDepth(cmd_parms *, void *, const char *)
const char * ssl_cmd_SSLProxyCACertificateFile(cmd_parms *, void *, const char *)
void void void ssl_log_rxerror(const char *file, int line, int level, apr_status_t rv, request_rec *r, X509 *cert, const char *format,...) __attribute__((format(printf
void ssl_scache_remove(server_rec *, IDCONST UCHAR *, int, apr_pool_t *)
SSL_CTX * ssl_ctx
Definition: ssl_private.h:669
SSL_SESSION * ssl_callback_GetSessionCacheEntry(SSL *, IDCONST unsigned char *, int, int *)
int crl_check_mask
Definition: ssl_private.h:691
const char * ssl_cmd_SSLProxyMachineCertificateChainFile(cmd_parms *, void *, const char *)
Additional Utility Functions for OpenSSL.
void ssl_scache_kill(server_rec *)
const char * ssl_cmd_SSLProxyMachineCertificatePath(cmd_parms *, void *, const char *)
Definition: ssl_private.h:430
struct ap_conf_vector_t ap_conf_vector_t
Definition: http_config.h:519
Definition: ssl_private.h:450
Definition: ssl_private.h:418
const char * ssl_cmd_SSLCipherSuite(cmd_parms *, void *, const char *, const char *)
const char * crl_file
Definition: ssl_private.h:690
const char * ssl_cmd_SSLUserName(cmd_parms *, void *, const char *)
void ssl_log_ssl_error(const char *, int, int, server_rec *)
const char * cipher_suite
Definition: ssl_private.h:639
SSLModConfigRec * ssl_config_global_create(server_rec *)
int ssl_hook_UserCheck(request_rec *)
void * ssl_config_server_merge(apr_pool_t *, void *, void *)
int ssl_mutex_on(server_rec *)
unsigned int ssl_pathcheck_t
Definition: ssl_private.h:441
int ssl_mutex_reinit(server_rec *, apr_pool_t *)
int ssl_init_ssl_connection(conn_rec *c, request_rec *r)
int ocsp_mask
Definition: ssl_private.h:714
DH * modssl_get_dh_params(unsigned keylen)
ssl_pphrase_t
Definition: ssl_private.h:427
apr_hash_t * tVHostKeys
Definition: ssl_private.h:585
int session_cache_timeout
Definition: ssl_private.h:745
Definition: ssl_private.h:456
BOOL ocsp_use_request_nonce
Definition: ssl_private.h:721
int ssl_callback_SSLVerify_CRL(int, X509_STORE_CTX *, conn_rec *)
Definition: ssl_private.h:474
ssl_rsctx_t
Definition: ssl_private.h:464
const char * ssl_cmd_SSLProxyEngine(cmd_parms *cmd, void *dcfg, int flag)
#define UNSET
Definition: ssl_private.h:261
BOOL bSSLRequired
Definition: ssl_private.h:768
ssl_pphrase_t pphrase_dialog_type
Definition: ssl_private.h:683
int ssl_io_buffer_fill(request_rec *r, apr_size_t maxlen)
Definition: ssl_private.h:385
#define STACK_OF(x)
Definition: macros.h:26
struct ap_socache_instance_t ap_socache_instance_t
Definition: ap_socache.h:49
Definition: ssl_private.h:505
const char * ssl_cmd_SSLProxyCheckPeerName(cmd_parms *cmd, void *dcfg, int flag)