diff mbox series

[12/17] libceph: stop checking crypto_shash_alignmask

Message ID 20231019055343.588846-13-ebiggers@kernel.org
State New
Headers show
Series [01/17] crypto: sparc/crc32c - stop using the shash alignmask | expand

Commit Message

Eric Biggers Oct. 19, 2023, 5:53 a.m. UTC
From: Eric Biggers <ebiggers@google.com>

Now that the shash algorithm type does not support nonzero alignmasks,
crypto_shash_alignmask() always returns 0 and will be removed.  In
preparation for this, stop checking crypto_shash_alignmask() in
net/ceph/messenger_v2.c.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 net/ceph/messenger_v2.c | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series

Patch

diff --git a/net/ceph/messenger_v2.c b/net/ceph/messenger_v2.c
index d09a39ff2cf04..f8ec60e1aba3a 100644
--- a/net/ceph/messenger_v2.c
+++ b/net/ceph/messenger_v2.c
@@ -726,22 +726,20 @@  static int setup_crypto(struct ceph_connection *con,
 	noio_flag = memalloc_noio_save();
 	con->v2.hmac_tfm = crypto_alloc_shash("hmac(sha256)", 0, 0);
 	memalloc_noio_restore(noio_flag);
 	if (IS_ERR(con->v2.hmac_tfm)) {
 		ret = PTR_ERR(con->v2.hmac_tfm);
 		con->v2.hmac_tfm = NULL;
 		pr_err("failed to allocate hmac tfm context: %d\n", ret);
 		return ret;
 	}
 
-	WARN_ON((unsigned long)session_key &
-		crypto_shash_alignmask(con->v2.hmac_tfm));
 	ret = crypto_shash_setkey(con->v2.hmac_tfm, session_key,
 				  session_key_len);
 	if (ret) {
 		pr_err("failed to set hmac key: %d\n", ret);
 		return ret;
 	}
 
 	if (con->v2.con_mode == CEPH_CON_MODE_CRC) {
 		WARN_ON(con_secret_len);
 		return 0;  /* auth_x, plain mode */
@@ -809,22 +807,20 @@  static int hmac_sha256(struct ceph_connection *con, const struct kvec *kvecs,
 		memset(hmac, 0, SHA256_DIGEST_SIZE);
 		return 0;  /* auth_none */
 	}
 
 	desc->tfm = con->v2.hmac_tfm;
 	ret = crypto_shash_init(desc);
 	if (ret)
 		goto out;
 
 	for (i = 0; i < kvec_cnt; i++) {
-		WARN_ON((unsigned long)kvecs[i].iov_base &
-			crypto_shash_alignmask(con->v2.hmac_tfm));
 		ret = crypto_shash_update(desc, kvecs[i].iov_base,
 					  kvecs[i].iov_len);
 		if (ret)
 			goto out;
 	}
 
 	ret = crypto_shash_final(desc, hmac);
 
 out:
 	shash_desc_zero(desc);