lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACE9dm9_8-AK_0tJQ-BzGdBJ6wqTfizYM2pB0ATHhRJP+C2-HQ@mail.gmail.com>
Date:	Sat, 10 Jan 2015 12:27:16 +0200
From:	Dmitry Kasatkin <dmitry.kasatkin@...il.com>
To:	David Howells <dhowells@...hat.com>
Cc:	Rasmus Villemoes <linux@...musvillemoes.dk>,
	keyrings <keyrings@...ux-nfs.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [Keyrings] [PATCH 1/2] MPILIB: Fix comparison of negative MPIs

Hi,

Thank you. It looks correct.

Ack.

- Dmitry

On 9 January 2015 at 12:58, David Howells <dhowells@...hat.com> wrote:
> I think you're right - *adding* the two sizes makes no sense.  cc'ing Dmitry
> also for his check.
>
> David
>
>
> Rasmus Villemoes <linux@...musvillemoes.dk> wrote:
>
>> If u and v both represent negative integers and their limb counts
>> happen to differ, mpi_cmp will always return a positive value - this
>> is obviously bogus. u is smaller than v if and only if it is larger in
>> absolute value.
>>
>> Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
>> ---
>>  lib/mpi/mpi-cmp.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c
>> index 1871e7b61ca0..3801694240d8 100644
>> --- a/lib/mpi/mpi-cmp.c
>> +++ b/lib/mpi/mpi-cmp.c
>> @@ -57,7 +57,7 @@ int mpi_cmp(MPI u, MPI v)
>>       if (usize != vsize && !u->sign && !v->sign)
>>               return usize - vsize;
>>       if (usize != vsize && u->sign && v->sign)
>> -             return vsize + usize;
>> +             return vsize - usize;
>>       if (!usize)
>>               return 0;
>>       cmp = mpihelp_cmp(u->d, v->d, usize);
>> --
>> 2.1.3
>>
> _______________________________________________
> Keyrings mailing list
> Keyrings@...ux-nfs.org
> To change your subscription to this list, please see http://linux-nfs.org/cgi-bin/mailman/listinfo/keyrings



-- 
Thanks,
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