Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
* Re: linux-next: Tree for Jul 29 (drivers/crypto/sa2ul.c)
       [not found] <20200729222201.0d1ec18a@canb.auug.org.au>
@ 2020-07-29 16:05 ` Randy Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2020-07-29 16:05 UTC (permalink / raw)
  To: Stephen Rothwell, Linux Next Mailing List
  Cc: Linux Kernel Mailing List, Linux Crypto Mailing List,
	Tero Kristo, Keerthy

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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200729222201.0d1ec18a@canb.auug.org.au>
2020-07-29 16:05 ` linux-next: Tree for Jul 29 (drivers/crypto/sa2ul.c) Randy Dunlap

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git