RT3863 ECC: Add missing NULL check. Set a flag
authorBilly Brumley <bbrumley@gmail.com>
Thu, 21 Jan 2016 12:06:57 +0000 (14:06 +0200)
committerMatt Caswell <matt@openssl.org>
Thu, 21 Jan 2016 14:14:33 +0000 (14:14 +0000)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit dd67493c344d9d98413d2ee7fd2b6fa9411d975c)

crypto/ec/ec2_smpl.c
crypto/ec/ec_key.c

index 077c7fc8dda59597377ae63fb79442c5f90493cd..5b27b91fcc94f33df244dadf525424dc80d0d1da 100644 (file)
@@ -746,6 +746,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;
 
index c784b6fd30a3c8b5cbbb5dc133270dc288274aee..bc94ab5661ffedb8ab176451e80c4d08e0329a44 100644 (file)
@@ -387,6 +387,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
     tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group));