~ubuntu-branches/ubuntu/quantal/gnutls26/quantal-security

« back to all changes in this revision

Viewing changes to lib/gnutls_extensions.h

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-10-01 15:28:13 UTC
  • mfrom: (12.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20111001152813-yygm1c4cxonfxhzy
Tags: 2.12.11-1
* New upstream version.
  + Allow CA importing of 0 certificates to succeed. Closes: #640639
* Add libp11-kit-dev to libgnutls-dev dependencies. (see #643811)
* [20_guiledocstring.diff] guile: Fix docstring extraction with CPP 4.5+.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 *
24
24
 */
25
25
 
 
26
#ifndef GNUTLS_EXTENSIONS_H
 
27
#define GNUTLS_EXTENSIONS_H
 
28
 
26
29
int _gnutls_parse_extensions (gnutls_session_t session,
27
 
                              gnutls_ext_parse_type_t parse_type,
28
 
                              const opaque * data, int data_size);
 
30
                              gnutls_ext_parse_type_t parse_type,
 
31
                              const opaque * data, int data_size);
29
32
int _gnutls_gen_extensions (gnutls_session_t session, opaque * data,
30
 
                            size_t data_size, gnutls_ext_parse_type_t);
 
33
                            size_t data_size, gnutls_ext_parse_type_t);
31
34
int _gnutls_ext_init (void);
32
35
void _gnutls_ext_deinit (void);
33
36
 
34
37
void _gnutls_extension_list_add (gnutls_session_t session, uint16_t type);
 
38
 
 
39
typedef void (*gnutls_ext_deinit_data_func) (extension_priv_data_t data);
 
40
typedef int (*gnutls_ext_pack_func) (extension_priv_data_t data,
 
41
                                     gnutls_buffer_st * packed_data);
 
42
typedef int (*gnutls_ext_unpack_func) (gnutls_buffer_st * packed_data,
 
43
                                       extension_priv_data_t * data);
 
44
 
 
45
void _gnutls_ext_free_session_data (gnutls_session_t session);
 
46
 
 
47
/* functions to be used by extensions internally
 
48
 */
 
49
void _gnutls_ext_unset_session_data (gnutls_session_t session, uint16_t type);
 
50
void _gnutls_ext_set_session_data (gnutls_session_t session, uint16_t type,
 
51
                                   extension_priv_data_t);
 
52
int _gnutls_ext_get_session_data (gnutls_session_t session,
 
53
                                  uint16_t type, extension_priv_data_t *);
 
54
int _gnutls_ext_get_resumed_session_data (gnutls_session_t session,
 
55
                                          uint16_t type,
 
56
                                          extension_priv_data_t * data);
 
57
 
 
58
void _gnutls_ext_restore_resumed_session (gnutls_session_t session);
 
59
 
 
60
/* for session packing */
 
61
int _gnutls_ext_pack (gnutls_session_t session, gnutls_buffer_st * packed);
 
62
int _gnutls_ext_unpack (gnutls_session_t session, gnutls_buffer_st * packed);
 
63
 
 
64
typedef struct
 
65
{
 
66
  const char *name;
 
67
  uint16_t type;
 
68
  gnutls_ext_parse_type_t parse_type;
 
69
 
 
70
  /* this function must return 0 when Not Applicable
 
71
   * size of extension data if ok
 
72
   * < 0 on other error.
 
73
   */
 
74
  gnutls_ext_recv_func recv_func;
 
75
 
 
76
  /* this function must return 0 when Not Applicable
 
77
   * size of extension data if ok
 
78
   * GNUTLS_E_INT_RET_0 if extension data size is zero
 
79
   * < 0 on other error.
 
80
   */
 
81
  gnutls_ext_send_func send_func;
 
82
 
 
83
  gnutls_ext_deinit_data_func deinit_func;      /* this will be called to deinitialize
 
84
                                                 * internal data 
 
85
                                                 */
 
86
  gnutls_ext_pack_func pack_func;       /* packs internal data to machine independent format */
 
87
  gnutls_ext_unpack_func unpack_func;   /* unpacks internal data */
 
88
 
 
89
} extension_entry_st;
 
90
 
 
91
int _gnutls_ext_register (extension_entry_st *);
 
92
 
 
93
#endif