Updated to hostap_2_6
[mech_eap.git] / libeap / src / crypto / tls.h
1 /*
2  * SSL/TLS interface definition
3  * Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8
9 #ifndef TLS_H
10 #define TLS_H
11
12 #include <openssl/x509.h>
13
14 struct tls_connection;
15
16 struct tls_random {
17         const u8 *client_random;
18         size_t client_random_len;
19         const u8 *server_random;
20         size_t server_random_len;
21 };
22
23 enum tls_event {
24         TLS_CERT_CHAIN_SUCCESS,
25         TLS_CERT_CHAIN_FAILURE,
26         TLS_PEER_CERTIFICATE,
27         TLS_ALERT
28 };
29
30 /*
31  * Note: These are used as identifier with external programs and as such, the
32  * values must not be changed.
33  */
34 enum tls_fail_reason {
35         TLS_FAIL_UNSPECIFIED = 0,
36         TLS_FAIL_UNTRUSTED = 1,
37         TLS_FAIL_REVOKED = 2,
38         TLS_FAIL_NOT_YET_VALID = 3,
39         TLS_FAIL_EXPIRED = 4,
40         TLS_FAIL_SUBJECT_MISMATCH = 5,
41         TLS_FAIL_ALTSUBJECT_MISMATCH = 6,
42         TLS_FAIL_BAD_CERTIFICATE = 7,
43         TLS_FAIL_SERVER_CHAIN_PROBE = 8,
44         TLS_FAIL_DOMAIN_SUFFIX_MISMATCH = 9,
45         TLS_FAIL_DOMAIN_MISMATCH = 10,
46 };
47
48
49 #define TLS_MAX_ALT_SUBJECT 10
50
51 union tls_event_data {
52         struct {
53                 int depth;
54                 const char *subject;
55                 enum tls_fail_reason reason;
56                 const char *reason_txt;
57                 const struct wpabuf *cert;
58         } cert_fail;
59
60         struct {
61                 int depth;
62                 const char *subject;
63                 const struct wpabuf *cert;
64                 const u8 *hash;
65                 size_t hash_len;
66                 const char *altsubject[TLS_MAX_ALT_SUBJECT];
67                 int num_altsubject;
68         } peer_cert;
69
70         struct {
71                 int is_local;
72                 const char *type;
73                 const char *description;
74         } alert;
75 };
76
77 struct tls_config {
78         const char *opensc_engine_path;
79         const char *pkcs11_engine_path;
80         const char *pkcs11_module_path;
81         int fips_mode;
82         int cert_in_cb;
83         const char *openssl_ciphers;
84         unsigned int tls_session_lifetime;
85
86         void (*event_cb)(void *ctx, enum tls_event ev,
87                          union tls_event_data *data);
88         void *cb_ctx;
89 };
90
91 #define TLS_CONN_ALLOW_SIGN_RSA_MD5 BIT(0)
92 #define TLS_CONN_DISABLE_TIME_CHECKS BIT(1)
93 #define TLS_CONN_DISABLE_SESSION_TICKET BIT(2)
94 #define TLS_CONN_REQUEST_OCSP BIT(3)
95 #define TLS_CONN_REQUIRE_OCSP BIT(4)
96 #define TLS_CONN_DISABLE_TLSv1_1 BIT(5)
97 #define TLS_CONN_DISABLE_TLSv1_2 BIT(6)
98 #define TLS_CONN_EAP_FAST BIT(7)
99 #define TLS_CONN_DISABLE_TLSv1_0 BIT(8)
100 #define TLS_CONN_EXT_CERT_CHECK BIT(9)
101 #define TLS_CONN_REQUIRE_OCSP_ALL BIT(10)
102
103 struct X509; /* from OpenSSL */
104
105 /**
106  * struct tls_connection_params - Parameters for TLS connection
107  * @ca_cert: File or reference name for CA X.509 certificate in PEM or DER
108  * format
109  * @ca_cert_blob: ca_cert as inlined data or %NULL if not used
110  * @ca_cert_blob_len: ca_cert_blob length
111  * @ca_path: Path to CA certificates (OpenSSL specific)
112  * @subject_match: String to match in the subject of the peer certificate or
113  * %NULL to allow all subjects
114  * @altsubject_match: String to match in the alternative subject of the peer
115  * certificate or %NULL to allow all alternative subjects
116  * @suffix_match: String to suffix match in the dNSName or CN of the peer
117  * certificate or %NULL to allow all domain names. This may allow subdomains an
118  * wildcard certificates. Each domain name label must have a full match.
119  * @domain_match: String to match in the dNSName or CN of the peer
120  * certificate or %NULL to allow all domain names. This requires a full,
121  * case-insensitive match.
122  * @client_cert: File or reference name for client X.509 certificate in PEM or
123  * DER format
124  * @client_cert_blob: client_cert as inlined data or %NULL if not used
125  * @client_cert_blob_len: client_cert_blob length
126  * @private_key: File or reference name for client private key in PEM or DER
127  * format (traditional format (RSA PRIVATE KEY) or PKCS#8 (PRIVATE KEY)
128  * @private_key_blob: private_key as inlined data or %NULL if not used
129  * @private_key_blob_len: private_key_blob length
130  * @private_key_passwd: Passphrase for decrypted private key, %NULL if no
131  * passphrase is used.
132  * @dh_file: File name for DH/DSA data in PEM format, or %NULL if not used
133  * @dh_blob: dh_file as inlined data or %NULL if not used
134  * @dh_blob_len: dh_blob length
135  * @engine: 1 = use engine (e.g., a smartcard) for private key operations
136  * (this is OpenSSL specific for now)
137  * @engine_id: engine id string (this is OpenSSL specific for now)
138  * @ppin: pointer to the pin variable in the configuration
139  * (this is OpenSSL specific for now)
140  * @key_id: the private key's id when using engine (this is OpenSSL
141  * specific for now)
142  * @cert_id: the certificate's id when using engine
143  * @ca_cert_id: the CA certificate's id when using engine
144  * @openssl_ciphers: OpenSSL cipher configuration
145  * @flags: Parameter options (TLS_CONN_*)
146  * @ocsp_stapling_response: DER encoded file with cached OCSP stapling response
147  *      or %NULL if OCSP is not enabled
148  * @ocsp_stapling_response_multi: DER encoded file with cached OCSP stapling
149  *      response list (OCSPResponseList for ocsp_multi in RFC 6961) or %NULL if
150  *      ocsp_multi is not enabled
151  * @server_cert_cb: Optional callback to be used to validate server certificate
152  *  when no CA or path was specified. 
153  * @server_cert_ctx: Optional context arg for server_cert_cb.
154  *
155  * TLS connection parameters to be configured with tls_connection_set_params()
156  * and tls_global_set_params().
157  *
158  * Certificates and private key can be configured either as a reference name
159  * (file path or reference to certificate store) or by providing the same data
160  * as a pointer to the data in memory. Only one option will be used for each
161  * field.
162  */
163 struct tls_connection_params {
164         const char *ca_cert;
165         const u8 *ca_cert_blob;
166         size_t ca_cert_blob_len;
167         const char *ca_path;
168         const char *subject_match;
169         const char *altsubject_match;
170         const char *suffix_match;
171         const char *domain_match;
172         const char *client_cert;
173         const u8 *client_cert_blob;
174         size_t client_cert_blob_len;
175         const char *private_key;
176         const u8 *private_key_blob;
177         size_t private_key_blob_len;
178         const char *private_key_passwd;
179         const char *dh_file;
180         const u8 *dh_blob;
181         size_t dh_blob_len;
182
183         /* OpenSSL specific variables */
184         int engine;
185         const char *engine_id;
186         const char *pin;
187         const char *key_id;
188         const char *cert_id;
189         const char *ca_cert_id;
190         const char *openssl_ciphers;
191
192         unsigned int flags;
193         const char *ocsp_stapling_response;
194         const char *ocsp_stapling_response_multi;
195     int (*server_cert_cb)(int ok_so_far, X509* cert, void *ca_ctx);
196     void *server_cert_ctx;
197 };
198
199
200 /**
201  * tls_init - Initialize TLS library
202  * @conf: Configuration data for TLS library
203  * Returns: Context data to be used as tls_ctx in calls to other functions,
204  * or %NULL on failure.
205  *
206  * Called once during program startup and once for each RSN pre-authentication
207  * session. In other words, there can be two concurrent TLS contexts. If global
208  * library initialization is needed (i.e., one that is shared between both
209  * authentication types), the TLS library wrapper should maintain a reference
210  * counter and do global initialization only when moving from 0 to 1 reference.
211  */
212 void * tls_init(const struct tls_config *conf);
213
214 /**
215  * tls_deinit - Deinitialize TLS library
216  * @tls_ctx: TLS context data from tls_init()
217  *
218  * Called once during program shutdown and once for each RSN pre-authentication
219  * session. If global library deinitialization is needed (i.e., one that is
220  * shared between both authentication types), the TLS library wrapper should
221  * maintain a reference counter and do global deinitialization only when moving
222  * from 1 to 0 references.
223  */
224 void tls_deinit(void *tls_ctx);
225
226 /**
227  * tls_get_errors - Process pending errors
228  * @tls_ctx: TLS context data from tls_init()
229  * Returns: Number of found error, 0 if no errors detected.
230  *
231  * Process all pending TLS errors.
232  */
233 int tls_get_errors(void *tls_ctx);
234
235 /**
236  * tls_connection_init - Initialize a new TLS connection
237  * @tls_ctx: TLS context data from tls_init()
238  * Returns: Connection context data, conn for other function calls
239  */
240 struct tls_connection * tls_connection_init(void *tls_ctx);
241
242 /**
243  * tls_connection_deinit - Free TLS connection data
244  * @tls_ctx: TLS context data from tls_init()
245  * @conn: Connection context data from tls_connection_init()
246  *
247  * Release all resources allocated for TLS connection.
248  */
249 void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn);
250
251 /**
252  * tls_connection_established - Has the TLS connection been completed?
253  * @tls_ctx: TLS context data from tls_init()
254  * @conn: Connection context data from tls_connection_init()
255  * Returns: 1 if TLS connection has been completed, 0 if not.
256  */
257 int tls_connection_established(void *tls_ctx, struct tls_connection *conn);
258
259 /**
260  * tls_connection_shutdown - Shutdown TLS connection
261  * @tls_ctx: TLS context data from tls_init()
262  * @conn: Connection context data from tls_connection_init()
263  * Returns: 0 on success, -1 on failure
264  *
265  * Shutdown current TLS connection without releasing all resources. New
266  * connection can be started by using the same conn without having to call
267  * tls_connection_init() or setting certificates etc. again. The new
268  * connection should try to use session resumption.
269  */
270 int tls_connection_shutdown(void *tls_ctx, struct tls_connection *conn);
271
272 enum {
273         TLS_SET_PARAMS_ENGINE_PRV_BAD_PIN = -4,
274         TLS_SET_PARAMS_ENGINE_PRV_VERIFY_FAILED = -3,
275         TLS_SET_PARAMS_ENGINE_PRV_INIT_FAILED = -2
276 };
277
278 /**
279  * tls_connection_set_params - Set TLS connection parameters
280  * @tls_ctx: TLS context data from tls_init()
281  * @conn: Connection context data from tls_connection_init()
282  * @params: Connection parameters
283  * Returns: 0 on success, -1 on failure,
284  * TLS_SET_PARAMS_ENGINE_PRV_INIT_FAILED (-2) on error causing PKCS#11 engine
285  * failure, or
286  * TLS_SET_PARAMS_ENGINE_PRV_VERIFY_FAILED (-3) on failure to verify the
287  * PKCS#11 engine private key, or
288  * TLS_SET_PARAMS_ENGINE_PRV_BAD_PIN (-4) on PIN error causing PKCS#11 engine
289  * failure.
290  */
291 int __must_check
292 tls_connection_set_params(void *tls_ctx, struct tls_connection *conn,
293                           const struct tls_connection_params *params);
294
295 /**
296  * tls_global_set_params - Set TLS parameters for all TLS connection
297  * @tls_ctx: TLS context data from tls_init()
298  * @params: Global TLS parameters
299  * Returns: 0 on success, -1 on failure,
300  * TLS_SET_PARAMS_ENGINE_PRV_INIT_FAILED (-2) on error causing PKCS#11 engine
301  * failure, or
302  * TLS_SET_PARAMS_ENGINE_PRV_VERIFY_FAILED (-3) on failure to verify the
303  * PKCS#11 engine private key, or
304  * TLS_SET_PARAMS_ENGINE_PRV_BAD_PIN (-4) on PIN error causing PKCS#11 engine
305  * failure.
306  */
307 int __must_check tls_global_set_params(
308         void *tls_ctx, const struct tls_connection_params *params);
309
310 /**
311  * tls_global_set_verify - Set global certificate verification options
312  * @tls_ctx: TLS context data from tls_init()
313  * @check_crl: 0 = do not verify CRLs, 1 = verify CRL for the user certificate,
314  * 2 = verify CRL for all certificates
315  * Returns: 0 on success, -1 on failure
316  */
317 int __must_check tls_global_set_verify(void *tls_ctx, int check_crl);
318
319 /**
320  * tls_connection_set_verify - Set certificate verification options
321  * @tls_ctx: TLS context data from tls_init()
322  * @conn: Connection context data from tls_connection_init()
323  * @verify_peer: 1 = verify peer certificate
324  * @flags: Connection flags (TLS_CONN_*)
325  * @session_ctx: Session caching context or %NULL to use default
326  * @session_ctx_len: Length of @session_ctx in bytes.
327  * Returns: 0 on success, -1 on failure
328  */
329 int __must_check tls_connection_set_verify(void *tls_ctx,
330                                            struct tls_connection *conn,
331                                            int verify_peer,
332                                            unsigned int flags,
333                                            const u8 *session_ctx,
334                                            size_t session_ctx_len);
335
336 /**
337  * tls_connection_get_random - Get random data from TLS connection
338  * @tls_ctx: TLS context data from tls_init()
339  * @conn: Connection context data from tls_connection_init()
340  * @data: Structure of client/server random data (filled on success)
341  * Returns: 0 on success, -1 on failure
342  */
343 int __must_check tls_connection_get_random(void *tls_ctx,
344                                          struct tls_connection *conn,
345                                          struct tls_random *data);
346
347 /**
348  * tls_connection_export_key - Derive keying material from a TLS connection
349  * @tls_ctx: TLS context data from tls_init()
350  * @conn: Connection context data from tls_connection_init()
351  * @label: Label (e.g., description of the key) for PRF
352  * @out: Buffer for output data from TLS-PRF
353  * @out_len: Length of the output buffer
354  * Returns: 0 on success, -1 on failure
355  *
356  * Exports keying material using the mechanism described in RFC 5705.
357  */
358 int __must_check tls_connection_export_key(void *tls_ctx,
359                                            struct tls_connection *conn,
360                                            const char *label,
361                                            u8 *out, size_t out_len);
362
363 /**
364  * tls_connection_get_eap_fast_key - Derive key material for EAP-FAST
365  * @tls_ctx: TLS context data from tls_init()
366  * @conn: Connection context data from tls_connection_init()
367  * @out: Buffer for output data from TLS-PRF
368  * @out_len: Length of the output buffer
369  * Returns: 0 on success, -1 on failure
370  *
371  * Exports key material after the normal TLS key block for use with
372  * EAP-FAST. Most callers will want tls_connection_export_key(), but EAP-FAST
373  * uses a different legacy mechanism.
374  */
375 int __must_check tls_connection_get_eap_fast_key(void *tls_ctx,
376                                                  struct tls_connection *conn,
377                                                  u8 *out, size_t out_len);
378
379 /**
380  * tls_connection_handshake - Process TLS handshake (client side)
381  * @tls_ctx: TLS context data from tls_init()
382  * @conn: Connection context data from tls_connection_init()
383  * @in_data: Input data from TLS server
384  * @appl_data: Pointer to application data pointer, or %NULL if dropped
385  * Returns: Output data, %NULL on failure
386  *
387  * The caller is responsible for freeing the returned output data. If the final
388  * handshake message includes application data, this is decrypted and
389  * appl_data (if not %NULL) is set to point this data. The caller is
390  * responsible for freeing appl_data.
391  *
392  * This function is used during TLS handshake. The first call is done with
393  * in_data == %NULL and the library is expected to return ClientHello packet.
394  * This packet is then send to the server and a response from server is given
395  * to TLS library by calling this function again with in_data pointing to the
396  * TLS message from the server.
397  *
398  * If the TLS handshake fails, this function may return %NULL. However, if the
399  * TLS library has a TLS alert to send out, that should be returned as the
400  * output data. In this case, tls_connection_get_failed() must return failure
401  * (> 0).
402  *
403  * tls_connection_established() should return 1 once the TLS handshake has been
404  * completed successfully.
405  */
406 struct wpabuf * tls_connection_handshake(void *tls_ctx,
407                                          struct tls_connection *conn,
408                                          const struct wpabuf *in_data,
409                                          struct wpabuf **appl_data);
410
411 struct wpabuf * tls_connection_handshake2(void *tls_ctx,
412                                           struct tls_connection *conn,
413                                           const struct wpabuf *in_data,
414                                           struct wpabuf **appl_data,
415                                           int *more_data_needed);
416
417 /**
418  * tls_connection_server_handshake - Process TLS handshake (server side)
419  * @tls_ctx: TLS context data from tls_init()
420  * @conn: Connection context data from tls_connection_init()
421  * @in_data: Input data from TLS peer
422  * @appl_data: Pointer to application data pointer, or %NULL if dropped
423  * Returns: Output data, %NULL on failure
424  *
425  * The caller is responsible for freeing the returned output data.
426  */
427 struct wpabuf * tls_connection_server_handshake(void *tls_ctx,
428                                                 struct tls_connection *conn,
429                                                 const struct wpabuf *in_data,
430                                                 struct wpabuf **appl_data);
431
432 /**
433  * tls_connection_encrypt - Encrypt data into TLS tunnel
434  * @tls_ctx: TLS context data from tls_init()
435  * @conn: Connection context data from tls_connection_init()
436  * @in_data: Plaintext data to be encrypted
437  * Returns: Encrypted TLS data or %NULL on failure
438  *
439  * This function is used after TLS handshake has been completed successfully to
440  * send data in the encrypted tunnel. The caller is responsible for freeing the
441  * returned output data.
442  */
443 struct wpabuf * tls_connection_encrypt(void *tls_ctx,
444                                        struct tls_connection *conn,
445                                        const struct wpabuf *in_data);
446
447 /**
448  * tls_connection_decrypt - Decrypt data from TLS tunnel
449  * @tls_ctx: TLS context data from tls_init()
450  * @conn: Connection context data from tls_connection_init()
451  * @in_data: Encrypted TLS data
452  * Returns: Decrypted TLS data or %NULL on failure
453  *
454  * This function is used after TLS handshake has been completed successfully to
455  * receive data from the encrypted tunnel. The caller is responsible for
456  * freeing the returned output data.
457  */
458 struct wpabuf * tls_connection_decrypt(void *tls_ctx,
459                                        struct tls_connection *conn,
460                                        const struct wpabuf *in_data);
461
462 struct wpabuf * tls_connection_decrypt2(void *tls_ctx,
463                                         struct tls_connection *conn,
464                                         const struct wpabuf *in_data,
465                                         int *more_data_needed);
466
467 /**
468  * tls_connection_resumed - Was session resumption used
469  * @tls_ctx: TLS context data from tls_init()
470  * @conn: Connection context data from tls_connection_init()
471  * Returns: 1 if current session used session resumption, 0 if not
472  */
473 int tls_connection_resumed(void *tls_ctx, struct tls_connection *conn);
474
475 enum {
476         TLS_CIPHER_NONE,
477         TLS_CIPHER_RC4_SHA /* 0x0005 */,
478         TLS_CIPHER_AES128_SHA /* 0x002f */,
479         TLS_CIPHER_RSA_DHE_AES128_SHA /* 0x0031 */,
480         TLS_CIPHER_ANON_DH_AES128_SHA /* 0x0034 */,
481         TLS_CIPHER_RSA_DHE_AES256_SHA /* 0x0039 */,
482         TLS_CIPHER_AES256_SHA /* 0x0035 */,
483 };
484
485 /**
486  * tls_connection_set_cipher_list - Configure acceptable cipher suites
487  * @tls_ctx: TLS context data from tls_init()
488  * @conn: Connection context data from tls_connection_init()
489  * @ciphers: Zero (TLS_CIPHER_NONE) terminated list of allowed ciphers
490  * (TLS_CIPHER_*).
491  * Returns: 0 on success, -1 on failure
492  */
493 int __must_check tls_connection_set_cipher_list(void *tls_ctx,
494                                                 struct tls_connection *conn,
495                                                 u8 *ciphers);
496
497 /**
498  * tls_get_version - Get the current TLS version number
499  * @tls_ctx: TLS context data from tls_init()
500  * @conn: Connection context data from tls_connection_init()
501  * @buf: Buffer for returning the TLS version number
502  * @buflen: buf size
503  * Returns: 0 on success, -1 on failure
504  *
505  * Get the currently used TLS version number.
506  */
507 int __must_check tls_get_version(void *tls_ctx, struct tls_connection *conn,
508                                  char *buf, size_t buflen);
509
510 /**
511  * tls_get_cipher - Get current cipher name
512  * @tls_ctx: TLS context data from tls_init()
513  * @conn: Connection context data from tls_connection_init()
514  * @buf: Buffer for the cipher name
515  * @buflen: buf size
516  * Returns: 0 on success, -1 on failure
517  *
518  * Get the name of the currently used cipher.
519  */
520 int __must_check tls_get_cipher(void *tls_ctx, struct tls_connection *conn,
521                                 char *buf, size_t buflen);
522
523 /**
524  * tls_connection_enable_workaround - Enable TLS workaround options
525  * @tls_ctx: TLS context data from tls_init()
526  * @conn: Connection context data from tls_connection_init()
527  * Returns: 0 on success, -1 on failure
528  *
529  * This function is used to enable connection-specific workaround options for
530  * buffer SSL/TLS implementations.
531  */
532 int __must_check tls_connection_enable_workaround(void *tls_ctx,
533                                                   struct tls_connection *conn);
534
535 /**
536  * tls_connection_client_hello_ext - Set TLS extension for ClientHello
537  * @tls_ctx: TLS context data from tls_init()
538  * @conn: Connection context data from tls_connection_init()
539  * @ext_type: Extension type
540  * @data: Extension payload (%NULL to remove extension)
541  * @data_len: Extension payload length
542  * Returns: 0 on success, -1 on failure
543  */
544 int __must_check tls_connection_client_hello_ext(void *tls_ctx,
545                                                  struct tls_connection *conn,
546                                                  int ext_type, const u8 *data,
547                                                  size_t data_len);
548
549 /**
550  * tls_connection_get_failed - Get connection failure status
551  * @tls_ctx: TLS context data from tls_init()
552  * @conn: Connection context data from tls_connection_init()
553  *
554  * Returns >0 if connection has failed, 0 if not.
555  */
556 int tls_connection_get_failed(void *tls_ctx, struct tls_connection *conn);
557
558 /**
559  * tls_connection_get_read_alerts - Get connection read alert status
560  * @tls_ctx: TLS context data from tls_init()
561  * @conn: Connection context data from tls_connection_init()
562  * Returns: Number of times a fatal read (remote end reported error) has
563  * happened during this connection.
564  */
565 int tls_connection_get_read_alerts(void *tls_ctx, struct tls_connection *conn);
566
567 /**
568  * tls_connection_get_write_alerts - Get connection write alert status
569  * @tls_ctx: TLS context data from tls_init()
570  * @conn: Connection context data from tls_connection_init()
571  * Returns: Number of times a fatal write (locally detected error) has happened
572  * during this connection.
573  */
574 int tls_connection_get_write_alerts(void *tls_ctx,
575                                     struct tls_connection *conn);
576
577 typedef int (*tls_session_ticket_cb)
578 (void *ctx, const u8 *ticket, size_t len, const u8 *client_random,
579  const u8 *server_random, u8 *master_secret);
580
581 int __must_check  tls_connection_set_session_ticket_cb(
582         void *tls_ctx, struct tls_connection *conn,
583         tls_session_ticket_cb cb, void *ctx);
584
585 void tls_connection_set_log_cb(struct tls_connection *conn,
586                                void (*log_cb)(void *ctx, const char *msg),
587                                void *ctx);
588
589 #define TLS_BREAK_VERIFY_DATA BIT(0)
590 #define TLS_BREAK_SRV_KEY_X_HASH BIT(1)
591 #define TLS_BREAK_SRV_KEY_X_SIGNATURE BIT(2)
592 #define TLS_DHE_PRIME_511B BIT(3)
593 #define TLS_DHE_PRIME_767B BIT(4)
594 #define TLS_DHE_PRIME_15 BIT(5)
595 #define TLS_DHE_PRIME_58B BIT(6)
596 #define TLS_DHE_NON_PRIME BIT(7)
597
598 void tls_connection_set_test_flags(struct tls_connection *conn, u32 flags);
599
600 int tls_get_library_version(char *buf, size_t buf_len);
601
602 void tls_connection_set_success_data(struct tls_connection *conn,
603                                      struct wpabuf *data);
604
605 void tls_connection_set_success_data_resumed(struct tls_connection *conn);
606
607 const struct wpabuf *
608 tls_connection_get_success_data(struct tls_connection *conn);
609
610 void tls_connection_remove_session(struct tls_connection *conn);
611
612 #endif /* TLS_H */