infra: adapt to removal of shash_desc::flags

This commit is contained in:
Thomas Schoebel-Theuer 2021-01-30 09:38:27 +01:00
parent 5237ca4b16
commit f3764ce4e5
2 changed files with 19 additions and 1 deletions

View File

@ -267,6 +267,13 @@ extern int _compat_unlink(
#define HAS_SHA1
#endif
/* adapt to 877b5691f27a1aec0d9b53095a323e45c30069e2
* detected via 113b7dfd827175977ea71cc4a29c1ac24acb9fce
*/
#ifdef LRU_ALL_FILE
#define MARS_HAS_SHASH_DESC_FLAGS
#endif
/* compression stuff */
#if (defined(CONFIG_LZO_COMPRESS) || defined(CONFIG_LZO_COMPRESS_MODULE)) && \

View File

@ -198,7 +198,9 @@ void md5_old_digest(void *digest, const void *data, int len)
int status;
sdesc->shash.tfm = md5_tfm;
#ifdef MARS_HAS_SHASH_DESC_FLAGS
sdesc->shash.flags = 0;
#endif
memset(digest, 0, MARS_DIGEST_SIZE);
status = crypto_shash_digest(&sdesc->shash, data, len, digest);
@ -225,8 +227,9 @@ void md5_digest(void *digest, const void *data, int len)
int status;
sdesc->shash.tfm = md5_tfm;
#ifdef MARS_HAS_SHASH_DESC_FLAGS
sdesc->shash.flags = 0;
#endif
memset(digest, 0, MARS_DIGEST_SIZE);
/* exploit the bigger MARS_DIGEST_SIZE by computing MD5 in chunks */
@ -270,7 +273,9 @@ void crc32c_digest(void *digest, const void *data, int len)
int status;
sdesc->shash.tfm = crc32c_tfm;
#ifdef MARS_HAS_SHASH_DESC_FLAGS
sdesc->shash.flags = 0;
#endif
memset(digest, 0, MARS_DIGEST_SIZE);
/* exploit the bigger MARS_DIGEST_SIZE by computing CRC32C in chunks */
@ -314,7 +319,9 @@ void crc32_digest(void *digest, const void *data, int len)
int status;
sdesc->shash.tfm = crc32_tfm;
#ifdef MARS_HAS_SHASH_DESC_FLAGS
sdesc->shash.flags = 0;
#endif
memset(digest, 0, MARS_DIGEST_SIZE);
/* exploit the bigger MARS_DIGEST_SIZE by computing CRC32 in chunks */
@ -354,7 +361,9 @@ void sha1_digest(void *digest, const void *data, int len)
int status;
sdesc->shash.tfm = sha1_tfm;
#ifdef MARS_HAS_SHASH_DESC_FLAGS
sdesc->shash.flags = 0;
#endif
status = crypto_shash_digest(&sdesc->shash, data, len, tmp);
if (unlikely(status < 0)) {
@ -592,7 +601,9 @@ __u32 mars_digest(__u32 digest_flags,
unsigned int i = round_robin++ % OBSOLETE_TFM_MAX;
struct hash_desc desc = {
.tfm = mars_tfm[i],
#ifdef MARS_HAS_SHASH_DESC_FLAGS
.flags = 0,
#endif
};
struct scatterlist sg;