Browse Source

CRYPTO_TYPE for DEST GENERATE

pull/1019/head
orignal 7 years ago
parent
commit
a1e820182c
  1. 6
      libi2pd_client/SAM.cpp

6
libi2pd_client/SAM.cpp

@ -489,11 +489,15 @@ namespace client
ExtractParams (buf, params); ExtractParams (buf, params);
// extract signature type // extract signature type
i2p::data::SigningKeyType signatureType = i2p::data::SIGNING_KEY_TYPE_DSA_SHA1; i2p::data::SigningKeyType signatureType = i2p::data::SIGNING_KEY_TYPE_DSA_SHA1;
i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL;
auto it = params.find (SAM_PARAM_SIGNATURE_TYPE); auto it = params.find (SAM_PARAM_SIGNATURE_TYPE);
if (it != params.end ()) if (it != params.end ())
// TODO: extract string values // TODO: extract string values
signatureType = std::stoi(it->second); signatureType = std::stoi(it->second);
auto keys = i2p::data::PrivateKeys::CreateRandomKeys (signatureType); it = params.find (SAM_PARAM_CRYPTO_TYPE);
if (it != params.end ())
cryptoType = std::stoi(it->second);
auto keys = i2p::data::PrivateKeys::CreateRandomKeys (signatureType, cryptoType);
#ifdef _MSC_VER #ifdef _MSC_VER
size_t l = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_DEST_REPLY, size_t l = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_DEST_REPLY,
keys.GetPublic ()->ToBase64 ().c_str (), keys.ToBase64 ().c_str ()); keys.GetPublic ()->ToBase64 ().c_str (), keys.ToBase64 ().c_str ());

Loading…
Cancel
Save