save new onion key

pull/268/head
Jeff Becker 5 years ago
parent 828f1f82d7
commit 88285de3af
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -673,16 +673,17 @@ namespace llarp
if(rotateKeys)
{
crypto.encryption_keygen(nextOnionKey);
nextRC.enckey = llarp::seckey_topublic(nextOnionKey);
std::string f = encryption_keyfile.string();
if(nextOnionKey.SaveToFile(f.c_str()))
{
nextRC.enckey = llarp::seckey_topublic(nextOnionKey);
encryption = nextOnionKey;
}
}
nextRC.last_updated = Now();
if(!nextRC.Sign(&crypto, identity))
return false;
_rc = nextRC;
if(rotateKeys)
{
encryption = nextOnionKey;
}
// propagate RC by renegotiating sessions
ForEachPeer([](llarp::ILinkSession *s) {
if(s->RenegotiateSession())

Loading…
Cancel
Save