1 /* -*- Mode: C; c-file-style: "bsd" -*- */
3 * easy-tls.h -- generic TLS proxy.
4 * Id: easy-tls.h,v 1.1 2001/09/17 19:06:59 bodo Exp
7 * (c) Copyright 1999 Bodo Moeller. All rights reserved.
14 typedef struct ssl_ctx_st SSL_CTX
;
17 # define TLS_INFO_SIZE 512 /* max. # of bytes written to infofd */
19 void tls_set_dhe1024(int i
, void *apparg
);
21 * Generate DHE parameters: i >= 0 deterministic (i selects seed), i < 0
22 * random (may take a while). tls_create_ctx calls this with random
23 * non-negative i if the application has never called it.
26 void tls_rand_seed(void);
27 int tls_rand_seed_from_file(const char *filename
, size_t n
, void *apparg
);
28 void tls_rand_seed_from_memory(const void *buf
, size_t n
);
30 struct tls_create_ctx_args
{
32 const char *certificate_file
;
36 int fail_unless_verified
;
39 struct tls_create_ctx_args
tls_create_ctx_defaultargs(void);
41 * struct tls_create_ctx_args is similar to a conventional argument list, but
42 * it can provide default values and allows for future extension.
44 SSL_CTX
*tls_create_ctx(struct tls_create_ctx_args
, void *apparg
);
46 struct tls_start_proxy_args
{
53 struct tls_start_proxy_args
tls_start_proxy_defaultargs(void);
55 * tls_start_proxy return value *MUST* be checked! 0 means ok, otherwise
56 * we've probably run out of some resources.
58 int tls_start_proxy(struct tls_start_proxy_args
, void *apparg
);