crypto: rsa-pkcs1pad - simplify error handling in pkcs1pad_create()
authorEric Biggers <ebiggers@google.com>
Wed, 26 Feb 2020 04:59:23 +0000 (20:59 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Mar 2020 01:28:24 +0000 (12:28 +1100)
commit0708bb435354aede92819d44563d3113c7180cf0
treebdb190201cdd972adf7d904a86d732f14ea15b42
parent07b24c7c08bdc2d36de10881a17145426f47742b
crypto: rsa-pkcs1pad - simplify error handling in pkcs1pad_create()

Simplify the error handling in pkcs1pad_create() by taking advantage of
crypto_grab_akcipher() now handling an ERR_PTR() name and by taking
advantage of crypto_drop_akcipher() now accepting (as a no-op) a spawn
that hasn't been grabbed yet.

While we're at it, also simplify the way the hash_name optional argument
is handled.  We only need to check whether it's present in one place,
and we can just assign directly to ctx->digest_info.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/rsa-pkcs1pad.c