Commit a004b062 authored by Bodo Möller's avatar Bodo Möller
Browse files

additional sanity checks for arguments to EC_POINTs_mul()

parent 98eab439
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -209,6 +209,17 @@ int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
	EC_POINT ***val_sub = NULL; /* pointers to sub-arrays of 'val' */
	int ret = 0;
	
	if (group->meth != r->meth)
		{
		ECerr(EC_F_EC_POINTS_MUL, EC_R_INCOMPATIBLE_OBJECTS);
		return 0;
		}

	if ((scalar == NULL) && (num == 0))
		{
		return EC_POINT_set_to_infinity(group, r);
		}

	if (scalar != NULL)
		{
		generator = EC_GROUP_get0_generator(group);