diff options
author | Daniel Kestrel <kestrel1974@t-online.de> | 2021-06-20 21:33:22 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2022-01-06 00:23:05 +0100 |
commit | 006fee0dadd184aab8a1a18d629674f8f06e9eda (patch) | |
tree | f23b6a9169e9f8b48c9a8f7c59c158e4ca286b61 /package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c | |
parent | 6ade9d1ddac660e7f06116359c0812adde86bf9e (diff) | |
download | upstream-006fee0dadd184aab8a1a18d629674f8f06e9eda.tar.gz upstream-006fee0dadd184aab8a1a18d629674f8f06e9eda.tar.bz2 upstream-006fee0dadd184aab8a1a18d629674f8f06e9eda.zip |
ltq-deu: update initialisations for hmac algorithms
The processing in the hmac algorithms depends on the status fields:
count, dbn and started. Not all were initialised in the init method
and after finishing the final method. Added missing fields to init
method and call init method after finishing final.
The memsets have the wrong size in the original driver and did not
clear everything and are not necessary. Since no memset is done in
the kernels generic implementation, memsets were removed.
Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
Diffstat (limited to 'package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c')
-rw-r--r-- | package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c index fc3a5ea668..109d27cbfb 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c @@ -185,6 +185,7 @@ static int md5_hmac_init(struct shash_desc *desc) mctx->dbn = 0; //dbn workaround mctx->started = 0; + mctx->byte_count = 0; return 0; } @@ -338,10 +339,7 @@ static int md5_hmac_final_impl(struct shash_desc *desc, u8 *out, bool hash_final if (hash_final) { /* reset the context after we finish with the hash */ - mctx->byte_count = 0; - memset(&mctx->hash[0], 0, sizeof(MD5_HASH_WORDS)); - memset(&mctx->block[0], 0, sizeof(MD5_BLOCK_WORDS)); - memset(&mctx->temp[0], 0, MD5_HMAC_DBN_TEMP_SIZE); + md5_hmac_init(desc); } else { mctx->dbn = 0; } |