summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-10-24 17:03:35 +0200
committerGrant Likely <grant.likely@secretlab.ca>2011-10-24 17:03:35 +0200
commit2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9 (patch)
treeef49d741211dcc4f38636b5c422c9c346da09adf /crypto
parentdt: Add empty of_match_node() macro (diff)
parentLinux 3.1 (diff)
downloadlinux-2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9.tar.xz
linux-2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9.zip
Merge commit 'v3.1' into devicetree/next
Diffstat (limited to '')
-rw-r--r--crypto/ghash-generic.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c
index be4425616931..7835b8fc94db 100644
--- a/crypto/ghash-generic.c
+++ b/crypto/ghash-generic.c
@@ -67,6 +67,9 @@ static int ghash_update(struct shash_desc *desc,
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *dst = dctx->buffer;
+ if (!ctx->gf128)
+ return -ENOKEY;
+
if (dctx->bytes) {
int n = min(srclen, dctx->bytes);
u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes);
@@ -119,6 +122,9 @@ static int ghash_final(struct shash_desc *desc, u8 *dst)
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *buf = dctx->buffer;
+ if (!ctx->gf128)
+ return -ENOKEY;
+
ghash_flush(ctx, dctx);
memcpy(dst, buf, GHASH_BLOCK_SIZE);