On 11 July 2014 09:53, Kyle Hamilton <aerow...@gmail.com> wrote: > EC_POINT_is_on_curve is documented to return -1 on error, 0 if it's not > on the curve, and 1 if it is on the curve. > > However, this breaks the standard idiom if(!EC_POINT_is_on_curve()) { > return BAD_KEY; }, because it requires an additional test for an error > condition.
Plenty of OpenSSL functions return -1, 0, 1. Plenty also return 0, 1. Its not optimal. > I don't know what the best outcome would be in this situation. > > -Kyle H > > On 7/11/2014 12:34 AM, balaji marisetti wrote: >> Hi All, >> >> I have a doubt. Shouldn't the `EC_POINT_...` methods be returning -1 >> instead of 0 on error conditions? >> >> Thanks, >> Balaji M >> ______________________________________________________________________ >> OpenSSL Project http://www.openssl.org >> Development Mailing List openssl-dev@openssl.org >> Automated List Manager majord...@openssl.org > > ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager majord...@openssl.org