Skip to content

Remove secret-size restrictions for hashes

Mark O'Donovan linux-nvme lkml 5 versions – Applied

Status from this message: Queued up for nvme-6.7, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 1 replyApplied
  2. v43 patches 0 repliesSuperseded
  3. v33 patches 4 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches1 replySuperseded
v12 patches3 repliesSuperseded

Changes in v5 from the cover letter

- Removed newly redundant check found by kernel test robot

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/3nvme-auth: alloc nvme_dhchap_key as single bufferdrivers/nvme/common/auth.c include/linux/nvme-auth.h+28 -130 replies
2/3nvme-auth: use transformed key size to create respdrivers/nvme/common/auth.c drivers/nvme/host/auth.c drivers/nvme/target/auth.c +1 more+48 -390 replies
3/3nvme-auth: allow mixing of secret and hash lengthsdrivers/nvme/common/auth.c+0 -80 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchHannes Reinecke
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/3] Remove secret-size restrictions for hashes

This relates to the hash functions used to transform the secret. The kernel currently restricts us to using secrets equal in size to the transformation hash function they use.
e.g. 32 byte secrets with the SHA-256(32 byte) hash function.

This restriction is not required by the spec and means incompatibility with more permissive implementations.

With these patches the example secret from the spec should now be permitted with any of the following:
DHHC-1:00:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n:
DHHC-1:01:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n:
DHHC-1:02:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n:
DHHC-1:03:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n:

Note: Secrets are still restricted to 32,48 or 64 bits.

v1:
- Initial submission

v2:
- Added transformed_len as member of struct nvme_dhchap_key

v3:
- Return a struct nvme_dhchap_key from nvme_auth_transform_key()

v4:
- added helper to caclulate key struct size using struct_size()
- Break up lines which were too long
- Replace ternary operator with if
- Add missing ERR_CAST()

v5:
- Removed newly redundant check found by kernel test robot

Mark O'Donovan (3):
nvme-auth: alloc nvme_dhchap_key as single buffer
nvme-auth: use transformed key size to create resp
nvme-auth: allow mixing of secret and hash lengths

 drivers/nvme/common/auth.c | 68 ++++++++++++++++++++++----------------
 drivers/nvme/host/auth.c   | 30 ++++++++---------
 drivers/nvme/target/auth.c | 31 +++++++++--------
 include/linux/nvme-auth.h  |  7 ++--
 4 files changed, 76 insertions(+), 60 deletions(-)
Signature · 1 line
2.39.2