forked from jcramb/revshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ssl.h
54 lines (38 loc) · 1.1 KB
/
ssl.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
////////////////////////////////////////////////////////////////////////////////
// ssl.h
// author: [email protected]
#ifndef ssl_h
#define ssl_h
#include <openssl/ssl.h>
#include <string>
#include "core.h"
#include "sock.h"
////////////////////////////////////////////////////////////////////////////////
// defines
#define SSL_OPT_HOST 1
#define SSL_OPT_PORT 2
////////////////////////////////////////////////////////////////////////////////
// OpenSSL implementation of transport interface
class ssl_transport : public transport {
public:
// ctors / dtors
ssl_transport();
virtual ~ssl_transport();
// transport interface
virtual int init(int type);
virtual int send(message & msg);
virtual int recv(message & msg);
virtual void setopt(int opt, std::string value);
virtual void close();
protected:
// transport options
int m_opt_port;
std::string m_opt_host;
// socket wrapper
tcp_stream m_tcp;
// openssl members
SSL * m_ssl;
SSL_CTX * m_ctx;
};
////////////////////////////////////////////////////////////////////////////////
#endif // ssl_h