Skip to content

Commit

Permalink
Merge pull request PurpleI2P#1304 from lifecoder-phoenix/openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal authored Feb 25, 2019
2 parents 846eac2 + cdecb7a commit ec30ec0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libi2pd_client/SAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,21 @@ namespace client
}
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
auto session = m_Owner.CreateSession (id, destination == SAM_VALUE_TRANSIENT ? "" : destination, &params);
Expand Down

0 comments on commit ec30ec0

Please sign in to comment.