mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
update i2psam3
This commit is contained in:
parent
36e238951f
commit
719adaae9b
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user