Check validity of Ed25519 key during an upgrade.
This commit is contained in:
parent
5716c8877f
commit
660a2c7d1b
1 changed files with 6 additions and 0 deletions
|
@ -730,6 +730,12 @@ static bool upgrade_h(connection_t *c, const char *request) {
|
|||
return false;
|
||||
}
|
||||
|
||||
c->ecdsa = ecdsa_set_base64_public_key(pubkey);
|
||||
if(!c->ecdsa) {
|
||||
logger(DEBUG_ALWAYS, LOG_INFO, "Got bad Ed25519 public key from %s (%s), not upgrading.", c->name, c->hostname);
|
||||
return false;
|
||||
}
|
||||
|
||||
logger(DEBUG_ALWAYS, LOG_INFO, "Got Ed25519 public key from %s (%s), upgrading!", c->name, c->hostname);
|
||||
append_config_file(c->name, "Ed25519PublicKey", pubkey);
|
||||
c->allow_request = TERMREQ;
|
||||
|
|
Loading…
Reference in a new issue