diff options
Diffstat (limited to 'include/crypto/skcipher.h')
-rw-r--r-- | include/crypto/skcipher.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h index 25fd612..c893e78 100644 --- a/include/crypto/skcipher.h +++ b/include/crypto/skcipher.h @@ -1,11 +1,11 @@ /* * Symmetric key ciphers. - * + * * Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) + * Software Foundation; either version 2 of the License, or (at your option) * any later version. * */ @@ -41,6 +41,10 @@ static inline int crypto_skcipher_givencrypt( { struct ablkcipher_tfm *crt = crypto_ablkcipher_crt(skcipher_givcrypt_reqtfm(req)); +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif return crt->givencrypt(req); }; @@ -49,6 +53,10 @@ static inline int crypto_skcipher_givdecrypt( { struct ablkcipher_tfm *crt = crypto_ablkcipher_crt(skcipher_givcrypt_reqtfm(req)); +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif return crt->givdecrypt(req); }; @@ -70,6 +78,11 @@ static inline struct skcipher_givcrypt_request *skcipher_givcrypt_alloc( { struct skcipher_givcrypt_request *req; +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return NULL; +#endif + req = kmalloc(sizeof(struct skcipher_givcrypt_request) + crypto_ablkcipher_reqsize(tfm), gfp); @@ -107,4 +120,3 @@ static inline void skcipher_givcrypt_set_giv( } #endif /* _CRYPTO_SKCIPHER_H */ - |