Apache2
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 
25 typedef struct tls_data_t tls_data_t;
26 struct tls_data_t {
27  const unsigned char* data;
29 };
30 
35 
40 
45 
50 const char *tls_data_to_str(apr_pool_t *p, const tls_data_t *d);
51 
55 int tls_util_is_file(apr_pool_t *p, const char *fpath);
56 
61 apr_status_t tls_util_rustls_error(apr_pool_t *p, rustls_result rr, const char **perr_descr);
62 
69  apr_pool_t *p, const char *fpath, size_t min_len, size_t max_len, tls_data_t *data);
70 
75 
81  apr_pool_t *pool, const apr_array_header_t* from, const apr_array_header_t* others);
82 
91  apr_off_t *pnout);
92 
102  apr_off_t *pnout);
103 
111  apr_off_t *pnout);
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) \
146 do { \
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 */
apr_read_type_e
Definition: apr_buckets.h:62
apr_bucket_brigade * bb
Definition: mod_dav.h:555
const char * s
Definition: mod_dav.h:1327
dav_error * src
Definition: mod_dav.h:186
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
const char * name
Definition: mod_dav.h:805
apr_bucket_brigade ap_input_mode_t apr_read_type_e block
Definition: mod_dav.h:2663
int apr_status_t
Definition: apr_errno.h:44
unsigned short apr_uint16_t
Definition: apr.h:345
off_t apr_off_t
Definition: apr.h:396
size_t apr_size_t
Definition: apr.h:394
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
Definition: apr_tables.h:62
Definition: apr_buckets.h:263
Definition: apr_buckets.h:229
A structure to store information for each virtual server.
Definition: httpd.h:1382
Definition: tls_util.h:26
apr_size_t len
Definition: tls_util.h:28
const unsigned char * data
Definition: tls_util.h:27
apr_pool_t * p
apr_size_t tls_util_bucket_print(char *buffer, apr_size_t bmax, apr_bucket *b, const char *sep)
apr_status_t tls_util_brigade_transfer(apr_bucket_brigade *dest, apr_bucket_brigade *src, apr_off_t length, apr_off_t *pnout)
int tls_util_name_matches_server(const char *name, server_rec *s)
tls_data_t * tls_data_copy(apr_pool_t *p, const tls_data_t *d)
int tls_util_is_file(apr_pool_t *p, const char *fpath)
tls_data_t tls_data_from_str(const char *s)
const char * tls_data_to_str(apr_pool_t *p, const tls_data_t *d)
tls_data_t tls_data_assign_copy(apr_pool_t *p, const tls_data_t *d)
apr_size_t tls_util_bb_print(char *buffer, apr_size_t bmax, const char *tag, const char *sep, apr_bucket_brigade *bb)
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)
apr_status_t tls_util_brigade_copy(apr_bucket_brigade *dest, apr_bucket_brigade *src, apr_off_t length, apr_off_t *pnout)
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)
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)
int tls_util_array_uint16_contains(const apr_array_header_t *a, apr_uint16_t n)