11 const u8 *client_random;
12 size_t client_random_len;
13 const u8 *server_random;
14 size_t server_random_len;
18 TLS_CERT_CHAIN_SUCCESS,
19 TLS_CERT_CHAIN_FAILURE,
28 enum tls_fail_reason {
29 TLS_FAIL_UNSPECIFIED = 0,
30 TLS_FAIL_UNTRUSTED = 1,
32 TLS_FAIL_NOT_YET_VALID = 3,
34 TLS_FAIL_SUBJECT_MISMATCH = 5,
35 TLS_FAIL_ALTSUBJECT_MISMATCH = 6,
36 TLS_FAIL_BAD_CERTIFICATE = 7,
37 TLS_FAIL_SERVER_CHAIN_PROBE = 8,
38 TLS_FAIL_DOMAIN_SUFFIX_MISMATCH = 9,
39 TLS_FAIL_DOMAIN_MISMATCH = 10,
43 #define TLS_MAX_ALT_SUBJECT 10
49 enum tls_fail_reason reason;
50 const char *reason_txt;
60 const char *altsubject[TLS_MAX_ALT_SUBJECT];
67 const char *description;
72 const char *opensc_engine_path;
73 const char *pkcs11_engine_path;
74 const char *pkcs11_module_path;
77 const char *openssl_ciphers;
78 unsigned int tls_session_lifetime;
80 void (*event_cb)(
void *ctx,
enum tls_event ev,
85 #define TLS_CONN_ALLOW_SIGN_RSA_MD5 BIT(0)
86 #define TLS_CONN_DISABLE_TIME_CHECKS BIT(1)
87 #define TLS_CONN_DISABLE_SESSION_TICKET BIT(2)
88 #define TLS_CONN_REQUEST_OCSP BIT(3)
89 #define TLS_CONN_REQUIRE_OCSP BIT(4)
90 #define TLS_CONN_DISABLE_TLSv1_1 BIT(5)
91 #define TLS_CONN_DISABLE_TLSv1_2 BIT(6)
92 #define TLS_CONN_EAP_FAST BIT(7)
93 #define TLS_CONN_DISABLE_TLSv1_0 BIT(8)
149 const u8 *ca_cert_blob;
150 size_t ca_cert_blob_len;
152 const char *subject_match;
153 const char *altsubject_match;
154 const char *suffix_match;
155 const char *domain_match;
156 const char *client_cert;
157 const u8 *client_cert_blob;
158 size_t client_cert_blob_len;
159 const char *private_key;
160 const u8 *private_key_blob;
161 size_t private_key_blob_len;
162 const char *private_key_passwd;
169 const char *engine_id;
173 const char *ca_cert_id;
174 const char *openssl_ciphers;
177 const char *ocsp_stapling_response;
254 TLS_SET_PARAMS_ENGINE_PRV_BAD_PIN = -4,
255 TLS_SET_PARAMS_ENGINE_PRV_VERIFY_FAILED = -3,
256 TLS_SET_PARAMS_ENGINE_PRV_INIT_FAILED = -2
314 const u8 *session_ctx,
315 size_t session_ctx_len);
349 int server_random_first,
351 u8 *out,
size_t out_len);
382 const struct wpabuf *in_data,
383 struct wpabuf **appl_data);
385 struct wpabuf * tls_connection_handshake2(
void *tls_ctx,
387 const struct wpabuf *in_data,
388 struct wpabuf **appl_data,
389 int *more_data_needed);
403 const struct wpabuf *in_data,
404 struct wpabuf **appl_data);
419 const struct wpabuf *in_data);
434 const struct wpabuf *in_data);
436 struct wpabuf * tls_connection_decrypt2(
void *tls_ctx,
438 const struct wpabuf *in_data,
439 int *more_data_needed);
452 TLS_CIPHER_AES128_SHA ,
453 TLS_CIPHER_RSA_DHE_AES128_SHA ,
454 TLS_CIPHER_ANON_DH_AES128_SHA
480 char *buf,
size_t buflen);
493 char *buf,
size_t buflen);
518 int ext_type,
const u8 *data,
549 typedef int (*tls_session_ticket_cb)
550 (
void *ctx,
const u8 *ticket,
size_t len,
const u8 *client_random,
551 const u8 *server_random, u8 *master_secret);
553 int __must_check tls_connection_set_session_ticket_cb(
555 tls_session_ticket_cb cb,
void *ctx);
558 void (*log_cb)(
void *ctx,
const char *msg),
561 #define TLS_BREAK_VERIFY_DATA BIT(0)
562 #define TLS_BREAK_SRV_KEY_X_HASH BIT(1)
563 #define TLS_BREAK_SRV_KEY_X_SIGNATURE BIT(2)
564 #define TLS_DHE_PRIME_511B BIT(3)
565 #define TLS_DHE_PRIME_767B BIT(4)
566 #define TLS_DHE_PRIME_15 BIT(5)
567 #define TLS_DHE_PRIME_58B BIT(6)
568 #define TLS_DHE_NON_PRIME BIT(7)
570 void tls_connection_set_test_flags(
struct tls_connection *conn, u32 flags);
572 int tls_get_library_version(
char *buf,
size_t buf_len);
577 void tls_connection_set_success_data_resumed(
struct tls_connection *conn);
int __must_check tls_get_version(void *tls_ctx, struct tls_connection *conn, char *buf, size_t buflen)
Get the current TLS version number.
Definition: tls_gnutls.c:1426
Parameters for TLS connection.
Definition: tls.h:147
int __must_check tls_connection_client_hello_ext(void *tls_ctx, struct tls_connection *conn, int ext_type, const u8 *data, size_t data_len)
Set TLS extension for ClientHello.
Definition: tls_gnutls.c:1451
int __must_check tls_connection_get_random(void *tls_ctx, struct tls_connection *conn, struct tls_random *data)
Get random data from TLS connection.
Definition: tls_gnutls.c:722
int tls_connection_established(void *tls_ctx, struct tls_connection *conn)
Has the TLS connection been completed?
Definition: tls_gnutls.c:285
int tls_connection_get_failed(void *tls_ctx, struct tls_connection *conn)
Get connection failure status.
Definition: tls_gnutls.c:1460
int __must_check tls_connection_enable_workaround(void *tls_ctx, struct tls_connection *conn)
Enable TLS workaround options.
Definition: tls_gnutls.c:1443
struct wpabuf * tls_connection_encrypt(void *tls_ctx, struct tls_connection *conn, const struct wpabuf *in_data)
Encrypt data into TLS tunnel.
Definition: tls_gnutls.c:1347
struct wpabuf * tls_connection_decrypt(void *tls_ctx, struct tls_connection *conn, const struct wpabuf *in_data)
Decrypt data from TLS tunnel.
Definition: tls_gnutls.c:1368
struct tls_connection * tls_connection_init(void *tls_ctx)
Initialize a new TLS connection.
Definition: tls_gnutls.c:232
void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn)
Free TLS connection data.
Definition: tls_gnutls.c:269
int __must_check tls_connection_prf(void *tls_ctx, struct tls_connection *conn, const char *label, int server_random_first, int skip_keyblock, u8 *out, size_t out_len)
Use TLS-PRF to derive keying material.
Definition: tls_gnutls.c:745
struct wpabuf * tls_connection_server_handshake(void *tls_ctx, struct tls_connection *conn, const struct wpabuf *in_data, struct wpabuf **appl_data)
Process TLS handshake (server side)
Definition: tls_gnutls.c:1338
int __must_check tls_global_set_verify(void *tls_ctx, int check_crl)
Set global certificate verification options.
Definition: tls_gnutls.c:699
int tls_connection_resumed(void *tls_ctx, struct tls_connection *conn)
Was session resumption used.
Definition: tls_gnutls.c:1410
int __must_check tls_connection_set_params(void *tls_ctx, struct tls_connection *conn, const struct tls_connection_params *params)
Set TLS connection parameters.
Definition: tls_gnutls.c:338
int __must_check tls_connection_set_verify(void *tls_ctx, struct tls_connection *conn, int verify_peer, unsigned int flags, const u8 *session_ctx, size_t session_ctx_len)
Set certificate verification options.
Definition: tls_gnutls.c:706
int tls_connection_shutdown(void *tls_ctx, struct tls_connection *conn)
Shutdown TLS connection.
Definition: tls_gnutls.c:291
struct wpabuf * tls_connection_handshake(void *tls_ctx, struct tls_connection *conn, const struct wpabuf *in_data, struct wpabuf **appl_data)
Process TLS handshake (client side)
Definition: tls_gnutls.c:1233
int __must_check tls_connection_set_cipher_list(void *tls_ctx, struct tls_connection *conn, u8 *ciphers)
Configure acceptable cipher suites.
Definition: tls_gnutls.c:1418
int __must_check tls_get_cipher(void *tls_ctx, struct tls_connection *conn, char *buf, size_t buflen)
Get current cipher name.
Definition: tls_gnutls.c:1434
void * tls_init(const struct tls_config *conf)
Initialize TLS library.
Definition: tls_gnutls.c:91
void tls_deinit(void *tls_ctx)
Deinitialize TLS library.
Definition: tls_gnutls.c:125
Definition: tls_gnutls.c:38
int tls_connection_get_read_alerts(void *tls_ctx, struct tls_connection *conn)
Get connection read alert status.
Definition: tls_gnutls.c:1468
int __must_check tls_global_set_params(void *tls_ctx, const struct tls_connection_params *params)
Set TLS parameters for all TLS connection.
Definition: tls_gnutls.c:595
int tls_get_errors(void *tls_ctx)
Process pending errors.
Definition: tls_gnutls.c:141
int tls_connection_get_write_alerts(void *tls_ctx, struct tls_connection *conn)
Get connection write alert status.
Definition: tls_gnutls.c:1476