update i2psam3

This commit is contained in:
sehraf 2020-11-27 15:24:44 +01:00
parent 36e238951f
commit 719adaae9b
No known key found for this signature in database
GPG Key ID: DF09F6EAE356B2C6

View File

@ -64,12 +64,12 @@ bool p3I2pSam3::initialSetup(std::string &addr, uint16_t &/*port*/)
RS_STACK_MUTEX(mLock); RS_STACK_MUTEX(mLock);
if (!mSetting.address.publicKey.empty() || !mSetting.address.privateKey.empty()) if (!mSetting.address.publicKey.empty() || !mSetting.address.privateKey.empty())
RS_DBG("overwriting keys!"); RS_WARN("overwriting keys!");
bool success = generateKey(mSetting.address.publicKey, mSetting.address.privateKey); bool success = generateKey(mSetting.address.publicKey, mSetting.address.privateKey);
if (!success) { if (!success) {
RS_DBG("failed to retrieve keys"); RS_WARN("failed to retrieve keys");
return false; return false;
} else { } else {
std::string s, c; std::string s, c;
@ -613,14 +613,14 @@ bool p3I2pSam3::generateKey(std::string &pub, std::string &priv)
Sam3Session ss; Sam3Session ss;
if (0 > sam3GenerateKeys(&ss, SAM3_HOST_DEFAULT, SAM3_PORT_DEFAULT, Sam3SigType::EdDSA_SHA512_Ed25519)) { if (0 > sam3GenerateKeys(&ss, SAM3_HOST_DEFAULT, SAM3_PORT_DEFAULT, Sam3SigType::EdDSA_SHA512_Ed25519)) {
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);
RS_DBG2("publuc key / address", pub); RS_DBG2("publuc key / address ", pub);
RS_DBG2("private key", priv); RS_DBG2("private key ", priv);
return true; return true;
} }