Enforce maximum amount of bytes sent/received on meta-connections.
[tinc] / src / protocol_auth.c
index aee5736..224b6d8 100644 (file)
@@ -436,6 +436,8 @@ bool send_metakey(connection_t *c) {
        if(!c)
                return false;
 
+       c->outbudget = cipher_budget(c->outcipher);
+
        if(!(c->outdigest = digest_open_by_name("sha256", -1)))
                return false;
 
@@ -548,6 +550,8 @@ bool metakey_h(connection_t *c, const char *request) {
                c->incipher = NULL;
        }
 
+       c->inbudget = cipher_budget(c->incipher);
+
        if(digest) {
                if(!(c->indigest = digest_open_by_nid(digest, -1))) {
                        logger(DEBUG_ALWAYS, LOG_ERR, "Error during initialisation of digest from %s (%s)", c->name, c->hostname);