mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-18 16:49:58 +00:00
check certificate size
This commit is contained in:
parent
c07928144c
commit
145e36925f
@ -302,14 +302,14 @@ namespace data
|
|||||||
|
|
||||||
SigningKeyType IdentityEx::GetSigningKeyType () const
|
SigningKeyType IdentityEx::GetSigningKeyType () const
|
||||||
{
|
{
|
||||||
if (m_StandardIdentity.certificate[0] == CERTIFICATE_TYPE_KEY && m_ExtendedBuffer)
|
if (m_StandardIdentity.certificate[0] == CERTIFICATE_TYPE_KEY && m_ExtendedLen >= 2)
|
||||||
return bufbe16toh (m_ExtendedBuffer); // signing key
|
return bufbe16toh (m_ExtendedBuffer); // signing key
|
||||||
return SIGNING_KEY_TYPE_DSA_SHA1;
|
return SIGNING_KEY_TYPE_DSA_SHA1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CryptoKeyType IdentityEx::GetCryptoKeyType () const
|
CryptoKeyType IdentityEx::GetCryptoKeyType () const
|
||||||
{
|
{
|
||||||
if (m_StandardIdentity.certificate[0] == CERTIFICATE_TYPE_KEY && m_ExtendedBuffer)
|
if (m_StandardIdentity.certificate[0] == CERTIFICATE_TYPE_KEY && m_ExtendedLen >= 4)
|
||||||
return bufbe16toh (m_ExtendedBuffer + 2); // crypto key
|
return bufbe16toh (m_ExtendedBuffer + 2); // crypto key
|
||||||
return CRYPTO_KEY_TYPE_ELGAMAL;
|
return CRYPTO_KEY_TYPE_ELGAMAL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user