Fix bit shifting arithmetic so the code actually does what the last commit message...
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 29 Oct 2016 18:56:43 +0000 (20:56 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 29 Oct 2016 18:56:43 +0000 (20:56 +0200)
src/protocol_auth.c

index ddecbc62eb1f45170f69fa0581c435a45e7bf228..96e6b6e2953ccc39d34944aa9e22f87425010e3b 100644 (file)
@@ -195,7 +195,7 @@ bool send_metakey(connection_t *c) {
                        return false;
                }
 
                        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;
        }
 
                c->status.encryptout = true;
        }
 
@@ -274,7 +274,7 @@ bool metakey_h(connection_t *c) {
                        return false;
                }
 
                        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;
                c->status.decryptin = true;
        } else {
                c->incipher = NULL;