$search
00001 /* 00002 * TLSv1 server (RFC 2246) 00003 * Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation. 00008 * 00009 * Alternatively, this software may be distributed under the terms of BSD 00010 * license. 00011 * 00012 * See README and COPYING for more details. 00013 */ 00014 00015 #ifndef TLSV1_SERVER_H 00016 #define TLSV1_SERVER_H 00017 00018 #include "tlsv1_cred.h" 00019 00020 struct tlsv1_server; 00021 00022 int tlsv1_server_global_init(void); 00023 void tlsv1_server_global_deinit(void); 00024 struct tlsv1_server * tlsv1_server_init(struct tlsv1_credentials *cred); 00025 void tlsv1_server_deinit(struct tlsv1_server *conn); 00026 int tlsv1_server_established(struct tlsv1_server *conn); 00027 int tlsv1_server_prf(struct tlsv1_server *conn, const char *label, 00028 int server_random_first, u8 *out, size_t out_len); 00029 u8 * tlsv1_server_handshake(struct tlsv1_server *conn, 00030 const u8 *in_data, size_t in_len, size_t *out_len); 00031 int tlsv1_server_encrypt(struct tlsv1_server *conn, 00032 const u8 *in_data, size_t in_len, 00033 u8 *out_data, size_t out_len); 00034 int tlsv1_server_decrypt(struct tlsv1_server *conn, 00035 const u8 *in_data, size_t in_len, 00036 u8 *out_data, size_t out_len); 00037 int tlsv1_server_get_cipher(struct tlsv1_server *conn, char *buf, 00038 size_t buflen); 00039 int tlsv1_server_shutdown(struct tlsv1_server *conn); 00040 int tlsv1_server_resumed(struct tlsv1_server *conn); 00041 int tlsv1_server_get_keys(struct tlsv1_server *conn, struct tls_keys *keys); 00042 int tlsv1_server_get_keyblock_size(struct tlsv1_server *conn); 00043 int tlsv1_server_set_cipher_list(struct tlsv1_server *conn, u8 *ciphers); 00044 int tlsv1_server_set_verify(struct tlsv1_server *conn, int verify_peer); 00045 00046 typedef int (*tlsv1_server_session_ticket_cb) 00047 (void *ctx, const u8 *ticket, size_t len, const u8 *client_random, 00048 const u8 *server_random, u8 *master_secret); 00049 00050 void tlsv1_server_set_session_ticket_cb(struct tlsv1_server *conn, 00051 tlsv1_server_session_ticket_cb cb, 00052 void *ctx); 00053 00054 #endif /* TLSV1_SERVER_H */