lkml.org 
[lkml]   [2020]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-next: Tree for Jul 29 (drivers/crypto/sa2ul.c)
From
Date
On 7/29/20 5:22 AM, Stephen Rothwell wrote:
> Hi all,
>
> Changes since 20200728:
>

on i386:

ld: drivers/crypto/sa2ul.o: in function `sa_sha_digest':
sa2ul.c:(.text+0x1faf): undefined reference to `sha512_zero_message_hash'


sa2ul.c uses sha512_zero_message_hash, sha1_zero_message_hash,
and sha256_zero_message_hash, but it does not 'select' any of the
Kconfig symbols that cause those hashes to be present.

Should it select the needed Kconfig symbols or should it use
#ifdef blocks as needed?

like so:


static int zero_message_process(struct ahash_request *req)
{
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
int sa_digest_size = crypto_ahash_digestsize(tfm);

switch (sa_digest_size) {
#ifdef CONFIG_CRYPTO_SHA1
case SHA1_DIGEST_SIZE:
memcpy(req->result, sha1_zero_message_hash, sa_digest_size);
break;
#endif
#ifdef CONFIG_CRYPTO_SHA256
case SHA256_DIGEST_SIZE:
memcpy(req->result, sha256_zero_message_hash, sa_digest_size);
break;
#endif
#ifdef CONFIG_CRYPTO_SHA512
case SHA512_DIGEST_SIZE:
memcpy(req->result, sha512_zero_message_hash, sa_digest_size);
break;
#endif
default:
return -EINVAL;
}

return 0;
}



--
~Randy
Reported-by: Randy Dunlap <rdunlap@infradead.org>

\
 
 \ /
  Last update: 2020-07-29 18:06    [W:0.031 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site