removed unneeded headers.
[gnutls.git] / libextra / ext_inner_application.h
blobc641a99816eb1ee9f434336411236f64dc9e2836
1 /*
2 * Copyright (C) 2005, 2008, 2010 Free Software Foundation, Inc.
4 * Author: Simon Josefsson
6 * This file is part of GnuTLS-EXTRA.
8 * GnuTLS-extra is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
13 * GnuTLS-extra is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
24 #ifndef EXT_IA_H
25 #define EXT_IA_H
27 #include <gnutls_extensions.h>
29 #define IA_PEER_ENABLE (1 << 1)
30 #define IA_PEER_ALLOW_SKIP (1 << 2)
31 #define IA_ENABLE (1 << 3)
32 #define IA_ALLOW_SKIP (1 << 4)
34 extern extension_entry_st ext_mod_ia;
36 typedef struct
38 unsigned int flags;
39 /* For TLS/IA. XXX: Move to IA credential? */
40 opaque inner_secret[GNUTLS_MASTER_SIZE];
41 } ia_ext_st;
43 inline static void
44 _gnutls_ia_derive_inner_secret (gnutls_session_t session)
46 extension_priv_data_t epriv;
47 ia_ext_st *priv;
48 int ret;
50 ret =
51 _gnutls_ext_get_session_data (session, GNUTLS_EXTENSION_INNER_APPLICATION,
52 &epriv);
53 if (ret < 0)
55 return;
57 priv = epriv.ptr;
59 memcpy (priv->inner_secret,
60 session->security_parameters.master_secret, GNUTLS_MASTER_SIZE);
64 #endif