1 /* source: xio-openssl.h */
2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
3 /* Published under the GNU General Public License V.2, see file COPYING */
4 
5 #ifndef __xio_openssl_included
6 #define __xio_openssl_included 1
7 
8 #if WITH_OPENSSL	/* make this address configure dependend */
9 
10 #define SSLIO_BASE 0x53530000	/* "SSxx" */
11 #define SSLIO_MASK 0xffff0000
12 
13 extern const struct addrdesc xioaddr_openssl;
14 extern const struct addrdesc xioaddr_openssl_listen;
15 extern const struct addrdesc xioaddr_openssl_dtls_client;
16 extern const struct addrdesc xioaddr_openssl_dtls_server;
17 
18 extern const struct optdesc opt_openssl_cipherlist;
19 extern const struct optdesc opt_openssl_method;
20 extern const struct optdesc opt_openssl_min_proto_version;
21 extern const struct optdesc opt_openssl_max_proto_version;
22 extern const struct optdesc opt_openssl_verify;
23 extern const struct optdesc opt_openssl_certificate;
24 extern const struct optdesc opt_openssl_key;
25 extern const struct optdesc opt_openssl_dhparam;
26 extern const struct optdesc opt_openssl_cafile;
27 extern const struct optdesc opt_openssl_capath;
28 extern const struct optdesc opt_openssl_egd;
29 extern const struct optdesc opt_openssl_pseudo;
30 #if OPENSSL_VERSION_NUMBER >= 0x00908000L
31 extern const struct optdesc opt_openssl_compress;
32 #endif
33 #if WITH_FIPS
34 extern const struct optdesc opt_openssl_fips;
35 #endif
36 extern const struct optdesc opt_openssl_commonname;
37 extern const struct optdesc opt_openssl_no_sni;
38 extern const struct optdesc opt_openssl_snihost;
39 
40 extern int
41    _xioopen_openssl_prepare(struct opt *opts, struct single *xfd,
42 			    bool server, bool *opt_ver, const char *opt_cert,
43 			    SSL_CTX **ctx, bool *use_dtls);
44 extern int
45    _xioopen_openssl_connect(struct single *xfd,  bool opt_ver,
46 			    const char *opt_commonname,
47 			    bool no_sni, const char *snihost,
48 			    SSL_CTX *ctx, int level);
49 extern int
50    _xioopen_openssl_listen(struct single *xfd, bool opt_ver,
51 			   const char *opt_commonname,
52 			   SSL_CTX *ctx, int level);
53 extern int xioclose_openssl(xiofile_t *xfd);
54 extern int xioshutdown_openssl(struct single *sfd, int how);
55 extern ssize_t xioread_openssl(struct single *file, void *buff, size_t bufsiz);
56 extern ssize_t xiopending_openssl(struct single *pipe);
57 extern ssize_t xiowrite_openssl(struct single *file, const void *buff, size_t bufsiz);
58 
59 #if WITH_FIPS
60 extern int xio_reset_fips_mode(void);
61 #endif /* WITH_FIPS */
62 
63 #endif /* WITH_OPENSSL */
64 
65 #endif /* !defined(__xio_openssl_included) */
66