pkcs11-check 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (457) hide show
  1. pkcs11_check-0.1.0/.dockerignore +33 -0
  2. pkcs11_check-0.1.0/.gitignore +20 -0
  3. pkcs11_check-0.1.0/.python-version +1 -0
  4. pkcs11_check-0.1.0/CHANGELOG.md +97 -0
  5. pkcs11_check-0.1.0/LICENSE-APACHE +202 -0
  6. pkcs11_check-0.1.0/LICENSE-MIT +21 -0
  7. pkcs11_check-0.1.0/PKG-INFO +169 -0
  8. pkcs11_check-0.1.0/README.md +129 -0
  9. pkcs11_check-0.1.0/THIRD_PARTY_LICENSES.md +123 -0
  10. pkcs11_check-0.1.0/docs/architecture.md +146 -0
  11. pkcs11_check-0.1.0/docs/commands.md +68 -0
  12. pkcs11_check-0.1.0/docs/cve-regression.md +133 -0
  13. pkcs11_check-0.1.0/docs/docker-artifacts.md +106 -0
  14. pkcs11_check-0.1.0/docs/docker-provider-results.md +122 -0
  15. pkcs11_check-0.1.0/docs/file-isolation.md +318 -0
  16. pkcs11_check-0.1.0/docs/mechanism-output-parameters.md +127 -0
  17. pkcs11_check-0.1.0/docs/module-issues.md +1122 -0
  18. pkcs11_check-0.1.0/docs/mutable-mechanism-parameter-gap-analysis.md +444 -0
  19. pkcs11_check-0.1.0/docs/release-v0.1.0.md +244 -0
  20. pkcs11_check-0.1.0/docs/todo.md +48 -0
  21. pkcs11_check-0.1.0/pyproject.toml +128 -0
  22. pkcs11_check-0.1.0/scripts/attr-template-fuzz.py +142 -0
  23. pkcs11_check-0.1.0/scripts/check_raw_exports.py +110 -0
  24. pkcs11_check-0.1.0/scripts/ckr-coverage-check.py +283 -0
  25. pkcs11_check-0.1.0/scripts/compare-results.py +148 -0
  26. pkcs11_check-0.1.0/scripts/cross-module-diff.sh +38 -0
  27. pkcs11_check-0.1.0/scripts/generate-coverage-report.py +176 -0
  28. pkcs11_check-0.1.0/scripts/generate-disabled-tests.py +89 -0
  29. pkcs11_check-0.1.0/scripts/generate_mechanism_vectors.py +1927 -0
  30. pkcs11_check-0.1.0/scripts/generate_raw_standard.py +741 -0
  31. pkcs11_check-0.1.0/scripts/mechanism-audit.py +121 -0
  32. pkcs11_check-0.1.0/scripts/mechanism-matrix.py +110 -0
  33. pkcs11_check-0.1.0/scripts/mechanism_coverage.py +129 -0
  34. pkcs11_check-0.1.0/scripts/run-docker-matrix.sh +94 -0
  35. pkcs11_check-0.1.0/scripts/run-docker-with-results.sh +40 -0
  36. pkcs11_check-0.1.0/scripts/setup-softhsm.sh +53 -0
  37. pkcs11_check-0.1.0/scripts/test-docker.sh +24 -0
  38. pkcs11_check-0.1.0/src/pkcs11_check/__init__.py +3 -0
  39. pkcs11_check-0.1.0/src/pkcs11_check/cli/__init__.py +0 -0
  40. pkcs11_check-0.1.0/src/pkcs11_check/cli/app.py +51 -0
  41. pkcs11_check-0.1.0/src/pkcs11_check/cli/compliance_cmd.py +121 -0
  42. pkcs11_check-0.1.0/src/pkcs11_check/cli/fetch_cmd.py +332 -0
  43. pkcs11_check-0.1.0/src/pkcs11_check/cli/info_cmd.py +69 -0
  44. pkcs11_check-0.1.0/src/pkcs11_check/cli/list_cmd.py +33 -0
  45. pkcs11_check-0.1.0/src/pkcs11_check/cli/state_cmd.py +104 -0
  46. pkcs11_check-0.1.0/src/pkcs11_check/cli/test_cmd.py +353 -0
  47. pkcs11_check-0.1.0/src/pkcs11_check/compliance.py +100 -0
  48. pkcs11_check-0.1.0/src/pkcs11_check/compliance_report.py +664 -0
  49. pkcs11_check-0.1.0/src/pkcs11_check/config.py +53 -0
  50. pkcs11_check-0.1.0/src/pkcs11_check/core/__init__.py +0 -0
  51. pkcs11_check-0.1.0/src/pkcs11_check/core/collection.py +169 -0
  52. pkcs11_check-0.1.0/src/pkcs11_check/core/file_runner.py +2969 -0
  53. pkcs11_check-0.1.0/src/pkcs11_check/core/isolation.py +96 -0
  54. pkcs11_check-0.1.0/src/pkcs11_check/core/loader.py +290 -0
  55. pkcs11_check-0.1.0/src/pkcs11_check/core/logging.py +23 -0
  56. pkcs11_check-0.1.0/src/pkcs11_check/core/preflight.py +187 -0
  57. pkcs11_check-0.1.0/src/pkcs11_check/core/quality_audit.py +800 -0
  58. pkcs11_check-0.1.0/src/pkcs11_check/core/test_selection.py +461 -0
  59. pkcs11_check-0.1.0/src/pkcs11_check/fixtures.py +239 -0
  60. pkcs11_check-0.1.0/src/pkcs11_check/markers.py +97 -0
  61. pkcs11_check-0.1.0/src/pkcs11_check/plugin.py +698 -0
  62. pkcs11_check-0.1.0/src/pkcs11_check/py.typed +0 -0
  63. pkcs11_check-0.1.0/src/pkcs11_check/raw/README.md +361 -0
  64. pkcs11_check-0.1.0/src/pkcs11_check/raw/__init__.py +99 -0
  65. pkcs11_check-0.1.0/src/pkcs11_check/raw/api.py +340 -0
  66. pkcs11_check-0.1.0/src/pkcs11_check/raw/attr_metadata.py +374 -0
  67. pkcs11_check-0.1.0/src/pkcs11_check/raw/bootstrap.py +139 -0
  68. pkcs11_check-0.1.0/src/pkcs11_check/raw/der.py +186 -0
  69. pkcs11_check-0.1.0/src/pkcs11_check/raw/ec.py +72 -0
  70. pkcs11_check-0.1.0/src/pkcs11_check/raw/extensions.py +368 -0
  71. pkcs11_check-0.1.0/src/pkcs11_check/raw/faults.py +224 -0
  72. pkcs11_check-0.1.0/src/pkcs11_check/raw/inspect.py +124 -0
  73. pkcs11_check-0.1.0/src/pkcs11_check/raw/metadata_std.py +1401 -0
  74. pkcs11_check-0.1.0/src/pkcs11_check/raw/pack.py +589 -0
  75. pkcs11_check-0.1.0/src/pkcs11_check/raw/pack_mechanisms.py +1218 -0
  76. pkcs11_check-0.1.0/src/pkcs11_check/raw/recipes.py +1769 -0
  77. pkcs11_check-0.1.0/src/pkcs11_check/raw/rv.py +31 -0
  78. pkcs11_check-0.1.0/src/pkcs11_check/raw/types_std.py +3291 -0
  79. pkcs11_check-0.1.0/src/pkcs11_check/raw_fixtures.py +109 -0
  80. pkcs11_check-0.1.0/src/pkcs11_check/testcases/__init__.py +0 -0
  81. pkcs11_check-0.1.0/src/pkcs11_check/testcases/_error_tuples.py +107 -0
  82. pkcs11_check-0.1.0/src/pkcs11_check/testcases/_module_quirks.py +205 -0
  83. pkcs11_check-0.1.0/src/pkcs11_check/testcases/_raw_subprocess.py +97 -0
  84. pkcs11_check-0.1.0/src/pkcs11_check/testcases/_subprocess_preamble.py +140 -0
  85. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/_eddsa_helpers.py +291 -0
  86. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/_mldsa_helpers.py +293 -0
  87. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/_mlkem_helpers.py +225 -0
  88. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/acvp_loader.py +90 -0
  89. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/__init__.py +28 -0
  90. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/base.py +40 -0
  91. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/base_cts.py +318 -0
  92. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/base_loader.py +239 -0
  93. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/base_runner_aead.py +352 -0
  94. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/base_runner_simple.py +402 -0
  95. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/conftest.py +137 -0
  96. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_ccm.py +177 -0
  97. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_cfb1.py +46 -0
  98. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_cfb128.py +56 -0
  99. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_cfb8.py +56 -0
  100. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_cts.py +105 -0
  101. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_cts_detect.py +35 -0
  102. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_gcm.py +301 -0
  103. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_ofb.py +56 -0
  104. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_wrap.py +296 -0
  105. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/aes/test_xts.py +161 -0
  106. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/rsa/__init__.py +0 -0
  107. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/rsa/base_loader.py +420 -0
  108. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_ecdh.py +393 -0
  109. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_ecdsa.py +353 -0
  110. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_eddsa.py +254 -0
  111. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_hash.py +227 -0
  112. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_hmac.py +196 -0
  113. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_mldsa.py +297 -0
  114. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_mlkem.py +322 -0
  115. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_rsa.py +240 -0
  116. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_rsa_keygen.py +236 -0
  117. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_sha3.py +119 -0
  118. pkcs11_check-0.1.0/src/pkcs11_check/testcases/acvp/test_acvp_slhdsa.py +330 -0
  119. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/__init__.py +0 -0
  120. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/_ckr_spec.py +8205 -0
  121. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/_ctypes_raw.py +136 -0
  122. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/conftest.py +30 -0
  123. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_codes.py +195 -0
  124. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_decrypt.py +240 -0
  125. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_derive.py +94 -0
  126. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_destructive.py +281 -0
  127. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_digest.py +61 -0
  128. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_dual.py +165 -0
  129. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_encrypt.py +233 -0
  130. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_fault_inject.py +269 -0
  131. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_general.py +111 -0
  132. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_kem.py +207 -0
  133. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_keygen.py +302 -0
  134. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_null_params.py +194 -0
  135. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_object.py +257 -0
  136. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_priority.py +110 -0
  137. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_random.py +57 -0
  138. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_raw_args_bad.py +226 -0
  139. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_raw_attrs.py +200 -0
  140. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_raw_buffer.py +214 -0
  141. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_raw_multipart.py +251 -0
  142. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_raw_state.py +201 -0
  143. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_session.py +114 -0
  144. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_sign.py +120 -0
  145. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_slot_token.py +55 -0
  146. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_spec_compliance.py +316 -0
  147. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_state.py +59 -0
  148. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_universal.py +197 -0
  149. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_v30_raw.py +209 -0
  150. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_v32_raw.py +270 -0
  151. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_verify.py +159 -0
  152. pkcs11_check-0.1.0/src/pkcs11_check/testcases/ckr/test_ckr_wrap.py +393 -0
  153. pkcs11_check-0.1.0/src/pkcs11_check/testcases/conftest.py +97 -0
  154. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/__init__.py +69 -0
  155. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/aes_ecb.json +26 -0
  156. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_cbc.json +41 -0
  157. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_cbc_pad.json +41 -0
  158. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_ccm.json +110 -0
  159. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_cfb128.json +47 -0
  160. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_cfb8.json +47 -0
  161. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_ctr.json +41 -0
  162. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_ecb.json +35 -0
  163. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_gcm.json +92 -0
  164. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_ofb.json +47 -0
  165. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aes_xts.json +34 -0
  166. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aria_cbc.json +47 -0
  167. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/aria_ecb.json +41 -0
  168. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/camellia_cbc.json +47 -0
  169. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/camellia_ecb.json +41 -0
  170. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/chacha20_poly1305.json +24 -0
  171. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/des3_cbc.json +19 -0
  172. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/des3_ecb.json +17 -0
  173. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/des_cbc.json +21 -0
  174. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/des_ecb.json +19 -0
  175. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/ecdsa_p224.json +44 -0
  176. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/ecdsa_p384.json +80 -0
  177. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/ecdsa_p521.json +80 -0
  178. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/ecdsa_secp256k1.json +44 -0
  179. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/ecdsa_sha1.json +44 -0
  180. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/ecdsa_sha256.json +80 -0
  181. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/eddsa.json +74 -0
  182. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/hmac_md5.json +17 -0
  183. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/hmac_sha1.json +17 -0
  184. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/hmac_sha224.json +17 -0
  185. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/hmac_sha256.json +17 -0
  186. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/hmac_sha384.json +17 -0
  187. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/hmac_sha512.json +17 -0
  188. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/rsa_pkcs1_sha1.json +62 -0
  189. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/rsa_pkcs1_sha256.json +62 -0
  190. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/rsa_pkcs1_sha384.json +62 -0
  191. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/rsa_pkcs1_sha512.json +62 -0
  192. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/rsa_pss_sha256.json +65 -0
  193. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/seed_cbc.json +21 -0
  194. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/seed_ecb.json +19 -0
  195. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/sha.json +128 -0
  196. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/sha3.json +104 -0
  197. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/mechanism_vectors/sha512_truncated.json +56 -0
  198. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/sha1.json +9 -0
  199. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/sha224.json +8 -0
  200. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/sha256.json +9 -0
  201. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/sha384.json +8 -0
  202. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/sha512.json +9 -0
  203. pkcs11_check-0.1.0/src/pkcs11_check/testcases/data/sources.toml +46 -0
  204. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_catalog.py +89 -0
  205. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_helpers.py +844 -0
  206. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/__init__.py +158 -0
  207. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_aes.py +443 -0
  208. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_ciphers.py +485 -0
  209. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_des.py +337 -0
  210. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_dsa_dh.py +292 -0
  211. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_ec.py +306 -0
  212. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_hash.py +224 -0
  213. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_hmac.py +808 -0
  214. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_kdf.py +671 -0
  215. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_legacy.py +1146 -0
  216. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_misc.py +564 -0
  217. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_pqc.py +455 -0
  218. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_registry/_rsa.py +466 -0
  219. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_selection.py +252 -0
  220. pkcs11_check-0.1.0/src/pkcs11_check/testcases/mechanism_vectors.py +36 -0
  221. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/__init__.py +0 -0
  222. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/conftest.py +83 -0
  223. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_api_boundary.py +766 -0
  224. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_api_security.py +348 -0
  225. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_arithmetic_overflow.py +732 -0
  226. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_crypto_weakness.py +389 -0
  227. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_cve_regression.py +743 -0
  228. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_error_path_kwp.py +309 -0
  229. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_error_path_rsa.py +350 -0
  230. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_ffi_length_boundary.py +1690 -0
  231. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_ffi_null_pointer.py +1257 -0
  232. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_handle_reuse.py +157 -0
  233. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_nonce_quality.py +192 -0
  234. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_padding_oracle.py +767 -0
  235. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_parameter_validation.py +784 -0
  236. pkcs11_check-0.1.0/src/pkcs11_check/testcases/security/test_tookan.py +387 -0
  237. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_access.py +194 -0
  238. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_access_control.py +471 -0
  239. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_access_levels.py +1415 -0
  240. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_aead.py +431 -0
  241. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_aead_wrap_outputs.py +195 -0
  242. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_aes_kdf.py +396 -0
  243. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_aes_modes.py +829 -0
  244. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_aria.py +439 -0
  245. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_attribute_defaults.py +328 -0
  246. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_attribute_enforcement.py +714 -0
  247. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_attribute_fuzz.py +280 -0
  248. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_authenticated_wrap.py +917 -0
  249. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_benchmark.py +207 -0
  250. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_blake2.py +168 -0
  251. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_blowfish.py +256 -0
  252. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_buffers.py +282 -0
  253. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_camellia.py +530 -0
  254. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_cctv_ed25519.py +104 -0
  255. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_cctv_mldsa.py +162 -0
  256. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_cctv_rfc6979.py +138 -0
  257. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_cms.py +140 -0
  258. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_concurrent_sessions.py +280 -0
  259. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_crossverify.py +478 -0
  260. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_crossverify_extended.py +314 -0
  261. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_data_objects.py +389 -0
  262. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_des.py +1072 -0
  263. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_dh_key_agreement.py +471 -0
  264. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_digest.py +236 -0
  265. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_domain_params.py +246 -0
  266. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_double_ratchet.py +500 -0
  267. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_dsa_complete.py +509 -0
  268. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_dual_function.py +545 -0
  269. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_duplicate_labels.py +128 -0
  270. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ec_curves.py +133 -0
  271. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ec_import_export.py +139 -0
  272. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ecdh_extended.py +582 -0
  273. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ecdh_known_answer.py +210 -0
  274. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ecdsa_extended.py +118 -0
  275. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_eddsa.py +308 -0
  276. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_encrypt.py +300 -0
  277. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_errors.py +497 -0
  278. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_extended_mechanisms.py +356 -0
  279. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_fuzz.py +237 -0
  280. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_generic_secret.py +162 -0
  281. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_gost.py +414 -0
  282. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_hash_ml_dsa.py +233 -0
  283. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_hash_slh_dsa.py +222 -0
  284. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_hkdf_extended.py +310 -0
  285. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_hw_features.py +228 -0
  286. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ike.py +477 -0
  287. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_init.py +90 -0
  288. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_interface.py +125 -0
  289. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_interface_negotiation.py +114 -0
  290. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_interop.py +410 -0
  291. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_interop_openssl.py +191 -0
  292. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_kat.py +164 -0
  293. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_kdf.py +418 -0
  294. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_kem.py +816 -0
  295. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_key_flags.py +370 -0
  296. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_key_lifecycle.py +360 -0
  297. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_key_sizes.py +183 -0
  298. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_key_usage_policy.py +299 -0
  299. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_keymgmt.py +325 -0
  300. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_keypair_consistency.py +137 -0
  301. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_large_objects.py +168 -0
  302. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_attribute.py +252 -0
  303. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_derive.py +760 -0
  304. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_digest.py +214 -0
  305. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_encrypt.py +151 -0
  306. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_flags.py +102 -0
  307. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_kem.py +132 -0
  308. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_keygen.py +95 -0
  309. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_lifecycle.py +655 -0
  310. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_message.py +541 -0
  311. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_multipart.py +241 -0
  312. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_negative.py +353 -0
  313. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_probe.py +158 -0
  314. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_sign.py +316 -0
  315. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_sign_recover.py +122 -0
  316. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_state.py +494 -0
  317. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mech_wrap.py +605 -0
  318. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mechanism.py +86 -0
  319. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mechanism_fuzz.py +201 -0
  320. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_mechanism_objects.py +114 -0
  321. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_message_crypto.py +405 -0
  322. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_metamorphic.py +304 -0
  323. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_misc_kdf.py +571 -0
  324. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_multipart.py +128 -0
  325. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_multipart_streaming.py +194 -0
  326. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_object.py +297 -0
  327. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_object_search_patterns.py +192 -0
  328. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_object_size.py +131 -0
  329. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_object_visibility.py +805 -0
  330. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_operation_state.py +700 -0
  331. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_otp.py +291 -0
  332. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_pbe.py +803 -0
  333. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_pin.py +182 -0
  334. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_pqc_sign.py +449 -0
  335. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_profiles.py +149 -0
  336. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_protocol_edge_cases.py +187 -0
  337. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_reinitialize.py +125 -0
  338. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_remaining_gaps.py +649 -0
  339. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_resource.py +188 -0
  340. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_rng.py +154 -0
  341. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ro_session.py +170 -0
  342. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ro_session_restrictions.py +719 -0
  343. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_rsa_extended.py +661 -0
  344. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_rsa_key_import.py +184 -0
  345. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_rsa_key_wrapping.py +370 -0
  346. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_rsa_oaep.py +356 -0
  347. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_salsa20.py +411 -0
  348. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_search.py +142 -0
  349. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_seed.py +428 -0
  350. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_sensitivity.py +230 -0
  351. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_session_edge_cases.py +247 -0
  352. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_session_exhaustion.py +102 -0
  353. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_session_info.py +128 -0
  354. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_session_state_machine.py +1026 -0
  355. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_session_validation_flags.py +25 -0
  356. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_set_attribute.py +162 -0
  357. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_sha3.py +106 -0
  358. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_sign.py +330 -0
  359. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_sign_recover.py +550 -0
  360. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_slot.py +55 -0
  361. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_so_pin.py +126 -0
  362. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_sp800_108_kdf.py +742 -0
  363. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_ssl3.py +675 -0
  364. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_stateful.py +169 -0
  365. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_stateful_sigs.py +535 -0
  366. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_stress.py +208 -0
  367. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_subprocess_safety.py +430 -0
  368. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_surface_audit.py +416 -0
  369. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_threading.py +134 -0
  370. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_tls12.py +1004 -0
  371. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_token_flags.py +241 -0
  372. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_token_objects.py +228 -0
  373. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_tool_templates.py +153 -0
  374. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_trust_objects.py +151 -0
  375. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_twofish.py +256 -0
  376. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_v30_session.py +746 -0
  377. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_validation_objects.py +154 -0
  378. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_vendor_extensions.py +111 -0
  379. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_verify_signature.py +170 -0
  380. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_wtls.py +647 -0
  381. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_x3dh.py +60 -0
  382. pkcs11_check-0.1.0/src/pkcs11_check/testcases/test_x942_dh.py +416 -0
  383. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/__init__.py +0 -0
  384. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/_key_decoders.py +203 -0
  385. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof.py +505 -0
  386. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_aes.py +463 -0
  387. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_chacha.py +114 -0
  388. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_dsa.py +133 -0
  389. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_ecdh.py +205 -0
  390. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_ecdsa.py +266 -0
  391. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_ed25519.py +191 -0
  392. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_hkdf.py +160 -0
  393. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_hmac.py +213 -0
  394. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_mldsa.py +143 -0
  395. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_mldsa_sign.py +136 -0
  396. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_mlkem.py +170 -0
  397. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_pbes2.py +173 -0
  398. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_pbkdf2.py +162 -0
  399. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_rsa.py +190 -0
  400. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_rsa_decrypt.py +132 -0
  401. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_rsa_oaep.py +217 -0
  402. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_rsa_pss.py +231 -0
  403. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_rsa_siggen.py +158 -0
  404. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/test_wycheproof_x25519.py +176 -0
  405. pkcs11_check-0.1.0/src/pkcs11_check/testcases/wycheproof/wycheproof_loader.py +57 -0
  406. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/__init__.py +0 -0
  407. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/conftest.py +457 -0
  408. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_attribute_parity.py +80 -0
  409. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_attributes.py +177 -0
  410. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_core_ops.py +426 -0
  411. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_identity.py +114 -0
  412. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_lifecycle.py +152 -0
  413. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_limbo_import.py +282 -0
  414. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_limbo_stress.py +159 -0
  415. pkcs11_check-0.1.0/src/pkcs11_check/testcases/x509/test_search.py +135 -0
  416. pkcs11_check-0.1.0/tests/conftest.py +3 -0
  417. pkcs11_check-0.1.0/tests/data/metadata_std_reference.py +1149 -0
  418. pkcs11_check-0.1.0/tests/data/types_std_reference.py +2540 -0
  419. pkcs11_check-0.1.0/tests/test_cli.py +1201 -0
  420. pkcs11_check-0.1.0/tests/test_collection.py +43 -0
  421. pkcs11_check-0.1.0/tests/test_compliance_report.py +110 -0
  422. pkcs11_check-0.1.0/tests/test_config.py +73 -0
  423. pkcs11_check-0.1.0/tests/test_data_paths.py +176 -0
  424. pkcs11_check-0.1.0/tests/test_docker_targets.py +53 -0
  425. pkcs11_check-0.1.0/tests/test_ec_encoding.py +335 -0
  426. pkcs11_check-0.1.0/tests/test_file_runner.py +3722 -0
  427. pkcs11_check-0.1.0/tests/test_isolation.py +66 -0
  428. pkcs11_check-0.1.0/tests/test_loader.py +128 -0
  429. pkcs11_check-0.1.0/tests/test_markers.py +62 -0
  430. pkcs11_check-0.1.0/tests/test_mech_wrap.py +74 -0
  431. pkcs11_check-0.1.0/tests/test_mechanism_helpers.py +77 -0
  432. pkcs11_check-0.1.0/tests/test_mechanism_selection.py +215 -0
  433. pkcs11_check-0.1.0/tests/test_module_quirks.py +140 -0
  434. pkcs11_check-0.1.0/tests/test_needs_mechanism.py +74 -0
  435. pkcs11_check-0.1.0/tests/test_plugin.py +545 -0
  436. pkcs11_check-0.1.0/tests/test_preflight.py +75 -0
  437. pkcs11_check-0.1.0/tests/test_quality_audit.py +574 -0
  438. pkcs11_check-0.1.0/tests/test_raw.py +64 -0
  439. pkcs11_check-0.1.0/tests/test_raw_api.py +282 -0
  440. pkcs11_check-0.1.0/tests/test_raw_bootstrap.py +262 -0
  441. pkcs11_check-0.1.0/tests/test_raw_constants.py +253 -0
  442. pkcs11_check-0.1.0/tests/test_raw_der.py +281 -0
  443. pkcs11_check-0.1.0/tests/test_raw_extensions.py +477 -0
  444. pkcs11_check-0.1.0/tests/test_raw_faults.py +56 -0
  445. pkcs11_check-0.1.0/tests/test_raw_fixtures.py +26 -0
  446. pkcs11_check-0.1.0/tests/test_raw_generation.py +220 -0
  447. pkcs11_check-0.1.0/tests/test_raw_header_parity.py +87 -0
  448. pkcs11_check-0.1.0/tests/test_raw_inspect.py +149 -0
  449. pkcs11_check-0.1.0/tests/test_raw_pack.py +1045 -0
  450. pkcs11_check-0.1.0/tests/test_raw_recipes.py +328 -0
  451. pkcs11_check-0.1.0/tests/test_release_hygiene.py +208 -0
  452. pkcs11_check-0.1.0/tests/test_state_cmd.py +64 -0
  453. pkcs11_check-0.1.0/tests/test_task8_raw_migration.py +48 -0
  454. pkcs11_check-0.1.0/tests/test_test_selection.py +482 -0
  455. pkcs11_check-0.1.0/third_party/pkcs11-headers/3.2/README.md +12 -0
  456. pkcs11_check-0.1.0/third_party/pkcs11-headers/3.2/pkcs11.h +2771 -0
  457. pkcs11_check-0.1.0/uv.lock +801 -0
