diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-10-24 17:03:35 +0200 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-10-24 17:03:35 +0200 |
commit | 2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9 (patch) | |
tree | ef49d741211dcc4f38636b5c422c9c346da09adf /crypto | |
parent | dt: Add empty of_match_node() macro (diff) | |
parent | Linux 3.1 (diff) | |
download | linux-2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9.tar.xz linux-2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9.zip |
Merge commit 'v3.1' into devicetree/next
Diffstat (limited to '')
-rw-r--r-- | crypto/ghash-generic.c | 6 |
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); |