/ tls_client / tls_server.h
tls_server.h
 1  //
 2  //  tls_server.h
 3  //  coretls_server
 4  //
 5  
 6  #ifndef __TLS_SERVER_H__
 7  #define __TLS_SERVER_H__
 8  
 9  #include <tls_handshake.h>
10  #include <tls_record.h>
11  #include <tls_stream_parser.h>
12  
13  #include <CoreFoundation/CoreFoundation.h>
14  
15  
16  typedef struct {
17      const char *hostname;
18      int port;
19      const char *config;
20      int protocol_min;
21      int protocol_max;
22      const uint16_t *ciphersuites;
23      int num_ciphersuites;
24      bool allow_resumption;
25      bool allow_renegotiation;
26      uintptr_t session_id;
27      SSLCertificate cert1;
28      SSLCertificate cert2;
29      tls_private_key_t key1;
30      tls_private_key_t key2;
31      tls_buffer *ocsp;
32      tls_buffer *dh_parameters;
33      const char *alpn_string;
34      const char *request;
35      bool rsa_server_key_exchange;
36      bool client_auth;
37      bool use_kext;
38      bool dtls;
39      bool verbose;
40      bool allow_ext_master_secret;
41  } tls_server_params;
42  
43  
44  typedef struct {
45      int sock;
46      struct sockaddr_in address; //for udp only.
47  
48      dispatch_queue_t write_queue;
49      tls_record_t rec;
50      tls_handshake_t hdsk;
51      tls_stream_parser_t parser;
52      tls_server_params *params;
53  
54      int err;
55      int read_ready_received;
56      int write_ready_received;
57      int certificate_requested;
58      bool renegotiation_requested;
59      bool response_sent;
60  } tls_server_ctx_t;
61  
62  
63  #endif /* __TLS_SERVER_H__ */