Browse Source

check ctx for null

pull/1474/head
orignal 5 years ago
parent
commit
7168738835
  1. 2
      libi2pd/CryptoKey.cpp

2
libi2pd/CryptoKey.cpp

@ -14,6 +14,7 @@ namespace crypto @@ -14,6 +14,7 @@ namespace crypto
void ElGamalEncryptor::Encrypt (const uint8_t * data, uint8_t * encrypted, BN_CTX * ctx, bool zeroPadding)
{
if (!ctx) return;
ElGamalEncrypt (m_PublicKey, data, encrypted, ctx, zeroPadding);
}
@ -24,6 +25,7 @@ namespace crypto @@ -24,6 +25,7 @@ namespace crypto
bool ElGamalDecryptor::Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx, bool zeroPadding)
{
if (!ctx) return false;
return ElGamalDecrypt (m_PrivateKey, encrypted, data, ctx, zeroPadding);
}

Loading…
Cancel
Save