Browse Source

check if offline signature is expired when load keys

pull/2076/head
orignal 5 months ago
parent
commit
5af13849a9
  1. 7
      libi2pd/Identity.cpp

7
libi2pd/Identity.cpp

@ -479,7 +479,12 @@ namespace data
{ {
// offline information // offline information
const uint8_t * offlineInfo = buf + ret; const uint8_t * offlineInfo = buf + ret;
ret += 4; // expires timestamp uint32_t expires = bufbe32toh (buf + ret); ret += 4; // expires timestamp
if (expires < i2p::util::GetSecondsSinceEpoch ())
{
LogPrint (eLogError, "Identity: Offline signature expired");
return 0;
}
SigningKeyType keyType = bufbe16toh (buf + ret); ret += 2; // key type SigningKeyType keyType = bufbe16toh (buf + ret); ret += 2; // key type
std::unique_ptr<i2p::crypto::Verifier> transientVerifier (IdentityEx::CreateVerifier (keyType)); std::unique_ptr<i2p::crypto::Verifier> transientVerifier (IdentityEx::CreateVerifier (keyType));
if (!transientVerifier) return 0; if (!transientVerifier) return 0;

Loading…
Cancel
Save