@Kyle Hamilton So should all the new programs stick to the idiom or check for -1 return code?
On 11 July 2014 14:56, Ben Laurie <[email protected]> wrote: > On 11 July 2014 09:53, Kyle Hamilton <[email protected]> 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 [email protected] >>> Automated List Manager [email protected] >> >> > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > Development Mailing List [email protected] > Automated List Manager [email protected] -- :-)balaji ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [email protected] Automated List Manager [email protected]
