return send_ack(c);
}
+ if(!experimental)
+ c->protocol_minor = 0;
+
if(!c->config_tree) {
init_configuration(&c->config_tree);
if(!read_ecdsa_public_key(c))
return false;
} else {
- if(!ecdsa_active(&c->ecdsa))
+ if(c->protocol_minor && !ecdsa_active(&c->ecdsa))
c->protocol_minor = 1;
}
- if(!experimental)
- c->protocol_minor = 0;
-
c->allow_request = METAKEY;
if(c->protocol_minor >= 2)
b64encode(key, key, ECDH_SIZE + siglen);
- bool result = send_request(c, "%d %s", METAKEY, key);
+ return send_request(c, "%d %s", METAKEY, key);
}
bool send_metakey(connection_t *c) {
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;
}
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);
}