aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ablkcipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ablkcipher.c')
-rw-r--r--crypto/ablkcipher.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index fdc67d3..f43b70a 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -50,6 +50,11 @@ void __ablkcipher_walk_complete(struct ablkcipher_walk *walk)
{
struct ablkcipher_buffer *p, *tmp;
+#ifdef CONFIG_CRYPTO_FIPS
+ if (unlikely(in_fips_err()))
+ return;
+#endif
+
list_for_each_entry_safe(p, tmp, &walk->buffers, entry) {
ablkcipher_buffer_write(p);
list_del(&p->entry);
@@ -112,6 +117,11 @@ int ablkcipher_walk_done(struct ablkcipher_request *req,
struct crypto_tfm *tfm = req->base.tfm;
unsigned int nbytes = 0;
+#ifdef CONFIG_CRYPTO_FIPS
+ if (unlikely(in_fips_err()))
+ return -EACCES;
+#endif
+
if (likely(err >= 0)) {
unsigned int n = walk->nbytes - err;
@@ -597,6 +607,11 @@ int crypto_grab_skcipher(struct crypto_skcipher_spawn *spawn, const char *name,
struct crypto_alg *alg;
int err;
+#ifdef CONFIG_CRYPTO_FIPS
+ if (unlikely(in_fips_err()))
+ return -EACCES;
+#endif
+
type = crypto_skcipher_type(type);
mask = crypto_skcipher_mask(mask);