Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1344193

Re: [PATCH 4/8] akcipher: Move the RSA DER encoding to the crypto layer

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/8] akcipher: Move the RSA DER encoding to the crypto layer
Date 2016-02-26 12:50 +0100
Message-ID <r6p4f-2AD-21@gated-at.bofh.it> (permalink)
References (3 earlier) <r54XU-2FL-11@gated-at.bofh.it> <r579o-4ce-13@gated-at.bofh.it> <r58I9-5AT-1@gated-at.bofh.it> <r5iRc-45N-15@gated-at.bofh.it> <r5jke-4zB-7@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


Andrew Zaborowski <balrogg@googlemail.com> wrote:

> Without overhauling akcipher you could modify pkcs1pad so that sign
> takes the hash as input, adds the DER struct in front of it to build
> the signature, and the verify operation could at most check that the
> DER string matches the hash type and return the hash.  But I think
> RFC2437 suggests that you rather compare the signatures, not the
> hashes.

Whilst that is true about what RFC2437 shows, I wonder how strict it wants to
be about that rather than it just being a convenient way of describing the
algorithm.

The advantage of doing it the way the RFC suggests is that you get to use the
EMSA-PKCS1-V1_5-ENCODE operation twice, thereby saving code and only having
one place for bugs to occur instead of two - but you can argue this either
way.

That said, I would be okay with it returning just the message hash with the
padding stripped off, providing the padding is validated in the crypto layer,
if that's necessary.

David

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH 4/8] akcipher: Move the RSA DER encoding to the crypto layer Andrew Zaborowski <balrogg@googlemail.com> - 2016-02-23 01:10 +0100
  Re: [PATCH 4/8] akcipher: Move the RSA DER encoding to the crypto layer David Howells <dhowells@redhat.com> - 2016-02-23 12:00 +0100
    Re: [PATCH 4/8] akcipher: Move the RSA DER encoding to the crypto layer Andrew Zaborowski <balrogg@googlemail.com> - 2016-02-23 12:30 +0100
      Re: [PATCH 4/8] akcipher: Move the RSA DER encoding to the crypto layer David Howells <dhowells@redhat.com> - 2016-02-26 12:50 +0100

csiph-web