summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-06-15 03:28:42 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-06-15 03:28:42 +0200
commitbffe80f3d28356003c3ca24e3933910d5968697d (patch)
treeef7dd1949f6889f8b68243d66bbeebbdd6f8c1aa /src/fastd.h
parentb0a169a1465a75592f0083a3e4e17c307878fc73 (diff)
downloadfastd-bffe80f3d28356003c3ca24e3933910d5968697d.tar
fastd-bffe80f3d28356003c3ca24e3933910d5968697d.zip
Avoid using the same handshake key to establish more than one session
This fix prevents a potential attack using intentional packet reordering to initialize more than one session with using the same handshake keys, leading to more that one session to be initialized with the same key data altogether, allowing to decrypt some packets in the worst case.
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fastd.h b/src/fastd.h
index 8a0fcce..ff7cab9 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -73,6 +73,8 @@ struct _fastd_protocol {
void (*handle_recv)(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer);
void (*send)(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer);
+ void (*init_peer_state)(fastd_context *ctx, fastd_peer *peer);
+ void (*reset_peer_state)(fastd_context *ctx, fastd_peer *peer);
void (*free_peer_state)(fastd_context *ctx, fastd_peer *peer);
void (*generate_key)(fastd_context *ctx);
@@ -86,7 +88,7 @@ struct _fastd_method {
size_t (*min_encrypt_head_space)(fastd_context *ctx);
size_t (*min_decrypt_head_space)(fastd_context *ctx);
- fastd_method_session_state* (*session_init)(fastd_context *ctx, uint8_t *secret, size_t length, bool initiator, fastd_method_session_state *prev_session);
+ fastd_method_session_state* (*session_init)(fastd_context *ctx, uint8_t *secret, size_t length, bool initiator);
bool (*session_is_valid)(fastd_context *ctx, fastd_method_session_state *session);
bool (*session_is_initiator)(fastd_context *ctx, fastd_method_session_state *session);
bool (*session_want_refresh)(fastd_context *ctx, fastd_method_session_state *session);