[PATCH v3 06/11] crypto: rsa - change err code in rsa_max_size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If key was not successfully set, return -ENOKEY instead of
-EINVAL.

Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
---
 crypto/rsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/rsa.c b/crypto/rsa.c
index 4c280b6..3cf640e 100644
--- a/crypto/rsa.c
+++ b/crypto/rsa.c
@@ -341,7 +341,7 @@ static int rsa_max_size(struct crypto_akcipher *tfm)
 {
 	struct rsa_mpi_key *pkey = akcipher_tfm_ctx(tfm);
 
-	return pkey->n ? mpi_get_size(pkey->n) : -EINVAL;
+	return pkey->n ? mpi_get_size(pkey->n) : -ENOKEY;
 }
 
 static void rsa_exit_tfm(struct crypto_akcipher *tfm)
-- 
2.7.4




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux