diff options
-rw-r--r-- | crypto/rsa-pkcs1pad.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c index 8baab4307f7b..044bcfa69cba 100644 --- a/crypto/rsa-pkcs1pad.c +++ b/crypto/rsa-pkcs1pad.c | |||
@@ -120,9 +120,6 @@ static int pkcs1pad_set_pub_key(struct crypto_akcipher *tfm, const void *key, | |||
120 | 120 | ||
121 | /* Find out new modulus size from rsa implementation */ | 121 | /* Find out new modulus size from rsa implementation */ |
122 | err = crypto_akcipher_maxsize(ctx->child); | 122 | err = crypto_akcipher_maxsize(ctx->child); |
123 | if (err < 0) | ||
124 | return err; | ||
125 | |||
126 | if (err > PAGE_SIZE) | 123 | if (err > PAGE_SIZE) |
127 | return -ENOTSUPP; | 124 | return -ENOTSUPP; |
128 | 125 | ||
@@ -144,9 +141,6 @@ static int pkcs1pad_set_priv_key(struct crypto_akcipher *tfm, const void *key, | |||
144 | 141 | ||
145 | /* Find out new modulus size from rsa implementation */ | 142 | /* Find out new modulus size from rsa implementation */ |
146 | err = crypto_akcipher_maxsize(ctx->child); | 143 | err = crypto_akcipher_maxsize(ctx->child); |
147 | if (err < 0) | ||
148 | return err; | ||
149 | |||
150 | if (err > PAGE_SIZE) | 144 | if (err > PAGE_SIZE) |
151 | return -ENOTSUPP; | 145 | return -ENOTSUPP; |
152 | 146 | ||
@@ -154,7 +148,7 @@ static int pkcs1pad_set_priv_key(struct crypto_akcipher *tfm, const void *key, | |||
154 | return 0; | 148 | return 0; |
155 | } | 149 | } |
156 | 150 | ||
157 | static int pkcs1pad_get_max_size(struct crypto_akcipher *tfm) | 151 | static unsigned int pkcs1pad_get_max_size(struct crypto_akcipher *tfm) |
158 | { | 152 | { |
159 | struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); | 153 | struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); |
160 | 154 | ||
@@ -164,7 +158,7 @@ static int pkcs1pad_get_max_size(struct crypto_akcipher *tfm) | |||
164 | * decrypt/verify. | 158 | * decrypt/verify. |
165 | */ | 159 | */ |
166 | 160 | ||
167 | return ctx->key_size ?: -EINVAL; | 161 | return ctx->key_size; |
168 | } | 162 | } |
169 | 163 | ||
170 | static void pkcs1pad_sg_set_buf(struct scatterlist *sg, void *buf, size_t len, | 164 | static void pkcs1pad_sg_set_buf(struct scatterlist *sg, void *buf, size_t len, |