Closed Bug 2007224 Opened 7 months ago Closed 4 months ago

mlDsaPubTemplate is missing a CKA_ENCAPSULATE entry.

Categories

(NSS :: Libraries, defect, P3)

Tracking

(nss 3.123)

RESOLVED FIXED
Tracking Status
nss --- 3.123

People

(Reporter: jallison, Assigned: rrelyea)

References

Details

Attachments

(2 files)

Attached file look

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Steps to reproduce:

A colleague of mine at CIQ (Sultan Alsawaf) was browsing the code and noticed that git commit ref 38f93bdca:

https://github.com/nss-dev/nss/commit/38f93bdcae5d61fef7ab62c356566ff22a01ab61#diff-36d6c10e730a7b0940c74e77352ba627d23b4ccb8eb73871758925e088829bdaR1452-R1461

is missing a CKA_ENCAPSULATE entry in the mlDsaPubTemplate array.

Patch is attached to this bug report.

@Bob, can you have a look at this?

Severity: -- → N/A
Flags: needinfo?(rrelyea)
Priority: -- → P3
Assignee: nobody → rrelyea
Flags: needinfo?(rrelyea)
Severity: N/A → S3
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

testing a patch now, but there isn't an overflow issue here because ml-dsa doesn't set encapsulate, and currently we only turn on the encapsulate or decapsulate attributes if they are set to true (so that 'old', meaning pretty much any token older than 6 month) won't blow up because they don't understand these attributes. The patch I'm working on will assert if we overflow our buffer.

  1. add CKA_ENCAPSULATE to the mlDsaPubTemplate.
  2. cadd code to detect runtime template overflows.

This is basically a sanity check. CKA_ENACAPSULATE isn't added to an mlDsa key because currently we only add CKA_ENCAPSULATE when we set it to true because the attribute is new for PKCS #11 3.2, so most tokens won't understand it. mlDsa will have the attribute set to false because it's a signing key, we never actually added it to the template. Putting it in, and expecially, checking that we haven't overrun out key template will guard against when we decide to include CKA_ENCAPSULATE unconditionally.

Duplicate of this bug: 2027348

Pushed by rrelyea@redhat.com:
https://hg.mozilla.org/projects/nss/rev/b7d5810fc18b
mlDsaPubTemplate is missing a CKA_ENCAPSULATE entry.

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: