Home | History | Annotate | Download | only in wpa_supplicant
      1 /*
      2  * wpa_supplicant: TLSv1 client (RFC 2246)
      3  * Copyright (c) 2006, Jouni Malinen <j (at) w1.fi>
      4  *
      5  * This program is free software; you can redistribute it and/or modify
      6  * it under the terms of the GNU General Public License version 2 as
      7  * published by the Free Software Foundation.
      8  *
      9  * Alternatively, this software may be distributed under the terms of BSD
     10  * license.
     11  *
     12  * See README and COPYING for more details.
     13  */
     14 
     15 #ifndef TLSV1_CLIENT_H
     16 #define TLSV1_CLIENT_H
     17 
     18 struct tlsv1_client;
     19 
     20 int tlsv1_client_global_init(void);
     21 void tlsv1_client_global_deinit(void);
     22 struct tlsv1_client * tlsv1_client_init(void);
     23 void tlsv1_client_deinit(struct tlsv1_client *conn);
     24 int tlsv1_client_established(struct tlsv1_client *conn);
     25 int tlsv1_client_prf(struct tlsv1_client *conn, const char *label,
     26 		     int server_random_first, u8 *out, size_t out_len);
     27 u8 * tlsv1_client_handshake(struct tlsv1_client *conn,
     28 			    const u8 *in_data, size_t in_len,
     29 			    size_t *out_len);
     30 int tlsv1_client_encrypt(struct tlsv1_client *conn,
     31 			 const u8 *in_data, size_t in_len,
     32 			 u8 *out_data, size_t out_len);
     33 int tlsv1_client_decrypt(struct tlsv1_client *conn,
     34 			 const u8 *in_data, size_t in_len,
     35 			 u8 *out_data, size_t out_len);
     36 int tlsv1_client_get_cipher(struct tlsv1_client *conn, char *buf,
     37 			    size_t buflen);
     38 int tlsv1_client_shutdown(struct tlsv1_client *conn);
     39 int tlsv1_client_resumed(struct tlsv1_client *conn);
     40 int tlsv1_client_hello_ext(struct tlsv1_client *conn, int ext_type,
     41 			   const u8 *data, size_t data_len);
     42 int tlsv1_client_get_keys(struct tlsv1_client *conn, struct tls_keys *keys);
     43 int tlsv1_client_set_master_key(struct tlsv1_client *conn,
     44 				const u8 *key, size_t key_len);
     45 int tlsv1_client_get_keyblock_size(struct tlsv1_client *conn);
     46 int tlsv1_client_set_cipher_list(struct tlsv1_client *conn, u8 *ciphers);
     47 int tlsv1_client_set_ca_cert(struct tlsv1_client *conn, const char *cert,
     48 			     const u8 *cert_blob, size_t cert_blob_len,
     49 			     const char *path);
     50 int tlsv1_client_set_client_cert(struct tlsv1_client *conn, const char *cert,
     51 				 const u8 *cert_blob, size_t cert_blob_len);
     52 int tlsv1_client_set_private_key(struct tlsv1_client *conn,
     53 				 const char *private_key,
     54 				 const char *private_key_passwd,
     55 				 const u8 *private_key_blob,
     56 				 size_t private_key_blob_len);
     57 
     58 #endif /* TLSV1_CLIENT_H */
     59