From 6af82260ba2d6bbf296932aa95dddec0be5abcbb Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 29 Oct 2016 20:56:43 +0200 Subject: [PATCH] Fix bit shifting arithmetic so the code actually does what the last commit message says. --- src/protocol_auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol_auth.c b/src/protocol_auth.c index ddecbc6..96e6b6e 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -195,7 +195,7 @@ bool send_metakey(connection_t *c) { return false; } - c->outbudget = (uint64_t)4 << EVP_CIPHER_key_length(c->outcipher); + c->outbudget = (uint64_t)1 << EVP_CIPHER_key_length(c->outcipher) * 4; c->status.encryptout = true; } @@ -274,7 +274,7 @@ bool metakey_h(connection_t *c) { return false; } - c->inbudget = (uint64_t)4 << EVP_CIPHER_key_length(c->incipher); + c->inbudget = (uint64_t)1 << EVP_CIPHER_key_length(c->incipher) * 4; c->status.decryptin = true; } else { c->incipher = NULL; -- 2.25.1