Use usleep() instead of sleep(), MinGW complained.
[tinc] / src / protocol_auth.c
index fe935e1..4331e94 100644 (file)
@@ -285,10 +285,10 @@ static bool metakey_ec_h(connection_t *c, const char *request) {
 
        free(seed);
 
-       cipher_set_key(&c->incipher, mykey, true);
+       cipher_set_key(&c->incipher, mykey, false);
        digest_set_key(&c->indigest, mykey + mykeylen, mykeylen);
 
-       cipher_set_key(&c->outcipher, hiskey, false);
+       cipher_set_key(&c->outcipher, hiskey, true);
        digest_set_key(&c->outdigest, hiskey + hiskeylen, hiskeylen);
 
        c->status.decryptin = true;
@@ -547,7 +547,7 @@ static bool upgrade_h(connection_t *c, char *request) {
        }
 
        logger(LOG_INFO, "Got ECDSA public key from %s (%s), upgrading!", c->name, c->hostname);
-       append_connection_config(c, "ECDSAPublicKey", pubkey);
+       append_config_file(c->name, "ECDSAPublicKey", pubkey);
        c->allow_request = TERMREQ;
        return send_termreq(c);
 }