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

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

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

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

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

2016-02-24 Thread Tadeusz Struk
This reverts back the rsa.c to do the math primitives only. It also reverts the akcipher api changes as the hash param will be passed to the rsa-pkcs1 template. All padding and encoding logic is moved to the rsa-pkcs1pad. The software_pkey.c uses pkcs1pad template to allocate the akcipher and the