p11-glue / p11-kit

Provides a way to load and enumerate PKCS#11 modules.
https://p11-glue.github.io/p11-glue/p11-kit.html
Other
149 stars 91 forks source link

rpc: Fix serialization of NULL mechanism pointer #601

Closed ueno closed 9 months ago

ueno commented 9 months ago

A NULL mechanism pointer is valid for C_*Init functions to cancel the operation. Since 852ccd8d we encoded it with a CK_MECHANISM_TYPE 0 as an indicator, though it clashes with CKM_RSA_PKCS_KEY_PAIR_GEN (0). This patch changes the encoding to use a special value (0xffffffff) to indicate that and also properly advance the offset when reading.

coveralls commented 9 months ago

Coverage Status

coverage: 69.471% (+0.04%) from 69.431% when pulling 684770413f771ded39b1c85717edabc1fccf89a7 on ueno:wip/dueno/mech-fixes into 66d6b42ef8dd84fcd8e199ac9f23f822f1a058c9 on p11-glue:master.