SoftHSM returns invalid value for `CKA_ALLOWED_MECHANISMS` when there is no limitation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- cpp
- Ambito
- cryptography, security
Direzione di ricerca
Start by reading the C_GetAttributeValue handling for CKA_ALLOWED_MECHANISMS and the PKCS#11 v3.2 description linked in the issue. Compare how SoftHSM represents an absent attribute with the zero-length result shown here, and consider the reported application workarounds for context. Done means the returned length follows the chosen PKCS#11 interpretation and the behavior is covered by a regression test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When listing attributes of object that was created without any allowed algorithms, it should not return empty list (uninitialized pointer + 0 length) as it does now:
76: C_GetAttributeValue
P:2127568; T:0x140248153966528 2025-11-19 17:57:57.573
[in] hSession = 0x1
[in] hObject = 0x2
[in] pTemplate[1]:
CKA_ALLOWED_MECHANISMS 0000000000000001 / 0
[out] pTemplate[1]:
CKA_ALLOWED_MECHANISMS 0000000000000001 / 0
Returned: 0 CKR_OK
We had to implement a workaround for this in pkcs11-provider before:
and we are hitting the same issue in rust-cryptoki now parallaxsecond/rust-cryptoki#323 so it would be great to get this fixed.
While this is under-specified in the PKCS#11 standard, returning zero-length is unexpected by most of the application. From my reading of the C_GetAttributeValue description, I think the best would be to set the length to the CK_UNAVAILABLE_INFORMATION to signalize the attribute is valid, but not present on the given object.
https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.2/pkcs11-spec-v3.2.html#_Toc195693161
- Lingua principale
- C++
- Stelle
- 1.1k
- Fork
- 434
- Merge medio
- 12g 14h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di softhsm/SoftHSMv2
-
C_DigestKey digests a sensitive EC private key's CKA_VALUE: no check that the object is a secret keyAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
Tutte le issue di softhsm/SoftHSMv2
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
charmplusplus/charm#4210 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] VPN auth dialog spawned by the secret agent fails with "TLS support is not available" on NixOSApertabug nixos umbriel
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
noctalia-dev/noctalia#5310 ·
I maintainer di solito rispondono entro 1 giorno
-
area/docdb kind/bug priority/medium status/awaiting-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
yugabyte/yugabyte-db#37426 ·
I maintainer di solito rispondono entro 1 giorno
-
[Engine] Two prompt block scorers enabled at once: WMMA silently wins and no log line is printedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Niko1221/Strata#5693 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni