summaryrefslogtreecommitdiffstats
path: root/openssl.h
blob: 562e36c3f19590bb3a3dfe0c5bc3f7b46065a649 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef _LDADP_OPENSSL_H_
#define _LDADP_OPENSSL_H_

#include "types.h"
#include <openssl/ssl.h>
#include <openssl/err.h>

#define SSL_BLOCKED(err) ((err) == SSL_ERROR_WANT_READ || (err) == SSL_ERROR_WANT_WRITE || (err) == SSL_ERROR_WANT_X509_LOOKUP || (err) == SSL_ERROR_WANT_CONNECT || (err) == SSL_ERROR_WANT_ACCEPT)

void ssl_printErrors(char *bailMsg);

BOOL ssl_init();

SSL_CTX* ssl_newServerCtx(char *certfile, char *keyfile);

SSL_CTX* ssl_newClientCtx(const char *cabundle);

SSL *ssl_new(int clientFd, SSL_CTX *ctx);

BOOL ssl_acceptClient(epoll_client_t *client);

BOOL ssl_connectServer(epoll_server_t *server);

BOOL ssl_checkCertificateHash(epoll_server_t *server);

#endif