Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / wpa / src / tls / tlsv1_server_i.h
blobd11ea7559f3fe11dca2b86e87ede3d8f4c044dbd
1 /*
2 * TLSv1 server - internal structures
3 * Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #ifndef TLSV1_SERVER_I_H
16 #define TLSV1_SERVER_I_H
18 struct tlsv1_server {
19 enum {
20 CLIENT_HELLO, SERVER_HELLO, SERVER_CERTIFICATE,
21 SERVER_KEY_EXCHANGE, SERVER_CERTIFICATE_REQUEST,
22 SERVER_HELLO_DONE, CLIENT_CERTIFICATE, CLIENT_KEY_EXCHANGE,
23 CERTIFICATE_VERIFY, CHANGE_CIPHER_SPEC, CLIENT_FINISHED,
24 SERVER_CHANGE_CIPHER_SPEC, SERVER_FINISHED,
25 ESTABLISHED, FAILED
26 } state;
28 struct tlsv1_record_layer rl;
30 u8 session_id[TLS_SESSION_ID_MAX_LEN];
31 size_t session_id_len;
32 u8 client_random[TLS_RANDOM_LEN];
33 u8 server_random[TLS_RANDOM_LEN];
34 u8 master_secret[TLS_MASTER_SECRET_LEN];
36 u8 alert_level;
37 u8 alert_description;
39 struct crypto_public_key *client_rsa_key;
41 struct tls_verify_hash verify;
43 #define MAX_CIPHER_COUNT 30
44 u16 cipher_suites[MAX_CIPHER_COUNT];
45 size_t num_cipher_suites;
47 u16 cipher_suite;
49 struct tlsv1_credentials *cred;
51 int verify_peer;
52 u16 client_version;
54 u8 *session_ticket;
55 size_t session_ticket_len;
57 tlsv1_server_session_ticket_cb session_ticket_cb;
58 void *session_ticket_cb_ctx;
60 int use_session_ticket;
62 u8 *dh_secret;
63 size_t dh_secret_len;
67 void tlsv1_server_alert(struct tlsv1_server *conn, u8 level, u8 description);
68 int tlsv1_server_derive_keys(struct tlsv1_server *conn,
69 const u8 *pre_master_secret,
70 size_t pre_master_secret_len);
71 u8 * tlsv1_server_handshake_write(struct tlsv1_server *conn, size_t *out_len);
72 u8 * tlsv1_server_send_alert(struct tlsv1_server *conn, u8 level,
73 u8 description, size_t *out_len);
74 int tlsv1_server_process_handshake(struct tlsv1_server *conn, u8 ct,
75 const u8 *buf, size_t *len);
77 #endif /* TLSV1_SERVER_I_H */