Skip to content

Commit

Permalink
crypto: shash - Fix digest size offset
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Jul 15, 2009
1 parent a70c522 commit fa64966
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/crypto/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ struct shash_alg {
unsigned int descsize;

/* These fields must match hash_alg_common. */
unsigned int digestsize;
unsigned int digestsize
__attribute__ ((aligned(__alignof__(struct hash_alg_common))));
unsigned int statesize;

struct crypto_alg base;
Expand Down

0 comments on commit fa64966

Please sign in to comment.