In EC_POINT_invert(), actually check the correct function pointer for NULL
authormiod <miod@openbsd.org>
Tue, 15 Apr 2014 18:55:21 +0000 (18:55 +0000)
committermiod <miod@openbsd.org>
Tue, 15 Apr 2014 18:55:21 +0000 (18:55 +0000)
before attempting to invoke it; trivial one-liner in OpenSSL RT #2569 ignored
for 2.5 years.

lib/libcrypto/ec/ec_lib.c
lib/libssl/src/crypto/ec/ec_lib.c

index de9a0cc..e2c4741 100644 (file)
@@ -942,7 +942,7 @@ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *
 
 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)
        {
-       if (group->meth->dbl == 0)
+       if (group->meth->invert == 0)
                {
                ECerr(EC_F_EC_POINT_INVERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;
index de9a0cc..e2c4741 100644 (file)
@@ -942,7 +942,7 @@ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *
 
 int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)
        {
-       if (group->meth->dbl == 0)
+       if (group->meth->invert == 0)
                {
                ECerr(EC_F_EC_POINT_INVERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
                return 0;