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 /crypto/ahash.c | |
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 'crypto/ahash.c')
-rw-r--r-- | crypto/ahash.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c index f669822..5f6a8e4 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -78,6 +78,11 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) unsigned int alignmask = walk->alignmask; unsigned int nbytes = walk->entrylen; +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + walk->data -= walk->offset; if (nbytes && walk->offset & alignmask && !err) { @@ -115,6 +120,11 @@ EXPORT_SYMBOL_GPL(crypto_hash_walk_done); int crypto_hash_walk_first(struct ahash_request *req, struct crypto_hash_walk *walk) { +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + walk->total = req->nbytes; if (!walk->total) @@ -132,6 +142,11 @@ int crypto_hash_walk_first_compat(struct hash_desc *hdesc, struct crypto_hash_walk *walk, struct scatterlist *sg, unsigned int len) { +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + walk->total = len; if (!walk->total) @@ -250,6 +265,11 @@ static int crypto_ahash_op(struct ahash_request *req, struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); unsigned long alignmask = crypto_ahash_alignmask(tfm); +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + if ((unsigned long)req->result & alignmask) return ahash_op_unaligned(req, op); @@ -366,6 +386,11 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) struct crypto_ahash *hash = __crypto_ahash_cast(tfm); struct ahash_alg *alg = crypto_ahash_alg(hash); +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + hash->setkey = ahash_nosetkey; hash->export = ahash_no_export; hash->import = ahash_no_import; @@ -468,6 +493,11 @@ int ahash_register_instance(struct crypto_template *tmpl, { int err; +#ifdef CONFIG_CRYPTO_FIPS + if (unlikely(in_fips_err())) + return -EACCES; +#endif + err = ahash_prepare_alg(&inst->alg); if (err) return err; |