Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Herbert Xu
On Fri, Jun 24, 2016 at 08:25:02AM -0700, Tadeusz Struk wrote: > Yes, but now mpi_get_buffer() calls mpi_read_buffer() and it is also > used by security/keys/dh.c It appears to be using mpi_read_buffer gratuitously. It should simply use mpi_get_buffer. Thanks, -- Email: Herbert Xu Home Page: h

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Tadeusz Struk
On 06/24/2016 07:28 AM, Herbert Xu wrote: > Didn't we add mpi_read_buffer specifically for akcipher before > we switched over to SGs? If nobody is using it we should just > delete it. Yes, but now mpi_get_buffer() calls mpi_read_buffer() and it is also used by security/keys/dh.c Thanks, -- TS -- T

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Herbert Xu
On Thu, Jun 23, 2016 at 08:25:05AM -0700, Tadeusz Struk wrote: > > The reason why mpi_write_to_sgl() strips the leading zeros is only > because we said that it needs to work in the same way as the > mpi_read_buffer(), which does remove it for whatever reason. > So should we now change the mpi_read

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Herbert Xu
On Fri, Jun 24, 2016 at 11:23:06AM +0200, Stephan Mueller wrote: > > Patch 2 introduces the bug. > > Note, with patch 2, there is also a compile warning with crypto/dh.c. Oh I see. It's a conflict with the kpp stuff that didn't exist when I wrote this. Let me respin the patches on top of kpp.

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Stephan Mueller
Am Freitag, 24. Juni 2016, 16:41:47 schrieb Herbert Xu: Hi Herbert, > On Fri, Jun 24, 2016 at 09:27:12AM +0200, Stephan Mueller wrote: > > Am Mittwoch, 22. Juni 2016, 18:14:32 schrieb Herbert Xu: > > > > Hi Herbert, > > > > Something breaks with this patch set in public_key_verify_signature > >

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Stephan Mueller
Am Freitag, 24. Juni 2016, 16:41:47 schrieb Herbert Xu: Hi Herbert, > On Fri, Jun 24, 2016 at 09:27:12AM +0200, Stephan Mueller wrote: > > Am Mittwoch, 22. Juni 2016, 18:14:32 schrieb Herbert Xu: > > > > Hi Herbert, > > > > Something breaks with this patch set in public_key_verify_signature > >

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Herbert Xu
On Fri, Jun 24, 2016 at 09:27:12AM +0200, Stephan Mueller wrote: > Am Mittwoch, 22. Juni 2016, 18:14:32 schrieb Herbert Xu: > > Hi Herbert, > > Something breaks with this patch set in public_key_verify_signature > > I get tons of these: > > [1.838720] PKCS#7 signature not signed with a trus

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-24 Thread Stephan Mueller
Am Mittwoch, 22. Juni 2016, 18:14:32 schrieb Herbert Xu: Hi Herbert, Something breaks with this patch set in public_key_verify_signature I get tons of these: [1.838720] PKCS#7 signature not signed with a trusted key Furthermore, my CAVS testing with public_key_verify_signature always EINV

Re: crypto: rsa - Do not gratuitously drop leading zeroes

2016-06-23 Thread Tadeusz Struk
Hi Herbert, On 06/22/2016 03:14 AM, Herbert Xu wrote: > This was prompted by the caam RSA submission where a lot of work > was done just to strip the RSA output of leading zeroes. This is > in fact completely pointless because the only user of RSA in the > kernel then promptly puts them back. > >