don't pass BN_CTX to encrypt/decrypt functions

This commit is contained in:
orignal 2021-08-31 18:51:40 -04:00
parent c45e202fab
commit bb518d3d51
19 changed files with 81 additions and 85 deletions

View file

@ -111,11 +111,7 @@ namespace tunnel
uint8_t * record = records + recordIndex*TUNNEL_BUILD_RECORD_SIZE;
auto encryptor = ident->CreateEncryptor (nullptr);
if (encryptor)
{
BN_CTX * ctx = BN_CTX_new ();
encryptor->Encrypt (clearText, record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET, ctx, false);
BN_CTX_free (ctx);
}
encryptor->Encrypt (clearText, record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET, false);
memcpy (record + BUILD_REQUEST_RECORD_TO_PEER_OFFSET, (const uint8_t *)ident->GetIdentHash (), 16);
}