From: Jonathan Bastien-Filiatrault Date: Mon, 3 Aug 2009 19:10:27 +0000 (-0400) Subject: Add proper handshake outgoing sequence number. X-Git-Tag: gnutls_2_99_0~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3efebded307e49c73ef44483ffb5819ff5c0efd6;p=thirdparty%2Fgnutls.git Add proper handshake outgoing sequence number. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c index b48e5e7607..4872e50544 100644 --- a/lib/gnutls_handshake.c +++ b/lib/gnutls_handshake.c @@ -1197,8 +1197,7 @@ _gnutls_send_handshake (gnutls_session_t session, mbuffer_st * bufel, * message was sent in a single fragment. */ if (_gnutls_is_dtls(session)) { - /* FIXME: dummy sequence number */ - _gnutls_write_uint16 (0, &data[pos]); + _gnutls_write_uint16 (session->internals.dtls.hsk_write_seq++, &data[pos]); pos += 2; /* Fragment offset */ diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h index c9def019b5..6b95ae53e2 100644 --- a/lib/gnutls_int.h +++ b/lib/gnutls_int.h @@ -529,7 +529,12 @@ typedef struct /* HelloVerifyRequest DOS prevention cookie */ opaque cookie[DTLS_MAX_COOKIE_SIZE]; uint8_t cookie_len; + gnutls_dtls_flags_t flags; + + /* For DTLS handshake fragmentation and reassembly. */ + uint16_t hsk_write_seq; + uint16_t hsk_read_seq; } dtls_st;