[openssl-dev] [openssl.org #3863] [PATCH] ECC: Add missing NULL check. Set a flag.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[openssl-dev] [openssl.org #3863] [PATCH] ECC: Add missing NULL check. Set a flag.

Rich Salz via RT
Set point->Z_is_one flag after setting point->Z to one. Also check
BIGNUM for NULL before passing it to get_affine_coordinates.

BBB


From c9dc41fc0b91d7b3bf53871049881a68ed655bcf Mon Sep 17 00:00:00 2001
From: Billy Brumley <[hidden email]>
Date: Tue, 26 May 2015 17:35:03 +0300
Subject: [PATCH] ECC: Add missing NULL check. Set a flag.

---
 crypto/ec/ec2_smpl.c | 1 +
 crypto/ec/ec_key.c   | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c
index d6a41a4..eafe4ae 100644
--- a/crypto/ec/ec2_smpl.c
+++ b/crypto/ec/ec2_smpl.c
@@ -742,6 +742,7 @@ int ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
         goto err;
     if (!BN_one(point->Z))
         goto err;
+    point->Z_is_one = 1;
 
     ret = 1;
 
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c
index 07c33fe..e6cd2dd 100644
--- a/crypto/ec/ec_key.c
+++ b/crypto/ec/ec_key.c
@@ -369,6 +369,8 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
 
     tx = BN_CTX_get(ctx);
     ty = BN_CTX_get(ctx);
+    if (ty == NULL)
+        goto err;
 #ifndef OPENSSL_NO_EC2M
     if (is_char_two) {
         if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point,
--
1.9.1


_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3863] [PATCH] ECC: Add missing NULL check. Set a flag.

Billy Brumley
https://github.com/openssl/openssl/pull/575

On Tue, May 26, 2015 at 9:06 PM, Billy Brumley via RT <[hidden email]> wrote:

> Set point->Z_is_one flag after setting point->Z to one. Also check
> BIGNUM for NULL before passing it to get_affine_coordinates.
>
> BBB
>
>
> _______________________________________________
> openssl-dev mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
>
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: [openssl.org #3863] [PATCH] ECC: Add missing NULL check. Set a flag.

Rich Salz via RT
https://github.com/openssl/openssl/pull/575

On Tue, May 26, 2015 at 9:06 PM, Billy Brumley via RT <[hidden email]> wrote:

> Set point->Z_is_one flag after setting point->Z to one. Also check
> BIGNUM for NULL before passing it to get_affine_coordinates.
>
> BBB
>
>
> _______________________________________________
> openssl-dev mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
>


_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev