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 | 5762c20593b6b959f1470dc6f1ff4ca4d9570f8d (diff) | |
parent | c3b92c8787367a8bb53d57d9789b558f1295cc96 (diff) | |
download | op-kernel-dev-2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9.zip op-kernel-dev-2bf6f675fa1a0f80b21aff20e6c21e87d6a7c9c9.tar.gz |
Merge commit 'v3.1' into devicetree/next
Diffstat (limited to 'crypto')
-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 be44256..7835b8f 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); |