add workaround for i2p/libsam3#15

This commit is contained in:
sehraf 2020-11-27 17:09:02 +01:00
parent 59fa96eb5f
commit 9c71177d3b
No known key found for this signature in database
GPG Key ID: DF09F6EAE356B2C6

View File

@ -616,9 +616,17 @@ bool p3I2pSam3::generateKey(std::string &pub, std::string &priv)
RS_DBG("got error: ", ss.error); RS_DBG("got error: ", ss.error);
return false; return false;
} }
pub = std::string(ss.pubkey); pub = std::string(ss.pubkey);
priv = std::string(ss.privkey); priv = std::string(ss.privkey);
// sanity check
auto p = i2p::publicKeyFromPrivate(priv);
if (p != pub) {
RS_WARN("public key does not match private key! fixing ...");
pub = p;
}
RS_DBG2("publuc key / address ", pub); RS_DBG2("publuc key / address ", pub);
RS_DBG2("private key ", priv); RS_DBG2("private key ", priv);