Fix typos

This commit is contained in:
Dimitris Apostolou 2021-11-12 18:33:51 +02:00
parent 4052b1ea6d
commit 8ee9c437e1
No known key found for this signature in database
GPG Key ID: 4B5D20E938204A8A
13 changed files with 17 additions and 17 deletions

View File

@ -106,7 +106,7 @@ namespace crypto
BN_CTX * m_Ctx; BN_CTX * m_Ctx;
uint8_t m_PrivateKey[32]; uint8_t m_PrivateKey[32];
#endif #endif
bool m_IsElligatorIneligible = false; // true if definitly ineligible bool m_IsElligatorIneligible = false; // true if definitely ineligible
}; };
// ElGamal // ElGamal

View File

@ -271,7 +271,7 @@ namespace garlic
(*numCloves)++; (*numCloves)++;
} }
} }
if (msg) // clove message ifself if presented if (msg) // clove message itself if presented
{ {
size += CreateGarlicClove (payload + size, msg, m_Destination ? m_Destination->IsDestination () : false); size += CreateGarlicClove (payload + size, msg, m_Destination ? m_Destination->IsDestination () : false);
(*numCloves)++; (*numCloves)++;
@ -542,7 +542,7 @@ namespace garlic
auto session = std::make_shared<ECIESX25519AEADRatchetSession> (this, false); // incoming auto session = std::make_shared<ECIESX25519AEADRatchetSession> (this, false); // incoming
if (!session->HandleNextMessage (buf, length, nullptr, 0)) if (!session->HandleNextMessage (buf, length, nullptr, 0))
{ {
// try to gererate more tags for last tagset // try to generate more tags for last tagset
if (m_LastTagset && (m_LastTagset->GetNextIndex () - m_LastTagset->GetTrimBehind () < 3*ECIESX25519_MAX_NUM_GENERATED_TAGS)) if (m_LastTagset && (m_LastTagset->GetNextIndex () - m_LastTagset->GetTrimBehind () < 3*ECIESX25519_MAX_NUM_GENERATED_TAGS))
{ {
uint64_t missingTag; memcpy (&missingTag, buf, 8); uint64_t missingTag; memcpy (&missingTag, buf, 8);

View File

@ -681,7 +681,7 @@ namespace transport
auto addr = ri.GetNTCP2AddressWithStaticKey (m_Establisher->m_RemoteStaticKey); auto addr = ri.GetNTCP2AddressWithStaticKey (m_Establisher->m_RemoteStaticKey);
if (!addr) if (!addr)
{ {
LogPrint (eLogError, "NTCP2: No NTCP2 address wth static key found in SessionConfirmed"); LogPrint (eLogError, "NTCP2: No NTCP2 address with static key found in SessionConfirmed");
Terminate (); Terminate ();
return; return;
} }
@ -973,7 +973,7 @@ namespace transport
{ {
// allocate send buffer // allocate send buffer
m_NextSendBuffer = new uint8_t[287]; // can be any size > 16, we just allocate 287 frequently m_NextSendBuffer = new uint8_t[287]; // can be any size > 16, we just allocate 287 frequently
// crate padding block // create padding block
auto paddingLen = CreatePaddingBlock (totalLen, m_NextSendBuffer, 287 - 16); auto paddingLen = CreatePaddingBlock (totalLen, m_NextSendBuffer, 287 - 16);
// and padding block to encrypt and send // and padding block to encrypt and send
if (paddingLen) if (paddingLen)

View File

@ -1261,7 +1261,7 @@ namespace data
return it->second; return it->second;
it++; it++;
} }
// still not found, try from the begining // still not found, try from the beginning
it = m_RouterInfos.begin (); it = m_RouterInfos.begin ();
while (it != it1 && it != m_RouterInfos.end ()) while (it != it1 && it != m_RouterInfos.end ())
{ {
@ -1269,7 +1269,7 @@ namespace data
return it->second; return it->second;
it++; it++;
} }
// still not found, try to the begining // still not found, try to the beginning
it = it2; it = it2;
while (it != m_RouterInfos.end ()) while (it != m_RouterInfos.end ())
{ {

View File

@ -1020,7 +1020,7 @@ namespace transport
void SSUSession::ProcessPeerTest (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& senderEndpoint) void SSUSession::ProcessPeerTest (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& senderEndpoint)
{ {
uint32_t nonce = bufbe32toh (buf); // 4 bytes uint32_t nonce = bufbe32toh (buf); // 4 bytes
boost::asio::ip::address addr; // Alice's addresss boost::asio::ip::address addr; // Alice's address
uint16_t port = 0; // and port uint16_t port = 0; // and port
auto size = ExtractIPAddressAndPort (buf + 4, len - 4, addr, port); auto size = ExtractIPAddressAndPort (buf + 4, len - 4, addr, port);
if (port && (size != 7) && (size != 19)) if (port && (size != 7) && (size != 19))

View File

@ -102,7 +102,7 @@ namespace stream
LogPrint (eLogDebug, "Streaming: Stream deleted"); LogPrint (eLogDebug, "Streaming: Stream deleted");
} }
void Stream::Terminate (bool deleteFromDestination) // shoudl be called from StreamingDestination::Stop only void Stream::Terminate (bool deleteFromDestination) // should be called from StreamingDestination::Stop only
{ {
m_Status = eStreamStatusTerminated; m_Status = eStreamStatusTerminated;
m_AckSendTimer.cancel (); m_AckSendTimer.cancel ();

View File

@ -111,7 +111,7 @@ namespace stream
buf = new uint8_t[len]; buf = new uint8_t[len];
memcpy (buf, b, len); memcpy (buf, b, len);
} }
SendBuffer (size_t l): // creat empty buffer SendBuffer (size_t l): // create empty buffer
len(l), offset (0) len(l), offset (0)
{ {
buf = new uint8_t[len]; buf = new uint8_t[len];
@ -366,7 +366,7 @@ namespace stream
handler (boost::asio::error::make_error_code (boost::asio::error::timed_out), received); handler (boost::asio::error::make_error_code (boost::asio::error::timed_out), received);
else else
{ {
// itermediate iterrupt // itermediate interrupt
SendUpdatedLeaseSet (); // send our leaseset if applicable SendUpdatedLeaseSet (); // send our leaseset if applicable
AsyncReceive (buffer, handler, remainingTimeout); AsyncReceive (buffer, handler, remainingTimeout);
} }

View File

@ -30,7 +30,7 @@ namespace tunnel
m_NumReceivedBytes += TUNNEL_DATA_MSG_SIZE; m_NumReceivedBytes += TUNNEL_DATA_MSG_SIZE;
uint8_t * decrypted = msg->GetPayload () + 20; // 4 + 16 uint8_t * decrypted = msg->GetPayload () + 20; // 4 + 16
uint8_t * zero = (uint8_t *)memchr (decrypted + 4, 0, TUNNEL_DATA_ENCRYPTED_SIZE - 4); // witout 4-byte checksum uint8_t * zero = (uint8_t *)memchr (decrypted + 4, 0, TUNNEL_DATA_ENCRYPTED_SIZE - 4); // without 4-byte checksum
if (zero) if (zero)
{ {
uint8_t * fragment = zero + 1; uint8_t * fragment = zero + 1;

View File

@ -49,7 +49,7 @@ namespace tunnel
void HandleFollowOnFragment (uint32_t msgID, bool isLastFragment, uint8_t fragmentNum, const uint8_t * fragment, size_t size); void HandleFollowOnFragment (uint32_t msgID, bool isLastFragment, uint8_t fragmentNum, const uint8_t * fragment, size_t size);
bool ConcatFollowOnFragment (TunnelMessageBlockEx& msg, const uint8_t * fragment, size_t size) const; // true if success bool ConcatFollowOnFragment (TunnelMessageBlockEx& msg, const uint8_t * fragment, size_t size) const; // true if success
void HandleCurrenMessageFollowOnFragment (const uint8_t * frgament, size_t size, bool isLastFragment); void HandleCurrenMessageFollowOnFragment (const uint8_t * fragment, size_t size, bool isLastFragment);
void HandleNextMessage (const TunnelMessageBlock& msg); void HandleNextMessage (const TunnelMessageBlock& msg);
void AddOutOfSequenceFragment (uint32_t msgID, uint8_t fragmentNum, bool isLastFragment, const uint8_t * fragment, size_t size); void AddOutOfSequenceFragment (uint32_t msgID, uint8_t fragmentNum, bool isLastFragment, const uint8_t * fragment, size_t size);

View File

@ -63,7 +63,7 @@ namespace client
const char BOB_HELP_OUTPORT[] = "outport <PORT_NUMBER> - Set the outbound port that nickname contacts."; const char BOB_HELP_OUTPORT[] = "outport <PORT_NUMBER> - Set the outbound port that nickname contacts.";
const char BOB_HELP_INHOST[] = "inhost <HOSTNAME|IP> - Set the inbound hostname or IP."; const char BOB_HELP_INHOST[] = "inhost <HOSTNAME|IP> - Set the inbound hostname or IP.";
const char BOB_HELP_INPORT[] = "inport <PORT_NUMBER> - Set the inbound port number nickname listens on."; const char BOB_HELP_INPORT[] = "inport <PORT_NUMBER> - Set the inbound port number nickname listens on.";
const char BOB_HELP_QUIET[] = "quiet <True|False> - Wether to send the incoming destination."; const char BOB_HELP_QUIET[] = "quiet <True|False> - Whether to send the incoming destination.";
const char BOB_HELP_LOOKUP[] = "lookup <I2P_HOSTNAME> - Look up an I2P hostname."; const char BOB_HELP_LOOKUP[] = "lookup <I2P_HOSTNAME> - Look up an I2P hostname.";
const char BOB_HELP_CLEAR[] = "clear - Clear the current nickname out of the list."; const char BOB_HELP_CLEAR[] = "clear - Clear the current nickname out of the list.";
const char BOB_HELP_LIST[] = "list - List all tunnels."; const char BOB_HELP_LIST[] = "list - List all tunnels.";

View File

@ -205,7 +205,7 @@ namespace client
} }
else // closed by peer else // closed by peer
{ {
// get remaning data // get remaining data
auto len = m_Stream->ReadSome (m_StreamBuffer, I2P_TUNNEL_CONNECTION_BUFFER_SIZE); auto len = m_Stream->ReadSome (m_StreamBuffer, I2P_TUNNEL_CONNECTION_BUFFER_SIZE);
if (len > 0) // still some data if (len > 0) // still some data
Write (m_StreamBuffer, len); Write (m_StreamBuffer, len);

View File

@ -936,7 +936,7 @@ namespace client
else // closed by peer else // closed by peer
{ {
uint8_t * buff = new uint8_t[SAM_SOCKET_BUFFER_SIZE]; uint8_t * buff = new uint8_t[SAM_SOCKET_BUFFER_SIZE];
// get remaning data // get remaining data
auto len = m_Stream->ReadSome (buff, SAM_SOCKET_BUFFER_SIZE); auto len = m_Stream->ReadSome (buff, SAM_SOCKET_BUFFER_SIZE);
if (len > 0) // still some data if (len > 0) // still some data
{ {

View File

@ -1,4 +1,4 @@
// See swig.org for more inteface options, // See swig.org for more interface options,
// e.g. map std::string to Go string // e.g. map std::string to Go string
%{ %{