mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 12:17:49 +02:00
Logging: finish capitalization fixups
This commit is contained in:
parent
cc1e8e3dcf
commit
789a31e16d
23 changed files with 700 additions and 700 deletions
|
@ -77,23 +77,23 @@ namespace data
|
|||
LogPrint (eLogError, "LeaseSet: ", size, " exceeds buffer size ", m_BufferLen);
|
||||
m_IsValid = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
uint8_t num = m_Buffer[size];
|
||||
size++; // num
|
||||
LogPrint (eLogDebug, "LeaseSet: read num=", (int)num);
|
||||
if (!num || num > MAX_NUM_LEASES)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet: incorrect number of leases", (int)num);
|
||||
LogPrint (eLogError, "LeaseSet: Incorrect number of leases", (int)num);
|
||||
m_IsValid = false;
|
||||
return;
|
||||
}
|
||||
if (size + num*LEASE_SIZE > m_BufferLen)
|
||||
{
|
||||
if (size + num*LEASE_SIZE > m_BufferLen)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet: ", size, " exceeds buffer size ", m_BufferLen);
|
||||
m_IsValid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
UpdateLeasesBegin ();
|
||||
// process leases
|
||||
m_ExpirationTime = 0;
|
||||
|
@ -112,7 +112,7 @@ namespace data
|
|||
}
|
||||
if (!m_ExpirationTime)
|
||||
{
|
||||
LogPrint (eLogWarning, "LeaseSet: all leases are expired. Dropped");
|
||||
LogPrint (eLogWarning, "LeaseSet: All leases have expired, dropping");
|
||||
m_IsValid = false;
|
||||
return;
|
||||
}
|
||||
|
@ -121,16 +121,16 @@ namespace data
|
|||
|
||||
// verify
|
||||
if (verifySignature)
|
||||
{
|
||||
{
|
||||
auto signedSize = leases - m_Buffer;
|
||||
if (signedSize + m_Identity->GetSignatureLen () > m_BufferLen)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet: Signature exceeds buffer size ", m_BufferLen);
|
||||
m_IsValid = false;
|
||||
}
|
||||
}
|
||||
else if (!m_Identity->Verify (m_Buffer, signedSize, leases))
|
||||
{
|
||||
LogPrint (eLogWarning, "LeaseSet: verification failed");
|
||||
LogPrint (eLogWarning, "LeaseSet: Verification failed");
|
||||
m_IsValid = false;
|
||||
}
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ namespace data
|
|||
{
|
||||
if (len <= m_BufferLen) m_BufferLen = len;
|
||||
else
|
||||
LogPrint (eLogError, "LeaseSet2: actual buffer size ", len , " exceeds full buffer size ", m_BufferLen);
|
||||
LogPrint (eLogError, "LeaseSet2: Actual buffer size ", len , " exceeds full buffer size ", m_BufferLen);
|
||||
}
|
||||
|
||||
LeaseSet2::LeaseSet2 (uint8_t storeType, const uint8_t * buf, size_t len, bool storeLeases, CryptoKeyType preferredCrypto):
|
||||
|
@ -331,7 +331,7 @@ namespace data
|
|||
m_TransientVerifier = ProcessOfflineSignature (identity, buf, len, offset);
|
||||
if (!m_TransientVerifier)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet2: offline signature failed");
|
||||
LogPrint (eLogError, "LeaseSet2: Offline signature failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ namespace data
|
|||
bool verified = verifier->Verify (buf - 1, signatureOffset + 1, buf + signatureOffset);
|
||||
const_cast<uint8_t *>(buf)[-1] = c;
|
||||
if (!verified)
|
||||
LogPrint (eLogWarning, "LeaseSet2: verification failed");
|
||||
LogPrint (eLogWarning, "LeaseSet2: Verification failed");
|
||||
return verified;
|
||||
}
|
||||
|
||||
|
@ -489,7 +489,7 @@ namespace data
|
|||
m_TransientVerifier = ProcessOfflineSignature (blindedVerifier, buf, len, offset);
|
||||
if (!m_TransientVerifier)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet2: offline signature failed");
|
||||
LogPrint (eLogError, "LeaseSet2: Offline signature failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -515,7 +515,7 @@ namespace data
|
|||
key->GetBlindedKey (date, blinded.data ());
|
||||
if (memcmp (blindedPublicKey, blinded.data (), blindedKeyLen))
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet2: blinded public key doesn't match");
|
||||
LogPrint (eLogError, "LeaseSet2: Blinded public key doesn't match");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ namespace data
|
|||
ReadFromBuffer (innerPlainText.data () + 1, lenInnerPlaintext - 1);
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "LeaseSet2: unexpected LeaseSet type ", (int)innerPlainText[0], " inside encrypted LeaseSet");
|
||||
LogPrint (eLogError, "LeaseSet2: Unexpected LeaseSet type ", (int)innerPlainText[0], " inside encrypted LeaseSet");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -653,7 +653,7 @@ namespace data
|
|||
LogPrint (eLogError, "LeaseSet2: Can't calculate authCookie: psk_i is not provided");
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "LeaseSet2: unknown client auth type ", (int)flag);
|
||||
LogPrint (eLogError, "LeaseSet2: Unknown client auth type ", (int)flag);
|
||||
}
|
||||
return offset - 1;
|
||||
}
|
||||
|
@ -768,7 +768,7 @@ namespace data
|
|||
size_t size = ident.GetFullLen ();
|
||||
if (size > sz)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet: identity length ", size, " exceeds buffer size ", sz);
|
||||
LogPrint (eLogError, "LeaseSet: Identity length ", size, " exceeds buffer size ", sz);
|
||||
return false;
|
||||
}
|
||||
// encryption key
|
||||
|
@ -779,7 +779,7 @@ namespace data
|
|||
++size;
|
||||
if (!numLeases || numLeases > MAX_NUM_LEASES)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet: incorrect number of leases", (int)numLeases);
|
||||
LogPrint (eLogError, "LeaseSet: Incorrect number of leases", (int)numLeases);
|
||||
return false;
|
||||
}
|
||||
const uint8_t * leases = ptr + size;
|
||||
|
@ -863,17 +863,17 @@ namespace data
|
|||
}
|
||||
// update expiration
|
||||
if (expirationTime)
|
||||
{
|
||||
{
|
||||
SetExpirationTime (expirationTime*1000LL);
|
||||
auto expires = (int)expirationTime - timestamp;
|
||||
htobe16buf (expiresBuf, expires > 0 ? expires : 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// no tunnels or withdraw
|
||||
SetExpirationTime (timestamp*1000LL);
|
||||
memset (expiresBuf, 0, 2); // expires immeditely
|
||||
}
|
||||
}
|
||||
// sign
|
||||
keys.Sign (m_Buffer, offset, m_Buffer + offset); // LS + leading store type
|
||||
}
|
||||
|
@ -979,7 +979,7 @@ namespace data
|
|||
m_StoreHash = blindedKey->GetStoreHash ();
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "LeaseSet2: couldn't extract inner layer");
|
||||
LogPrint (eLogError, "LeaseSet2: Couldn't extract inner layer");
|
||||
}
|
||||
|
||||
void LocalEncryptedLeaseSet2::CreateClientAuthData (const uint8_t * subcredential, int authType, std::shared_ptr<std::vector<AuthPublicKey> > authKeys, const uint8_t * authCookie, uint8_t * authData) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue