From 9c71177d3b6c8f8072e620b275e682277bc9f3ec Mon Sep 17 00:00:00 2001 From: sehraf Date: Fri, 27 Nov 2020 17:09:02 +0100 Subject: [PATCH] add workaround for i2p/libsam3#15 --- libretroshare/src/services/autoproxy/p3i2psam3.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libretroshare/src/services/autoproxy/p3i2psam3.cpp b/libretroshare/src/services/autoproxy/p3i2psam3.cpp index 47123328a..a708517e2 100644 --- a/libretroshare/src/services/autoproxy/p3i2psam3.cpp +++ b/libretroshare/src/services/autoproxy/p3i2psam3.cpp @@ -616,9 +616,17 @@ bool p3I2pSam3::generateKey(std::string &pub, std::string &priv) RS_DBG("got error: ", ss.error); return false; } + pub = std::string(ss.pubkey); 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("private key ", priv);