crypto/engine/eng_cryptodev.c: fix bignum<->crp conversion
authorRichard Levitte <levitte@openssl.org>
Mon, 11 Feb 2019 11:22:02 +0000 (12:22 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 11 Feb 2019 11:22:02 +0000 (12:22 +0100)
commit54a622697eced33a6029fd5e7dd452cfb99bb72e
treef09b8bddbebfad37f72e1adbfb70f5bba30fd3f2
parent152abc5522d869668f50deeb99cd0d948d0df4c1
crypto/engine/eng_cryptodev.c: fix bignum<->crp conversion

bn2crparam() incorrectly delivered a big endian byte string to cryptodev.
Using BN_bn2lebinpad() instead of BN_bn2bin() fixes this.

crparam2bn() had a hack that avoided this issue in the other direction,
but allocated an intermediary chunk of memory to get correct endianness.
Using BN_lebin2bn() avoids this allocation.

Fixes #8202

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8204)
crypto/engine/eng_cryptodev.c