summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-04-19 17:53:53 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-04-19 17:53:53 +0000
commite9fd9de3f0bca346fb21ca7b581389e6c681a587 (patch)
tree5be1e33a13ee305f7d2f33538c8d48c1d7165b97
parent20f48b0223fb9ef4ef75cf7524feb0c30d284707 (diff)
downloadgnutls-e9fd9de3f0bca346fb21ca7b581389e6c681a587.tar.gz
gnutls_session_resumed() was renamed to gnutls_session_is_resumed(), and changed semantics, to make the return value be the obvious one.
-rw-r--r--NEWS2
-rw-r--r--doc/TODO6
-rw-r--r--doc/tex/ex4.tex2
-rw-r--r--lib/gnutls.h.in.in2
-rw-r--r--lib/gnutls_state.c14
-rw-r--r--src/cli.c2
-rw-r--r--src/serv.c2
7 files changed, 16 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index 253977b3d6..32b166fba3 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ Version ?.?.?
documentation.
- Added gnutls_handshake_set_rsa_pms() function, which disables the
version check in RSA premaster secret.
+- Added gnutls_session_is_resumed() function, which reports if a session
+ is a resumpted one.
Version 0.4.1 (7/04/2002)
- Now uses alloca() for temporary variables
diff --git a/doc/TODO b/doc/TODO
index 08f326830d..9d796bb1e6 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -3,11 +3,11 @@ anything), contact the developer's mailing list (gnutls-dev@lists.gnupg.org),
in order to avoid having people working on the same thing.
Current list:
-+ Audit the code
-* Add function(s) to get the DHE/A parameters
-* Add function(s) to extract the certificate key's parameters
+* Audit the code
* Optimize functions which now return malloc'd data
* Minimize footprint.
+* Add function(s) to get the DHE/A parameters
+* Add function(s) to extract the certificate key's parameters
- Add Kerberos support
(+) Means high priority
diff --git a/doc/tex/ex4.tex b/doc/tex/ex4.tex
index b61cb0ff74..fc20cb1187 100644
--- a/doc/tex/ex4.tex
+++ b/doc/tex/ex4.tex
@@ -99,7 +99,7 @@ int main()
} else { /* the second time we connect */
/* check if we actually resumed the previous session */
- if (gnutls_session_resumed( state) == 0) {
+ if (gnutls_session_is_resumed( state) != 0) {
printf("- Previous session was resumed\n");
} else {
fprintf(stderr, "*** Previous session was NOT resumed\n");
diff --git a/lib/gnutls.h.in.in b/lib/gnutls.h.in.in
index 282afec7fb..52363381e4 100644
--- a/lib/gnutls.h.in.in
+++ b/lib/gnutls.h.in.in
@@ -169,7 +169,7 @@ int gnutls_session_get_id( GNUTLS_STATE state, void* session, int *session_size)
/* checks if this session is a resumed one
*/
-int gnutls_session_resumed(GNUTLS_STATE state);
+int gnutls_session_is_resumed(GNUTLS_STATE state);
typedef int (*GNUTLS_DB_STORE_FUNC)(void*, gnutls_datum key, gnutls_datum data);
typedef int (*GNUTLS_DB_REMOVE_FUNC)(void*, gnutls_datum key);
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index b71a637f7a..498f39a5df 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -598,24 +598,24 @@ int _gnutls_PRF( opaque * secret, int secret_size, uint8 * label, int label_size
}
/**
- * gnutls_session_resumed - Used to check whether this session is a resumed one
+ * gnutls_session_is_resumed - Used to check whether this session is a resumed one
* @state: is a &GNUTLS_STATE structure.
*
- * This function will return 0 if this session is a resumed one,
- * or a negative number if this is a new session.
+ * This function will return non zero if this session is a resumed one,
+ * or a zero if this is a new session.
*
**/
-int gnutls_session_resumed(GNUTLS_STATE state)
+int gnutls_session_is_resumed(GNUTLS_STATE state)
{
if (state->security_parameters.entity==GNUTLS_CLIENT) {
if (memcmp( state->security_parameters.session_id,
state->gnutls_internals.resumed_security_parameters.session_id,
state->security_parameters.session_id_size)==0)
- return 0;
+ return 1;
} else {
if (state->gnutls_internals.resumed==RESUME_TRUE)
- return 0;
+ return 1;
}
- return GNUTLS_E_UNKNOWN_ERROR;
+ return 0;
}
diff --git a/src/cli.c b/src/cli.c
index 325a7c3035..1098e31017 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -306,7 +306,7 @@ int main(int argc, char **argv)
return 1;
} else {
printf("- Handshake was completed\n");
- if (gnutls_session_resumed( state)==0)
+ if (gnutls_session_is_resumed( state)!=0)
printf("*** This is a resumed session\n");
}
diff --git a/src/serv.c b/src/serv.c
index a2fb799bde..0727c01522 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -451,7 +451,7 @@ int main(int argc, char **argv)
continue;
}
printf("- Handshake was completed\n");
- if ( gnutls_session_resumed( state)==0)
+ if ( gnutls_session_is_resumed( state)!=0)
printf("*** This is a resumed session\n");
print_info(state);