summaryrefslogtreecommitdiff
path: root/crypto/ccm.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-03 15:32:45 -0200
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-03 15:32:45 -0200
commit46932cc3784fab58cedfed099127f243e7af9102 (patch)
tree3a6fe72386b4567b1b6aa156613db607ee737263 /crypto/ccm.c
parent2d913b33066b19294e6ea3e5caed196751ecf17e (diff)
parentf6490f52c919d9a90918fd2f944e94e4c980b472 (diff)
downloadlinux-crypto-46932cc3784fab58cedfed099127f243e7af9102.tar.gz
linux-crypto-46932cc3784fab58cedfed099127f243e7af9102.zip
Merge tag 'v3.14-rc1' into patchwork
Linus 3.14-rc1 * tag 'v3.14-rc1': (11781 commits) Linus 3.14-rc1 hpfs: optimize quad buffer loading hpfs: remember free space parisc: add flexible mmap memory layout support parisc: Make EWOULDBLOCK be equal to EAGAIN on parisc parisc: convert uapi/asm/stat.h to use native types only parisc: wire up sched_setattr and sched_getattr parisc: fix cache-flushing parisc/sti_console: prefer Linux fonts over built-in ROM fonts hwmon: Fix SENSORS_TMP102 dependencies to eliminate build errors hwmon: Fix SENSORS_LM75 dependencies to eliminate build errors tools/power turbostat: introduce -s to dump counters tools/power turbostat: remove unused command line option afs: proc cells and rootcell are writeable tile: remove compat_sys_lookup_dcookie declaration to fix compile error Revert "PCI: Remove from bus_list and release resources in pci_release_dev()" ARM: multi_v7_defconfig: remove redundant entries and re-enable TI_EDMA ARM: multi_v7_defconfig: add mvebu drivers clocksource: kona: Add basic use of external clock drivers: bus: fix CCI driver kcalloc call parameters swap ...
Diffstat (limited to 'crypto/ccm.c')
-rw-r--r--crypto/ccm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/ccm.c b/crypto/ccm.c
index 499c9171..1df84217 100644
--- a/crypto/ccm.c
+++ b/crypto/ccm.c
@@ -271,7 +271,8 @@ static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain,
}
/* compute plaintext into mac */
- get_data_to_compute(cipher, pctx, plain, cryptlen);
+ if (cryptlen)
+ get_data_to_compute(cipher, pctx, plain, cryptlen);
out:
return err;
@@ -363,7 +364,7 @@ static void crypto_ccm_decrypt_done(struct crypto_async_request *areq,
if (!err) {
err = crypto_ccm_auth(req, req->dst, cryptlen);
- if (!err && memcmp(pctx->auth_tag, pctx->odata, authsize))
+ if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize))
err = -EBADMSG;
}
aead_request_complete(req, err);
@@ -422,7 +423,7 @@ static int crypto_ccm_decrypt(struct aead_request *req)
return err;
/* verify */
- if (memcmp(authtag, odata, authsize))
+ if (crypto_memneq(authtag, odata, authsize))
return -EBADMSG;
return err;