Browse Source

Merge pull request #1304 from lifecoder-phoenix/openssl

Fix #1257
pull/1313/head
orignal 6 years ago committed by GitHub
parent
commit
ec30ec0996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      libi2pd_client/SAM.cpp

15
libi2pd_client/SAM.cpp

@ -359,6 +359,21 @@ namespace client
} }
forward = std::make_shared<boost::asio::ip::udp::endpoint>(addr, port); forward = std::make_shared<boost::asio::ip::udp::endpoint>(addr, port);
} }
//ensure we actually received a destination
if (destination.empty())
{
SendMessageReply (SAM_SESSION_STATUS_INVALID_KEY, strlen(SAM_SESSION_STATUS_INVALID_KEY), true);
return;
}
//ensure it's a base64 string
i2p::data::PrivateKeys keys;
if (!keys.FromBase64(destination))
{
SendMessageReply(SAM_SESSION_STATUS_INVALID_KEY, strlen(SAM_SESSION_STATUS_INVALID_KEY), true);
return;
}
// create destination // create destination
auto session = m_Owner.CreateSession (id, destination == SAM_VALUE_TRANSIENT ? "" : destination, &params); auto session = m_Owner.CreateSession (id, destination == SAM_VALUE_TRANSIENT ? "" : destination, &params);

Loading…
Cancel
Save