diff options
author | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
---|---|---|
committer | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
commit | c6da2cfeb05178a11c6d062a06f8078150ee492f (patch) | |
tree | f3b4021d252c52d6463a9b3c1bb7245e399b009c /include/crypto/aead.h | |
parent | c6d7c4dbff353eac7919342ae6b3299a378160a6 (diff) | |
download | kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.zip kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.gz kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.bz2 |
samsung update 1
Diffstat (limited to 'include/crypto/aead.h')
-rw-r--r-- | include/crypto/aead.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/crypto/aead.h b/include/crypto/aead.h index 0edf949..2281408 100644 --- a/include/crypto/aead.h +++ b/include/crypto/aead.h @@ -1,11 +1,11 @@ /* * AEAD: Authenticated Encryption with Associated Data - * + * * 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. * */ @@ -39,12 +39,24 @@ static inline struct crypto_aead *aead_givcrypt_reqtfm( static inline int crypto_aead_givencrypt(struct aead_givcrypt_request *req) { struct aead_tfm *crt = crypto_aead_crt(aead_givcrypt_reqtfm(req)); + +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + return crt->givencrypt(req); }; static inline int crypto_aead_givdecrypt(struct aead_givcrypt_request *req) { struct aead_tfm *crt = crypto_aead_crt(aead_givcrypt_reqtfm(req)); + +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + return crt->givdecrypt(req); }; @@ -59,6 +71,11 @@ static inline struct aead_givcrypt_request *aead_givcrypt_alloc( { struct aead_givcrypt_request *req; +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return NULL; +#endif + req = kmalloc(sizeof(struct aead_givcrypt_request) + crypto_aead_reqsize(tfm), gfp); |