Tongsuo-Project / Tongsuo

铜锁/Tongsuo is a Modern Cryptographic Primitives and Protocols Library
https://www.tongsuo.net
Apache License 2.0
1.11k stars 180 forks source link

pkey_ecx_keygen issue #540

Open naghaabirami opened 9 months ago

naghaabirami commented 9 months ago

Babassl branch:8.4-stable

When we run speed test for our engine code , we get: EC key generation failure. 00C4C473627F0000:error:08000066:elliptic curve routines:ossl_ecx_key_op:invalid encoding:crypto/ec/ecx_backend.c:182: ECDH key generation failure.

In ossl_ecx_key_op() function , ecx_key_op_t parameter may not be correct. The parameter should be KEY_OP_KEYGEN instead of KEY_OP_PUBLIC as this function is use for key generation.

There is a openssl ticket for similar issue: https://github.com/openssl/openssl/issues/19580

We need similar kind of fix in babassl to avoid this issue.

InfoHunter commented 9 months ago

PR created as #544