Re: [PATCH 2/2] crypto: remove padding logic from rsa.c

2016-02-27 Thread Tadeusz Struk
Hi Herbert, On 02/27/2016 10:40 AM, Herbert Xu wrote: > Tadeusz Struk wrote: >> >> diff --git a/crypto/rsa.c b/crypto/rsa.c >> index 9a7c9ca..77d737f 100644 >> --- a/crypto/rsa.c >> +++ b/crypto/rsa.c >> @@ -16,78 +16,6 @@ >> #include >> >> /* >> - * Hash algorithm OIDs plus ASN.1 DER wrappings [

Re: [PATCH 2/2] crypto: remove padding logic from rsa.c

2016-02-27 Thread Herbert Xu
Tadeusz Struk wrote: > > diff --git a/crypto/rsa.c b/crypto/rsa.c > index 9a7c9ca..77d737f 100644 > --- a/crypto/rsa.c > +++ b/crypto/rsa.c > @@ -16,78 +16,6 @@ > #include > > /* > - * Hash algorithm OIDs plus ASN.1 DER wrappings [RFC4880 sec 5.2.2]. > - */ > -static const u8 rsa_digest_info_md5

Re: [PATCH 2/2] crypto: remove padding logic from rsa.c

2016-02-26 Thread David Howells
Tadeusz Struk wrote: > + if (memcmp(sig->digest, output, sig->digest_size) || > + req->dst_len != sig->digest_size) You must always do the size check first! David -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to m

Re: [PATCH 2/2] crypto: remove padding logic from rsa.c

2016-02-26 Thread David Howells
Tadeusz Struk wrote: > + if (memcmp(sig->digest, output, sig->digest_size) || I've added " != 0" after the memcmp(). > + req->dst_len != sig->digest_size) > + ret = -EBADMSG; Btw, this has to be -EKEYREJECTED; -EBADMSG would indicate that the con