]> Pileus Git - ~andy/linux/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Mar 2012 17:31:49 +0000 (09:31 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Mar 2012 17:31:49 +0000 (09:31 -0800)
Pull from Herbert Xu:
  "This push fixes a bug in mv_cesa that causes all hash operations
   that supply data on a final operation to fail."

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: mv_cesa - fix final callback not ignoring input data

1  2 
drivers/crypto/mv_cesa.c

diff --combined drivers/crypto/mv_cesa.c
index 597235a2f8f908bbc69fffc596ffc20d71a16c5b,a617c5cb379722d5d2b88bf4d2142e86688f4f1d..0d40cf66b3cc55111182515fd4d695101d200fa0
@@@ -343,13 -343,11 +343,13 @@@ static void mv_process_hash_current(in
                else
                        op.config |= CFG_MID_FRAG;
  
 -              writel(req_ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A);
 -              writel(req_ctx->state[1], cpg->reg + DIGEST_INITIAL_VAL_B);
 -              writel(req_ctx->state[2], cpg->reg + DIGEST_INITIAL_VAL_C);
 -              writel(req_ctx->state[3], cpg->reg + DIGEST_INITIAL_VAL_D);
 -              writel(req_ctx->state[4], cpg->reg + DIGEST_INITIAL_VAL_E);
 +              if (first_block) {
 +                      writel(req_ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A);
 +                      writel(req_ctx->state[1], cpg->reg + DIGEST_INITIAL_VAL_B);
 +                      writel(req_ctx->state[2], cpg->reg + DIGEST_INITIAL_VAL_C);
 +                      writel(req_ctx->state[3], cpg->reg + DIGEST_INITIAL_VAL_D);
 +                      writel(req_ctx->state[4], cpg->reg + DIGEST_INITIAL_VAL_E);
 +              }
        }
  
        memcpy(cpg->sram + SRAM_CONFIG, &op, sizeof(struct sec_accel_config));
@@@ -714,6 -712,7 +714,7 @@@ static int mv_hash_final(struct ahash_r
  {
        struct mv_req_hash_ctx *ctx = ahash_request_ctx(req);
  
+       ahash_request_set_crypt(req, NULL, req->result, 0);
        mv_update_hash_req_ctx(ctx, 1, 0);
        return mv_handle_req(&req->base);
  }