diff options
Diffstat (limited to 'src/daemon/https/tls/gnutls_session.c')
-rw-r--r-- | src/daemon/https/tls/gnutls_session.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/daemon/https/tls/gnutls_session.c b/src/daemon/https/tls/gnutls_session.c deleted file mode 100644 index b7ba3764..00000000 --- a/src/daemon/https/tls/gnutls_session.c +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2003, 2004, 2005, 2007 Free Software Foundation | ||
3 | * | ||
4 | * Author: Nikos Mavrogiannopoulos | ||
5 | * | ||
6 | * This file is part of GNUTLS. | ||
7 | * | ||
8 | * The GNUTLS library is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU Lesser General Public License | ||
10 | * as published by the Free Software Foundation; either version 2.1 of | ||
11 | * the License, or (at your option) any later version. | ||
12 | * | ||
13 | * This library 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 | * Lesser General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public | ||
19 | * License along with this library; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
21 | * USA | ||
22 | * | ||
23 | */ | ||
24 | #include "gnutls_int.h" | ||
25 | #include "gnutls_errors.h" | ||
26 | #include "debug.h" | ||
27 | #include "gnutls_session_pack.h" | ||
28 | #include <gnutls_datum.h> | ||
29 | |||
30 | /* TODO this file should be removed if session resumption will be abandoned */ | ||
31 | |||
32 | /** | ||
33 | * MHD_gtls_session_get_id - Returns session id. | ||
34 | * @session: is a #MHD_gtls_session_t structure. | ||
35 | * @session_id: is a pointer to space to hold the session id. | ||
36 | * @session_id_size: is the session id's size, or it will be set by the function. | ||
37 | * | ||
38 | * Returns the current session id. This can be used if you want to check if | ||
39 | * the next session you tried to resume was actually resumed. | ||
40 | * This is because resumed sessions have the same sessionID with the | ||
41 | * original session. | ||
42 | * | ||
43 | * Session id is some data set by the server, that identify the current session. | ||
44 | * In TLS 1.0 and SSL 3.0 session id is always less than 32 bytes. | ||
45 | * | ||
46 | * Returns zero on success. | ||
47 | **/ | ||
48 | int | ||
49 | MHD_gtls_session_get_id (MHD_gtls_session_t session, | ||
50 | void *session_id, size_t * session_id_size) | ||
51 | { | ||
52 | size_t given_session_id_size = *session_id_size; | ||
53 | |||
54 | *session_id_size = session->security_parameters.session_id_size; | ||
55 | |||
56 | /* just return the session size */ | ||
57 | if (session_id == NULL) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | if (given_session_id_size < session->security_parameters.session_id_size) | ||
63 | { | ||
64 | return GNUTLS_E_SHORT_MEMORY_BUFFER; | ||
65 | } | ||
66 | |||
67 | memcpy (session_id, &session->security_parameters.session_id, | ||
68 | *session_id_size); | ||
69 | |||
70 | return 0; | ||
71 | } | ||