SoftHSM returns invalid value for `CKA_ALLOWED_MECHANISMS` when there is no limitation
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- cpp
- Área
- cryptography, security
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C++
- Estrellas
- 1.1k
- Forks
- 434
- Merge medio
- 12 d 14 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de softhsm/SoftHSMv2
-
C_DigestKey digests a sensitive EC private key's CKA_VALUE: no check that the object is a secret keyAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
Todos los issues de softhsm/SoftHSMv2
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
pocoproject/poco#5664 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
charmplusplus/charm#4210 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
cp-algorithms/cp-algorithms#1748 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día