Apache HTTPD
tls_util.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#ifndef tls_util_h
17#define tls_util_h
18
19#define TLS_DIM(a) (sizeof(a)/sizeof(a[0]))
20
21
25typedef struct tls_data_t tls_data_t;
26struct tls_data_t {
27 const unsigned char* data;
29};
30
34tls_data_t tls_data_from_str(const char *s);
35
40
45
50const char *tls_data_to_str(apr_pool_t *p, const tls_data_t *d);
51
55int tls_util_is_file(apr_pool_t *p, const char *fpath);
56
62
69 apr_pool_t *p, const char *fpath, size_t min_len, size_t max_len, tls_data_t *data);
70
75
82
92
103
112
119
120
126 apr_bucket *b, const char *sep);
127
134 const char *tag, const char *sep,
145#define tls_util_bb_log(c, level, tag, bb) \
146do { \
147 char buffer[4 * 1024]; \
148 const char *line = "(null)"; \
149 apr_size_t len, bmax = sizeof(buffer)/sizeof(buffer[0]); \
150 len = tls_util_bb_print(buffer, bmax, (tag), "", (bb)); \
151 ap_log_cerror(APLOG_MARK, level, 0, (c), "bb_dump(%ld): %s", \
152 ((c)->master? (c)->master->id : (c)->id), (len? buffer : line)); \
153} while(0)
154
155
156
157#endif /* tls_util_h */
int n
Definition ap_regex.h:278
apr_size_t const unsigned char unsigned int unsigned int d
Definition apr_siphash.h:72
apr_read_type_e
Definition apr_buckets.h:57
apr_bucket apr_bucket_brigade * a
int apr_off_t * length
const char * src
Definition apr_encode.h:167
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
void * data
char * buffer
apr_pool_t * b
Definition apr_pools.h:529
const char * sep
const char * s
Definition apr_strings.h:95
apr_pool_t * p
Definition md_event.c:32
char * name
A structure to store information for each virtual server.
Definition httpd.h:1322
apr_size_t len
Definition tls_util.h:28
const unsigned char * data
Definition tls_util.h:27
apr_size_t tls_util_bucket_print(char *buffer, apr_size_t bmax, apr_bucket *b, const char *sep)
Definition tls_util.c:316
apr_status_t tls_util_brigade_transfer(apr_bucket_brigade *dest, apr_bucket_brigade *src, apr_off_t length, apr_off_t *pnout)
Definition tls_util.c:175
int tls_util_name_matches_server(const char *name, server_rec *s)
Definition tls_util.c:292
int tls_util_is_file(apr_pool_t *p, const char *fpath)
Definition tls_util.c:79
tls_data_t tls_data_from_str(const char *s)
Definition tls_util.c:35
tls_data_t tls_data_assign_copy(apr_pool_t *p, const tls_data_t *d)
Definition tls_util.c:43
apr_size_t tls_util_bb_print(char *buffer, apr_size_t bmax, const char *tag, const char *sep, apr_bucket_brigade *bb)
Definition tls_util.c:338
apr_status_t tls_util_file_load(apr_pool_t *p, const char *fpath, size_t min_len, size_t max_len, tls_data_t *data)
apr_status_t tls_util_rustls_error(apr_pool_t *p, rustls_result rr, const char **perr_descr)
Definition tls_util.c:66
apr_status_t tls_util_brigade_copy(apr_bucket_brigade *dest, apr_bucket_brigade *src, apr_off_t length, apr_off_t *pnout)
Definition tls_util.c:219
tls_data_t * tls_data_copy(apr_pool_t *p, const tls_data_t *d)
Definition tls_util.c:51
apr_status_t tls_util_brigade_split_line(apr_bucket_brigade *dest, apr_bucket_brigade *src, apr_read_type_e block, apr_off_t length, apr_off_t *pnout)
Definition tls_util.c:265
const apr_array_header_t * tls_util_array_uint16_remove(apr_pool_t *pool, const apr_array_header_t *from, const apr_array_header_t *others)
Definition tls_util.c:150
int tls_util_array_uint16_contains(const apr_array_header_t *a, apr_uint16_t n)
Definition tls_util.c:141
const char * tls_data_to_str(apr_pool_t *p, const tls_data_t *d)
Definition tls_util.c:59