Deleted Added
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_TLS_H_INCLUDED_
8#define _NXT_TLS_H_INCLUDED_

--- 15 unchanged lines hidden (view full) ---

24 */
25
26#define NXT_TLS_BUFFER_SIZE 4096
27
28
29typedef struct nxt_tls_conf_s nxt_tls_conf_t;
30typedef struct nxt_tls_bundle_conf_s nxt_tls_bundle_conf_t;
31typedef struct nxt_tls_init_s nxt_tls_init_t;
32typedef struct nxt_tls_ticket_s nxt_tls_ticket_t;
33typedef struct nxt_tls_tickets_s nxt_tls_tickets_t;
34
35typedef struct {
36 nxt_int_t (*library_init)(nxt_task_t *task);
37 void (*library_free)(nxt_task_t *task);
38
39 nxt_int_t (*server_init)(nxt_task_t *task, nxt_mp_t *mp,
40 nxt_tls_init_t *tls_init,
41 nxt_bool_t last);

--- 18 unchanged lines hidden (view full) ---

60 nxt_tls_bundle_conf_t *next;
61};
62
63
64struct nxt_tls_conf_s {
65 nxt_tls_bundle_conf_t *bundle;
66 nxt_lvlhsh_t bundle_hash;
67
68 nxt_tls_tickets_t *tickets;
69
70 void (*conn_init)(nxt_task_t *task,
71 nxt_tls_conf_t *conf, nxt_conn_t *c);
72
73 const nxt_tls_lib_t *lib;
74
75 char *ciphers;
76
77 char *ca_certificate;
78
79 size_t buffer_size;
80
81 uint8_t no_wait_shutdown; /* 1 bit */
82};
83
84
85struct nxt_tls_init_s {
86 size_t cache_size;
87 nxt_time_t timeout;
88 nxt_conf_value_t *conf_cmds;
89 nxt_conf_value_t *tickets_conf;
90
91 nxt_tls_conf_t *conf;
92};
93
94
95struct nxt_tls_ticket_s {
96 uint8_t aes128;
97 u_char name[16];
98 u_char hmac_key[32];
99 u_char aes_key[32];
100};
101
102
103struct nxt_tls_tickets_s {
104 nxt_uint_t count;
105 nxt_tls_ticket_t tickets[];
106};
107
108
109#if (NXT_HAVE_OPENSSL)
110extern const nxt_tls_lib_t nxt_openssl_lib;
111
112void nxt_cdecl nxt_openssl_log_error(nxt_task_t *task, nxt_uint_t level,
113 const char *fmt, ...);
114u_char *nxt_openssl_copy_error(u_char *p, u_char *end);
115nxt_int_t nxt_openssl_base64_decode(u_char *d, size_t dlen, const u_char *s,
116 size_t slen);
117#endif
118
119#if (NXT_HAVE_GNUTLS)
120extern const nxt_tls_lib_t nxt_gnutls_lib;
121#endif
122
123#if (NXT_HAVE_CYASSL)
124extern const nxt_tls_lib_t nxt_cyassl_lib;
125#endif
126
127#if (NXT_HAVE_POLARSSL)
128extern const nxt_tls_lib_t nxt_polar_lib;
129#endif
130
131
132#endif /* _NXT_TLS_H_INCLUDED_ */