Explicit symmetric cipher state versionning.
commit20151edffdb8d99c7feb986a2f102df76314cb7d
authorJonathan Bastien-Filiatrault <joe@x2a.org>
Fri, 17 Sep 2010 03:32:06 +0000 (16 23:32 -0400)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 17 Sep 2010 06:14:34 +0000 (17 08:14 +0200)
treec6f0d62f7b0447eb863c75117461940cae1bf915
parente463a5b53fdc5f3ce46c297f405e3054e11ba73d
Explicit symmetric cipher state versionning.

This introduces the concept of a "cipher epoch". The epoch number is
the number of successful handshakes and is incremented by one each
time. This concept is native to DTLS and this patch makes the
symmetric cipher state explicit for TLS in preparation for DTLS. This
concept was implicit in plain TLS and ChangeCipherSpec messages
triggered a "pending state copy". Now, we the current epoch number is
simply incremented to the parameters negotiated by the handshake.

The main side effects of this patch is a slightly more abstract
internal API and, in some cases, simpler code. The session blob format
is also changed a bit since this patch avoids storing information that
is now redundant. If this breaks library users' expectations, this
side effect can be negated.

The cipher_specs structure has been removed. The conn_state has become
record_state_st. Only symmetric cipher information is
versioned. Things such as key exchange algorithm and the master secret
are not versioned and their handling is unchanged.

I have tested this patch as much as I could. It introduces no test
suite regressions on my x64 Debian GNU/Linux system.

Do not hesitate to point out shortcomings or suggest changes. Since
this is a big diff, I am expecting this to be an iterative process.

Signed-off-by: Jonathan Bastien-Filiatrault <joe@x2a.org>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
17 files changed:
lib/ext_session_ticket.c
lib/gnutls_alert.c
lib/gnutls_buffers.c
lib/gnutls_cipher.c
lib/gnutls_cipher.h
lib/gnutls_compress.c
lib/gnutls_compress.h
lib/gnutls_constate.c
lib/gnutls_constate.h
lib/gnutls_handshake.c
lib/gnutls_int.h
lib/gnutls_num.h
lib/gnutls_record.c
lib/gnutls_record.h
lib/gnutls_session_pack.c
lib/gnutls_state.c
libextra/gnutls_ia.c