[PATCH 10/19] site: Remove pointless check from decrypt_msg0

Ian Jackson ijackson at chiark.greenend.org.uk
Thu Jun 21 04:22:50 BST 2012

It is not necessary to check whether we have a current key before
attempting to unpick and decrypt a MSG0.  If we don't,
transform->reverse will simply fail due to lacking a key.

This check needs to be removed, because in forthcoming patches we will
want to be able to try to decrypt the packet with other keys, at which
point the lack of a currently valid data transfer key will not be
relevant and this check will be harmful.

Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
 site.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/site.c b/site.c
index f65051f..4d3a612 100644
--- a/site.c
+++ b/site.c
@@ -715,12 +715,6 @@ static bool_t decrypt_msg0(struct site *st, struct buffer_if *msg0)
     struct msg0 m;
     uint32_t problem;
-    if (!st->current_valid) {
-	slog(st,LOG_DROP,"incoming message but no current key -> dropping");
-	initiate_key_setup(st,"incoming message but no current key");
-	return False;
-    }
     if (!unpick_msg0(st,msg0,&m)) return False;
     problem = st->current_transform->reverse(st->current_transform->st,

More information about the sgo-software-discuss mailing list