@@ -0,0 +1,33 @@
1
+ # Third-party test vector data (bind-mounted at runtime, not copied)
2
+ data/
3
+
4
+ # Local builds (large, not needed in Docker)
5
+ local-builds/
6
+
7
+ # Artifacts from previous Docker runs
8
+ artifacts/
9
+ artifacts*/
10
+
11
+ # All dotfiles/dirs (caches, editor state, git)
12
+ .*
13
+
14
+ # Python caches
15
+ **/__pycache__/
16
+ *.pyc
17
+
18
+ # Documentation — not needed at runtime
19
+ docs/
20
+
21
+ # Host-side scripts (fetch-data, analysis, etc.)
22
+ scripts/
23
+
24
+ # Meta-tests (pkcs11-check's own tests, not product testcases)
25
+ tests/
26
+
27
+ # Dockerfiles and compose (not needed inside containers; run-*.sh ARE needed)
28
+ docker/*/Dockerfile*
29
+ docker/docker-compose*.yml
30
+
31
+ # Root analysis/investigation/dev files
32
+ CLAUDE.md
33
+ AGENTS.md
@@ -0,0 +1,20 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .mypy_cache/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ *.so
10
+ .venv/
11
+ .hypothesis/
12
+ .claude/*.local.md
13
+ results/
14
+ artifacts/
15
+ artifacts*/
16
+ .pkcs11-check-isolation-state.json
17
+ .pkcs11-check-isolation-policy.json
18
+ local-builds/bouncyhsm/
19
+ local-builds/data/
20
+ .worktrees/
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,97 @@
1
+ # Changelog
2
+
3
+ ## [0.1.0] - 2026-05-04
4
+
5
+ First public release.
6
+
7
+ This release packages the internal beta work into a public CLI-first PKCS#11 test
8
+ suite. It includes the command line app, pytest plugin, pure-ctypes raw binding,
9
+ provider isolation, security regression coverage, Docker/local provider tooling,
10
+ and release-readiness hardening needed for use across multiple projects.
11
+
12
+ ### Features
13
+
14
+ - **PKCS#11 interface negotiation** - automatic v2.40/v3.0/v3.1/v3.2 detection
15
+ with `--interface` forcing.
16
+ - **Crash survival** - per-file subprocess isolation keeps the runner alive when
17
+ loaded modules segfault or abort.
18
+ - **Pure ctypes binding** (`pkcs11_check.raw`) - v2.40, v3.0 message-based, and
19
+ v3.2 KEM surfaces without C compilation.
20
+ - **Large product test suite** - mechanism, compliance, security, CVE, Wycheproof,
21
+ ACVP, CCTV, X.509, and PQC coverage.
22
+ - **pytest plugin** - run project-specific tests with `pytest --p11-module=...`.
23
+ - **CLI** - `pkcs11-check test`, `info`, `state`, `compliance-report`,
24
+ `fetch-data`, and related helper commands.
25
+ - **Provider tooling** - local and Docker flows for SoftHSM2, Kryoptic, NSS,
26
+ OpenCryptoki, TPM2, BouncyHSM, pkcs11-mock, qryptotoken, and related targets.
27
+
28
+ ### Security and Compliance Coverage
29
+
30
+ - Added regression coverage for known PKCS#11 vulnerability classes, including
31
+ Tookan-style attribute escalation, sensitive/extractable downgrade checks,
32
+ Bleichenbacher/Manger RSA oracle families, CBC padding-oracle patterns, KWP
33
+ error-path behavior, arithmetic/boundary validation, and API state misuse.
34
+ - Added hard-fail gates for access-control and attribute-enforcement issues such
35
+ as `CKA_TRUSTED`, `CKA_COPYABLE`, `CKA_DESTROYABLE`,
36
+ `CKA_WRAP_WITH_TRUSTED`, and non-extractable key handling.
37
+ - Added authenticated wrap, ECDH AES key wrap, v3.0 message API, multipart state,
38
+ and cross-process isolation checks.
39
+ - Added module quirk registry support so provider-specific behavior is explicit,
40
+ documented, and does not silently hide real failures.
41
+ - Expanded `docs/module-issues.md` and `docs/cve-regression.md` with findings and
42
+ coverage notes discovered during internal provider validation.
43
+
44
+ ### Release Hardening
45
+
46
+ - Hardened `fetch-data` by requiring HTTPS downloads and rejecting unsafe archive
47
+ members that could escape the extraction directory.
48
+ - Removed shell invocation from OpenSSL interop tests.
49
+ - Replaced silent broad `except Exception: pass` patterns with specific handling
50
+ or direct failure paths.
51
+ - Annotated intentional legacy PKCS#11 crypto references, including SHA-1 and
52
+ AES-ECB compatibility checks, so scanner output separates deliberate mechanism
53
+ coverage from unsafe application crypto.
54
+ - Added release hygiene tests for broad exception swallowing, `shell=True`,
55
+ non-security SHA-1 context, legacy crypto annotations, public-doc path leaks,
56
+ and packaging hygiene.
57
+ - Verified the package with linting, formatting, strict mypy, meta-tests,
58
+ product-test collection, SoftHSM2 smoke, dependency audit, Bandit medium/high
59
+ scan, credential-focused secret scan, wheel/sdist build, artifact scrub, and
60
+ isolated wheel install smoke.
61
+
62
+ ### Supported modules
63
+
64
+ - SoftHSM2 2.7.0
65
+ - Kryoptic 1.5.0+PQC (v3.2)
66
+ - NSS 3.120.1 / 3.121.0 PQC
67
+ - OpenCryptoki 3.26
68
+ - tpm2-pkcs11 1.9.0
69
+ - BouncyHSM 2.0.1
70
+ - pkcs11-mock 2.0.0
71
+ - qryptotoken 0.4.1
72
+
73
+ ### Test Results (2026-04-09)
74
+
75
+ Internal baseline results before the public release candidate. These numbers are
76
+ kept as release evidence from the deliberate provider validation run and should
77
+ only be refreshed after another full provider validation pass.
78
+
79
+ Tested 6 modules, ~510K total test executions across 237 test files:
80
+
81
+ | Module | Passed | Failed | Skipped | Xfailed | Total |
82
+ |--------|-------:|-------:|--------:|--------:|------:|
83
+ | OpenCryptoki (master) | 75,265 | 2,405 | 8,512 | 54 | 86,242 |
84
+ | BouncyHSM (v2.0.1) | 66,307 | 22,282 | 8,694 | 59 | 97,345 |
85
+ | Kryoptic (main) | 65,674 | 2,831 | 32,218 | 68 | 100,791 |
86
+ | SoftHSM2 (main) | 60,820 | 2,697 | 16,943 | 41 | 80,501 |
87
+ | NSS (main) | 46,185 | 2,018 | 34,454 | 105 | 82,763 |
88
+ | tpm2-pkcs11 (1.9.1) | 8,202 | 5,028 | 47,977 | 2 | 62,242 |
89
+
90
+ Key findings: 2 CRITICAL (NSS sensitive key exposure, Tookan CKA_EXTRACTABLE escalation),
91
+ 9 HIGH-severity issues across 4 modules, real SIGSEGV crashes in all 6 modules.
92
+ See [docs/release-v0.1.0.md](docs/release-v0.1.0.md) for full breakdown.
93
+
94
+ ### Requirements
95
+
96
+ - Python 3.13+
97
+ - Linux (primary), macOS and Windows where ctypes works
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Denis Mingulov
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Denis Mingulov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: pkcs11-check
3
+ Version: 0.1.0
4
+ Summary: CLI-first PKCS#11 test suite with segfault survival, interface forcing, and pytest plugin
5
+ Project-URL: Homepage, https://github.com/mingulov/pkcs11-check
6
+ Project-URL: Repository, https://github.com/mingulov/pkcs11-check
7
+ Project-URL: Documentation, https://github.com/mingulov/pkcs11-check/tree/main/docs
8
+ Project-URL: Issues, https://github.com/mingulov/pkcs11-check/issues
9
+ Author-email: Denis Mingulov <denis@mingulov.com>
10
+ License-Expression: MIT OR Apache-2.0
11
+ License-File: LICENSE-APACHE
12
+ License-File: LICENSE-MIT
13
+ License-File: THIRD_PARTY_LICENSES.md
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Security :: Cryptography
21
+ Classifier: Topic :: Software Development :: Testing
22
+ Requires-Python: >=3.13
23
+ Requires-Dist: asn1crypto>=1.5
24
+ Requires-Dist: cryptography>=46.0.5
25
+ Requires-Dist: hypothesis>=6.100
26
+ Requires-Dist: psutil>=5.9
27
+ Requires-Dist: pydantic-settings[toml]>=2.0
28
+ Requires-Dist: pydantic>=2.0
29
+ Requires-Dist: pytest-reportlog>=1.0.0
30
+ Requires-Dist: pytest-timeout>=2.3
31
+ Requires-Dist: pytest-xdist>=3.5
32
+ Requires-Dist: pytest>=8.0
33
+ Requires-Dist: rich>=13.0
34
+ Requires-Dist: typer>=0.15
35
+ Provides-Extra: dev
36
+ Requires-Dist: mypy; extra == 'dev'
37
+ Requires-Dist: pytest-cov; extra == 'dev'
38
+ Requires-Dist: ruff; extra == 'dev'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # pkcs11-check
42
+
43
+ CLI-first PKCS#11 test suite with segfault survival, interface forcing, and pytest plugin.
44
+
45
+ ## What it does
46
+
47
+ pkcs11-check runs comprehensive tests against PKCS#11 modules (hardware HSMs, software tokens, smart cards). It catches:
48
+
49
+ - **Crashes and segfaults** — per-file subprocess isolation recovers from SIGSEGV
50
+ - **CKR return code violations** — different spec conditions checked against OASIS PKCS#11 standard
51
+ - **CVE regressions** — tests for known CVEs across NSS, SoftHSM2, TPM2, OpenCryptoki
52
+ - **Security policy violations** — Tookan paper vectors, attribute fuzzing, padding oracle detection
53
+ - **Interface negotiation bugs** — v2.40/v3.0/v3.1/v3.2 with automatic fallback
54
+
55
+ ## Quick start
56
+
57
+ ```bash
58
+ # Install
59
+ git clone https://github.com/mingulov/pkcs11-check
60
+ cd pkcs11-check
61
+ uv sync
62
+
63
+ # Run against SoftHSM2
64
+ bash local-builds/build.sh softhsm2
65
+ bash local-builds/test.sh softhsm2
66
+
67
+ # Run against Kryoptic (v3.2 with PQC)
68
+ bash local-builds/build.sh kryoptic
69
+ bash local-builds/test.sh kryoptic
70
+
71
+ # Run against system NSS
72
+ bash local-builds/test.sh nss-softokn
73
+ ```
74
+
75
+ ### From PyPI (installed)
76
+
77
+ ```bash
78
+ pip install pkcs11-check
79
+ pkcs11-check fetch-data all # download test vectors (~800 MB)
80
+ pkcs11-check test --module /path/to/module.so --pin 1234
81
+ ```
82
+
83
+ ## Test suite
84
+
85
+ Test categories:
86
+
87
+ | Category | Description |
88
+ |----------|-------------|
89
+ | Core crypto | AES, RSA, ECDSA, EdDSA, HMAC, digest |
90
+ | Wycheproof | Edge-case vectors from C2SP |
91
+ | PQC (v3.2) | ML-KEM, ML-DSA, SLH-DSA |
92
+ | CKR compliance | Return code verification per OASIS spec |
93
+ | CVE regression | Known vulnerability tests |
94
+ | Security | Attribute fuzz, Tookan, handle reuse |
95
+ | Stress | Threading, resource exhaustion |
96
+
97
+ ## Supported modules
98
+
99
+ | Module | Version | Status |
100
+ |--------|---------|--------|
101
+ | SoftHSM2 | 2.7.0 | Full support |
102
+ | Kryoptic | 1.5.0+PQC | Full support (v3.2) |
103
+ | NSS softokn | system | Crypto services (slot 0) |
104
+ | OpenCryptoki | 3.26 | Docker only |
105
+ | pkcs11-mock | 2.0.0 | Stub testing |
106
+ | tpm2-pkcs11 | 1.9.0 | Hardware TPM |
107
+ | BouncyHSM | 2.0.1 | Docker only |
108
+ | qryptotoken | 0.4.1 | Docker only |
109
+
110
+ ## Known limitations in v0.1.0
111
+
112
+ - SO login is not implemented yet, so trusted-certificate import with
113
+ `CKA_TRUSTED=True` is not fully covered through `CKU_SO` workflows.
114
+ - CloudHSM/Thales in-band IV profiles, proxy/loader mutable-parameter
115
+ preservation checks, and broader mutable-output simulator targets are tracked
116
+ as post-v0.1.0 interop work.
117
+
118
+ ## Architecture
119
+
120
+ ```
121
+ src/pkcs11_check/
122
+ raw/ — pure ctypes PKCS#11 binding (v2.40-v3.2, PQC)
123
+ cli/ — typer CLI (test, info, version commands)
124
+ core/ — module loader, isolation runner, preflight
125
+ testcases/ — test files (the product)
126
+ ckr/ — CKR return code compliance tests
127
+ plugin.py — pytest plugin (markers, fixtures, collection)
128
+ fixtures.py — p11_session, p11_module, p11_config
129
+ config.py — four-layer config (CLI > env > TOML > defaults)
130
+
131
+ local-builds/ — build scripts for soft token providers
132
+ docker/ — Docker test targets
133
+ ```
134
+
135
+ ## Key features
136
+
137
+ - **`pkcs11_check.raw`** — pure Python ctypes binding with v2.40/v3.0/v3.1/v3.2 interface negotiation, 50+ PQC mechanisms, all 68 standard functions
138
+ - **`--isolation file`** mode runs each test file in its own subprocess — crashes don't kill the suite
139
+ - **`--ckr-strict`** mode enforces exact OASIS spec CKR codes (not just "any error")
140
+ - **Wycheproof + ACVP vectors** — cross-verification against C2SP and NIST test vectors
141
+
142
+ ## Documentation
143
+
144
+ - `docs/architecture.md` — codebase structure and test writing guide
145
+ - `docs/commands.md` — build, test, and Docker commands
146
+ - `docs/module-issues.md` — per-module bugs and quirks
147
+ - `docs/mechanism-output-parameters.md` — generated IV/nonce/tag output-parameter coverage
148
+ - `docs/docker-provider-results.md` — release Docker provider source and result snapshot
149
+ - `docs/todo.md` — public roadmap and known limitations
150
+ - `docs/cve-regression.md` — CVE coverage tracker
151
+ - `docs/file-isolation.md` — isolation runner design
152
+ - `docs/docker-artifacts.md` — Docker test runner contract
153
+
154
+ ## License
155
+
156
+ Licensed under either of
157
+
158
+ - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
159
+ - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
160
+
161
+ at your option.
162
+
163
+ ### Third-party attributions
164
+
165
+ pkcs11-check bundles the public-domain PKCS#11 v3.2 header from
166
+ `latchset/pkcs11-headers`, and its `fetch-data` command downloads test
167
+ vectors from C2SP and NIST. See
168
+ [`THIRD_PARTY_LICENSES.md`](THIRD_PARTY_LICENSES.md) for the full list and
169
+ per-source license terms.
@@ -0,0 +1,129 @@
1
+ # pkcs11-check
2
+
3
+ CLI-first PKCS#11 test suite with segfault survival, interface forcing, and pytest plugin.
4
+
5
+ ## What it does
6
+
7
+ pkcs11-check runs comprehensive tests against PKCS#11 modules (hardware HSMs, software tokens, smart cards). It catches:
8
+
9
+ - **Crashes and segfaults** — per-file subprocess isolation recovers from SIGSEGV
10
+ - **CKR return code violations** — different spec conditions checked against OASIS PKCS#11 standard
11
+ - **CVE regressions** — tests for known CVEs across NSS, SoftHSM2, TPM2, OpenCryptoki
12
+ - **Security policy violations** — Tookan paper vectors, attribute fuzzing, padding oracle detection
13
+ - **Interface negotiation bugs** — v2.40/v3.0/v3.1/v3.2 with automatic fallback
14
+
15
+ ## Quick start
16
+
17
+ ```bash
18
+ # Install
19
+ git clone https://github.com/mingulov/pkcs11-check
20
+ cd pkcs11-check
21
+ uv sync
22
+
23
+ # Run against SoftHSM2
24
+ bash local-builds/build.sh softhsm2
25
+ bash local-builds/test.sh softhsm2
26
+
27
+ # Run against Kryoptic (v3.2 with PQC)
28
+ bash local-builds/build.sh kryoptic
29
+ bash local-builds/test.sh kryoptic
30
+
31
+ # Run against system NSS
32
+ bash local-builds/test.sh nss-softokn
33
+ ```
34
+
35
+ ### From PyPI (installed)
36
+
37
+ ```bash
38
+ pip install pkcs11-check
39
+ pkcs11-check fetch-data all # download test vectors (~800 MB)
40
+ pkcs11-check test --module /path/to/module.so --pin 1234
41
+ ```
42
+
43
+ ## Test suite
44
+
45
+ Test categories:
46
+
47
+ | Category | Description |
48
+ |----------|-------------|
49
+ | Core crypto | AES, RSA, ECDSA, EdDSA, HMAC, digest |
50
+ | Wycheproof | Edge-case vectors from C2SP |
51
+ | PQC (v3.2) | ML-KEM, ML-DSA, SLH-DSA |
52
+ | CKR compliance | Return code verification per OASIS spec |
53
+ | CVE regression | Known vulnerability tests |
54
+ | Security | Attribute fuzz, Tookan, handle reuse |
55
+ | Stress | Threading, resource exhaustion |
56
+
57
+ ## Supported modules
58
+
59
+ | Module | Version | Status |
60
+ |--------|---------|--------|
61
+ | SoftHSM2 | 2.7.0 | Full support |
62
+ | Kryoptic | 1.5.0+PQC | Full support (v3.2) |
63
+ | NSS softokn | system | Crypto services (slot 0) |
64
+ | OpenCryptoki | 3.26 | Docker only |
65
+ | pkcs11-mock | 2.0.0 | Stub testing |
66
+ | tpm2-pkcs11 | 1.9.0 | Hardware TPM |
67
+ | BouncyHSM | 2.0.1 | Docker only |
68
+ | qryptotoken | 0.4.1 | Docker only |
69
+
70
+ ## Known limitations in v0.1.0
71
+
72
+ - SO login is not implemented yet, so trusted-certificate import with
73
+ `CKA_TRUSTED=True` is not fully covered through `CKU_SO` workflows.
74
+ - CloudHSM/Thales in-band IV profiles, proxy/loader mutable-parameter
75
+ preservation checks, and broader mutable-output simulator targets are tracked
76
+ as post-v0.1.0 interop work.
77
+
78
+ ## Architecture
79
+
80
+ ```
81
+ src/pkcs11_check/
82
+ raw/ — pure ctypes PKCS#11 binding (v2.40-v3.2, PQC)
83
+ cli/ — typer CLI (test, info, version commands)
84
+ core/ — module loader, isolation runner, preflight
85
+ testcases/ — test files (the product)
86
+ ckr/ — CKR return code compliance tests
87
+ plugin.py — pytest plugin (markers, fixtures, collection)
88
+ fixtures.py — p11_session, p11_module, p11_config
89
+ config.py — four-layer config (CLI > env > TOML > defaults)
90
+
91
+ local-builds/ — build scripts for soft token providers
92
+ docker/ — Docker test targets
93
+ ```
94
+
95
+ ## Key features
96
+
97
+ - **`pkcs11_check.raw`** — pure Python ctypes binding with v2.40/v3.0/v3.1/v3.2 interface negotiation, 50+ PQC mechanisms, all 68 standard functions
98
+ - **`--isolation file`** mode runs each test file in its own subprocess — crashes don't kill the suite
99
+ - **`--ckr-strict`** mode enforces exact OASIS spec CKR codes (not just "any error")
100
+ - **Wycheproof + ACVP vectors** — cross-verification against C2SP and NIST test vectors
101
+
102
+ ## Documentation
103
+
104
+ - `docs/architecture.md` — codebase structure and test writing guide
105
+ - `docs/commands.md` — build, test, and Docker commands
106
+ - `docs/module-issues.md` — per-module bugs and quirks
107
+ - `docs/mechanism-output-parameters.md` — generated IV/nonce/tag output-parameter coverage
108
+ - `docs/docker-provider-results.md` — release Docker provider source and result snapshot
109
+ - `docs/todo.md` — public roadmap and known limitations
110
+ - `docs/cve-regression.md` — CVE coverage tracker
111
+ - `docs/file-isolation.md` — isolation runner design
112
+ - `docs/docker-artifacts.md` — Docker test runner contract
113
+
114
+ ## License
115
+
116
+ Licensed under either of
117
+
118
+ - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
119
+ - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
120
+
121
+ at your option.
122
+
123
+ ### Third-party attributions
124
+
125
+ pkcs11-check bundles the public-domain PKCS#11 v3.2 header from
126
+ `latchset/pkcs11-headers`, and its `fetch-data` command downloads test
127
+ vectors from C2SP and NIST. See
128
+ [`THIRD_PARTY_LICENSES.md`](THIRD_PARTY_LICENSES.md) for the full list and
129
+ per-source license terms.