Commit fa64966473830219fe74952029ddb0e981a87749

Authored by Herbert Xu
1 parent a70c522520

crypto: shash - Fix digest size offset

When an shash algorithm is exported as ahash, ahash will access
its digest size through hash_alg_common.  That's why the shash
layout needs to match hash_alg_common.  This wasn't the case
because the alignment weren't identical.

This patch fixes the problem.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

include/crypto/hash.h
... ... @@ -75,7 +75,8 @@
75 75 unsigned int descsize;
76 76  
77 77 /* These fields must match hash_alg_common. */
78   - unsigned int digestsize;
  78 + unsigned int digestsize
  79 + __attribute__ ((aligned(__alignof__(struct hash_alg_common))));
79 80 unsigned int statesize;
80 81  
81 82 struct crypto_alg base;