Fix some return checks in ecdh_cms_encrypt()
authortb <tb@openbsd.org>
Mon, 6 Mar 2023 08:37:24 +0000 (08:37 +0000)
committertb <tb@openbsd.org>
Mon, 6 Mar 2023 08:37:24 +0000 (08:37 +0000)
commit139d916e578f38a6e5a4ea8487de707fc3024a53
tree2e7f6851d41b11671cd836cc5dfceadb3970b0a3
parente8c2844556492225fdf8a5f8bf6c15cdec236241
Fix some return checks in ecdh_cms_encrypt()

i2d functions return <= 0 on error, so check for that instead of == 0.

The issue with CMS_SharedInfo_encode() was found by Niels Dossche.
OpenSSL review overlooked that they had turned penclen into a size_t.

In principle the issue with i2d_X509_ALGOR() is purely cosmetic. Why do
a strange check when there is an idiomatic check? Then again this is CMS...

ok jsing
lib/libcrypto/ec/ec_ameth.c