Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c923414 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

  API:
   - algif_hash needs to wait for init operations to complete.
   - The has_key setting for shash was always true.

  Algorithms:
   - Add missing selections of CRYPTO_HASH.
   - Fix pkcs7 authentication.

  Drivers:
   - Fix stack alignment bug in chacha20-ssse3.
   - Fix performance regression in caam due to incorrect setting.
   - Fix potential compile-only build failure of stm32"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: atmel-aes - remove calls of clk_prepare() from atomic contexts
  crypto: algif_hash - wait for crypto_ahash_init() to complete
  crypto: shash - Fix has_key setting
  hwrng: stm32 - Fix dependencies for !HAS_IOMEM archs
  crypto: ghash,poly1305 - select CRYPTO_HASH where needed
  crypto: chacha20-ssse3 - Align stack pointer to 64 bytes
  PKCS#7: Don't require SpcSpOpusInfo in Authenticode pkcs7 signatures
  crypto: caam - make write transactions bufferable on PPC platforms
parents 29a8ea4f 49a20454
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -157,7 +157,9 @@ ENTRY(chacha20_4block_xor_ssse3)
	# done with the slightly better performing SSSE3 byte shuffling,
	# 7/12-bit word rotation uses traditional shift+OR.

	sub		$0x40,%rsp
	mov		%rsp,%r11
	sub		$0x80,%rsp
	and		$~63,%rsp

	# x0..15[0-3] = s0..3[0..3]
	movq		0x00(%rdi),%xmm1
@@ -620,6 +622,6 @@ ENTRY(chacha20_4block_xor_ssse3)
	pxor		%xmm1,%xmm15
	movdqu		%xmm15,0xf0(%rsi)

	add		$0x40,%rsp
	mov		%r11,%rsp
	ret
ENDPROC(chacha20_4block_xor_ssse3)
+2 −0
Original line number Diff line number Diff line
@@ -472,11 +472,13 @@ config CRYPTO_CRCT10DIF_PCLMUL
config CRYPTO_GHASH
	tristate "GHASH digest algorithm"
	select CRYPTO_GF128MUL
	select CRYPTO_HASH
	help
	  GHASH is message digest algorithm for GCM (Galois/Counter Mode).

config CRYPTO_POLY1305
	tristate "Poly1305 authenticator algorithm"
	select CRYPTO_HASH
	help
	  Poly1305 authenticator algorithm, RFC7539.

+3 −1
Original line number Diff line number Diff line
@@ -54,7 +54,8 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg,

	lock_sock(sk);
	if (!ctx->more) {
		err = crypto_ahash_init(&ctx->req);
		err = af_alg_wait_for_completion(crypto_ahash_init(&ctx->req),
						&ctx->completion);
		if (err)
			goto unlock;
	}
@@ -125,6 +126,7 @@ static ssize_t hash_sendpage(struct socket *sock, struct page *page,
	} else {
		if (!ctx->more) {
			err = crypto_ahash_init(&ctx->req);
			err = af_alg_wait_for_completion(err, &ctx->completion);
			if (err)
				goto unlock;
		}
+1 −3
Original line number Diff line number Diff line
@@ -547,9 +547,7 @@ int pkcs7_sig_note_set_of_authattrs(void *context, size_t hdrlen,
	struct pkcs7_signed_info *sinfo = ctx->sinfo;

	if (!test_bit(sinfo_has_content_type, &sinfo->aa_set) ||
	    !test_bit(sinfo_has_message_digest, &sinfo->aa_set) ||
	    (ctx->msg->data_type == OID_msIndirectData &&
	     !test_bit(sinfo_has_ms_opus_info, &sinfo->aa_set))) {
	    !test_bit(sinfo_has_message_digest, &sinfo->aa_set)) {
		pr_warn("Missing required AuthAttr\n");
		return -EBADMSG;
	}
+3 −4
Original line number Diff line number Diff line
@@ -354,11 +354,10 @@ int crypto_init_shash_ops_async(struct crypto_tfm *tfm)
	crt->final = shash_async_final;
	crt->finup = shash_async_finup;
	crt->digest = shash_async_digest;

	if (alg->setkey) {
	crt->setkey = shash_async_setkey;
		crt->has_setkey = true;
	}

	crt->has_setkey = alg->setkey != shash_no_setkey;

	if (alg->export)
		crt->export = shash_async_export;
	if (alg->import)
Loading