From: Eric Biggers <ebiggers@kernel.org>
To: Vicki Pfau <vi@endrift.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org
Subject: Re: [PATCH v4 07/12] Input: xbox_gip - Add security implementation from xone
Date: Mon, 24 Aug 2026 21:49:33 +0000 [thread overview]
Message-ID: <20260824214933.GA399653@google.com> (raw)
In-Reply-To: <20260822021140.1149546-8-vi@endrift.com>
On Fri, Aug 21, 2026 at 07:11:31PM -0700, Vicki Pfau wrote:
> +int gip_security_start_handshake(struct gip_security *security)
> +{
> + struct shash_desc *shash_transcript, *shash_prf;
> +
> + if (!security->shash_transcript) {
> + shash_transcript = gip_security_alloc_shash("sha256");
> + if (IS_ERR(shash_transcript))
> + return PTR_ERR(shash_transcript);
> +
> + security->shash_transcript = shash_transcript;
> + }
> +
> + if (!security->shash_prf) {
> + shash_prf = gip_security_alloc_shash("hmac(sha256)");
> + if (IS_ERR(shash_prf)) {
> + crypto_free_shash(shash_transcript->tfm);
> + kfree(shash_transcript);
> + security->shash_transcript = NULL;
> + return PTR_ERR(shash_prf);
> + }
> +
> + security->shash_prf = shash_prf;
> + }
There's no need to use crypto_shash. Just call the SHA-256 and
HMAC-SHA256 functions (<crypto/sha2.h>) directly.
- Eric
next prev parent reply other threads:[~2026-08-24 21:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 2:11 [PATCH v4 00/12] Input: xbox_gip - Add new driver for Xbox GIP Vicki Pfau
2026-08-22 2:11 ` [PATCH v4 01/12] " Vicki Pfau
2026-08-22 2:38 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 02/12] Input: xpad - Remove Xbox One support Vicki Pfau
2026-08-22 2:41 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 03/12] Input: xbox_gip - Add controllable LED support Vicki Pfau
2026-08-22 2:37 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 04/12] Input: xbox_gip - Add HID relaying Vicki Pfau
2026-08-22 2:38 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 05/12] Input: xbox_gip - Add battery support Vicki Pfau
2026-08-22 2:38 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 06/12] Input: xbox_gip - Allow sending fragmented and ACME messages Vicki Pfau
2026-08-22 2:39 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 07/12] Input: xbox_gip - Add security implementation from xone Vicki Pfau
2026-08-22 2:35 ` sashiko-bot
2026-08-24 21:49 ` Eric Biggers [this message]
2026-08-28 1:40 ` Vicki Pfau
2026-08-28 1:50 ` Eric Biggers
2026-08-28 1:51 ` Vicki Pfau
2026-08-22 2:11 ` [PATCH v4 08/12] Input: xbox_gip - Add arcade stick support Vicki Pfau
2026-08-22 2:38 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 09/12] Input: xbox_gip - Add support for PDP guitar controllers Vicki Pfau
2026-08-22 2:30 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 10/12] Input: Add ABS_CLUTCH, HANDBRAKE, and SHIFTER Vicki Pfau
2026-08-22 2:38 ` sashiko-bot
2026-08-22 2:11 ` [PATCH v4 11/12] HID: Map more automobile simulation inputs Vicki Pfau
2026-08-22 2:11 ` [PATCH v4 12/12] Input: xbox_gip - Add wheel support Vicki Pfau
2026-08-22 2:54 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260824214933.GA399653@google.com \
--to=ebiggers@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=vi@endrift.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox