python-nss-ng 1.0.2__tar.gz → 1.0.5__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 (130) hide show
  1. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/Makefile +17 -6
  2. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/PKG-INFO +6 -6
  3. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/QUICKSTART.md +3 -3
  4. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/README.md +5 -5
  5. python_nss_ng-1.0.5/REUSE.toml +39 -0
  6. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/ChangeLog +13 -13
  7. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/MIGRATION.md +5 -5
  8. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/cert_dump.py +3 -7
  9. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/cert_trust.py +4 -3
  10. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/httplib_example.py +19 -9
  11. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/pbkdf2_example.py +5 -4
  12. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/ssl_cipher_info.py +5 -4
  13. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/ssl_example.py +17 -6
  14. python_nss_ng-1.0.5/doc/examples/ssl_version_range.py +127 -0
  15. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/verify_cert.py +6 -6
  16. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/examples/verify_server.py +2 -5
  17. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/pyproject.toml +91 -6
  18. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/pyrightconfig.json +4 -2
  19. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/__init__.py +5 -5
  20. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/io.pyi +66 -58
  21. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/nss.pyi +496 -120
  22. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_nspr_common.h +3 -3
  23. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_nss.c +4 -0
  24. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/ssl.pyi +75 -46
  25. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/conftest.py +40 -47
  26. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/exceptions.py +11 -7
  27. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/run_tests +3 -0
  28. python_nss_ng-1.0.5/test/setup_certs.py +692 -0
  29. python_nss_ng-1.0.5/test/test_cert_components.py +343 -0
  30. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_cert_request.py +14 -13
  31. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_certificate_advanced.py +54 -63
  32. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_cipher.py +28 -23
  33. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_client_server.py +70 -46
  34. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_deprecations.py +8 -8
  35. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_digest.py +55 -45
  36. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_documentation_accuracy.py +68 -113
  37. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_examples.py +79 -79
  38. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_misc.py +10 -9
  39. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_performance.py +29 -18
  40. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_pkcs12.py +95 -69
  41. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_platform_specific.py +58 -60
  42. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_property_based.py +22 -19
  43. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_secure_logging.py +17 -21
  44. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_security.py +44 -38
  45. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_thread_safety.py +23 -26
  46. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_type_hints.py +64 -62
  47. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_util.py +28 -34
  48. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_zzz_error_messages.py +47 -39
  49. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_zzz_integration.py +29 -38
  50. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_zzz_nonexistent_certs.py +8 -7
  51. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_zzz_nss_context.py +35 -38
  52. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/test_zzz_ocsp.py +15 -12
  53. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/test/util.py +19 -11
  54. python_nss_ng-1.0.5/typings/nss/__init__.pyi +9 -0
  55. python_nss_ng-1.0.5/typings/nss/error.pyi +109 -0
  56. python_nss_ng-1.0.5/typings/nss/io.pyi +551 -0
  57. python_nss_ng-1.0.5/typings/nss/nss.pyi +1423 -0
  58. python_nss_ng-1.0.5/typings/nss/ssl.pyi +681 -0
  59. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/uv.lock +169 -145
  60. python_nss_ng-1.0.2/REUSE.toml +0 -18
  61. python_nss_ng-1.0.2/doc/examples/ssl_version_range.py +0 -120
  62. python_nss_ng-1.0.2/test/setup_certs.py +0 -623
  63. python_nss_ng-1.0.2/test/test_cert_components.py +0 -330
  64. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/.clangd +0 -0
  65. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/CONTRIBUTING.md +0 -0
  66. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/LICENSE +0 -0
  67. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/LICENSE.gpl +0 -0
  68. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/LICENSE.lgpl +0 -0
  69. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/LICENSE.mpl +0 -0
  70. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/LICENSES/Apache-2.0.txt +0 -0
  71. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/LICENSES/MPL-2.0.txt +0 -0
  72. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/MANIFEST.in +0 -0
  73. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/MAKEFILE_MIGRATION.md +0 -0
  74. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/MANYLINUX_CONFIG.md +0 -0
  75. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/MUTATION_TESTING.md +0 -0
  76. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/TESTING.md +0 -0
  77. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/doc/get_api +0 -0
  78. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/meson.build +0 -0
  79. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/pyproject.toml +0 -0
  80. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/src/deprecations.py +0 -0
  81. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/src/deprecations.py.meta +0 -0
  82. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/src/nss_context.py +0 -0
  83. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/src/nss_context.py.meta +0 -0
  84. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/src/secure_logging.py +0 -0
  85. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/src/secure_logging.py.meta +0 -0
  86. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/conftest.py +0 -0
  87. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/exceptions.py +0 -0
  88. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/run_tests +0 -0
  89. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/setup_certs.py +0 -0
  90. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_cert_components.py +0 -0
  91. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_cert_request.py +0 -0
  92. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_certificate_advanced.py +0 -0
  93. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_cipher.py +0 -0
  94. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_client_server.py +0 -0
  95. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_deprecations.py +0 -0
  96. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_digest.py +0 -0
  97. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_documentation_accuracy.py +0 -0
  98. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_error_messages.py +0 -0
  99. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_examples.py +0 -0
  100. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_integration.py +0 -0
  101. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_misc.py +0 -0
  102. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_nss_context.py +0 -0
  103. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_ocsp.py +0 -0
  104. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_performance.py +0 -0
  105. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_pkcs12.py +0 -0
  106. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_platform_specific.py +0 -0
  107. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_property_based.py +0 -0
  108. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_secure_logging.py +0 -0
  109. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_security.py +0 -0
  110. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_thread_safety.py +0 -0
  111. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_type_hints.py +0 -0
  112. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/test_util.py +0 -0
  113. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/mutants/test/util.py +0 -0
  114. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/scripts/README.md +0 -0
  115. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/scripts/run-all-tests.sh +0 -0
  116. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/NSPRerrs.h +0 -0
  117. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/SECerrs.h +0 -0
  118. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/SSLerrs.h +0 -0
  119. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/deprecations.py +0 -0
  120. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/nss_context.py +0 -0
  121. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_nspr_error.c +0 -0
  122. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_nspr_error.h +0 -0
  123. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_nspr_io.c +0 -0
  124. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_nspr_io.h +0 -0
  125. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_nss.h +0 -0
  126. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_shared_doc.h +0 -0
  127. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_ssl.c +0 -0
  128. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_ssl.h +0 -0
  129. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/py_traceback.h +0 -0
  130. {python_nss_ng-1.0.2 → python_nss_ng-1.0.5}/src/secure_logging.py +0 -0
@@ -4,8 +4,8 @@
4
4
  # Makefile for python-nss-ng
5
5
  # Handles NSS/NSPR dependencies and environment setup for CI builds
6
6
 
7
- .PHONY: help deps-nss deps-test deps-build clean env-setup \
8
- env-github-actions
7
+ .PHONY: help deps-nss deps-test deps-test-system deps-build clean \
8
+ env-setup env-github-actions
9
9
 
10
10
  # Default target
11
11
  help:
@@ -13,7 +13,8 @@ help:
13
13
  @echo ""
14
14
  @echo "Targets:"
15
15
  @echo " deps-nss - Build and install NSS/NSPR from source"
16
- @echo " deps-test - Install test dependencies (meson/ninja)"
16
+ @echo " deps-test-system - Install system test deps (apt only)"
17
+ @echo " deps-test - Install all test dependencies (apt+pip)"
17
18
  @echo " deps-build - Install build dependencies"
18
19
  @echo " env-setup - Set up environment variables"
19
20
  @echo " env-github-actions - Export env vars to GitHub Actions"
@@ -50,13 +51,23 @@ deps-nss:
50
51
  INSTALL_PREFIX=$(INSTALL_PREFIX) \
51
52
  ./.github/scripts/install-nss.sh
52
53
 
53
- # Install test dependencies (for test jobs)
54
- deps-test:
55
- @echo "Installing test dependencies..."
54
+ # Install system-level test dependencies only (apt packages)
55
+ # Use this target in CI *before* actions/setup-python so that pip installs
56
+ # are handled by the correct (hostedtoolcache) Python interpreter.
57
+ deps-test-system:
58
+ @echo "Installing system-level test dependencies..."
56
59
  ifeq ($(PLATFORM),linux)
57
60
  sudo apt-get update || true
58
61
  sudo apt-get install -y meson ninja-build || true
59
62
  endif
63
+
64
+ # Install test dependencies (for test jobs)
65
+ # NOTE: This target runs pip install and should only be called *after*
66
+ # actions/setup-python so that packages are installed into the correct
67
+ # Python environment. If called with the system Python when a different
68
+ # Python will run the tests, imports will fail at test time.
69
+ deps-test: deps-test-system
70
+ @echo "Installing pip test dependencies..."
60
71
  python -m pip install --upgrade pip || true
61
72
  python -m pip install meson-python meson ninja pytest pytest-cov pytest-timeout pytest-xdist hypothesis mypy || true
62
73
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-nss-ng
3
- Version: 1.0.2
3
+ Version: 1.0.5
4
4
  Summary: Python bindings for Network Security Services (NSS) and Netscape Portable Runtime (NSPR)
5
5
  Keywords: nss,nspr,cryptography,ssl,tls,pki,x509,security
6
6
  Author-Email: John Dennis <jdennis@redhat.com>, Matthew Watkins <mwatkins@linuxfoundation.org>
@@ -64,7 +64,7 @@ SPDX-FileCopyrightText: 2025 The Linux Foundation
64
64
 
65
65
  [![Platform Compatibility](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/compatibility.yaml/badge.svg)](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/compatibility.yaml)
66
66
  [![CI/CD Pipeline](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/build-test.yaml/badge.svg)](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/build-test.yaml)
67
- [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
67
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
68
68
  [![License: MPL-2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
69
69
 
70
70
  Python bindings for Network Security Services (NSS) and Netscape Portable
@@ -99,7 +99,7 @@ and build standards:
99
99
 
100
100
  ### Changes Made
101
101
 
102
- - **Python Support**: Now supports Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14
102
+ - **Python Support**: Now supports Python 3.10, 3.11, 3.12, 3.13, and 3.14
103
103
  - **Build System**: Migrated from legacy `distutils` to modern `setuptools`
104
104
  with `pyproject.toml`
105
105
  - **Version Management**: Implemented dynamic versioning using
@@ -124,7 +124,7 @@ works with NSS 3.117.
124
124
 
125
125
  - NSS 3.117
126
126
  - NSPR 4.38.2
127
- - Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
127
+ - Python 3.10, 3.11, 3.12, 3.13, 3.14
128
128
 
129
129
  ## System Requirements
130
130
 
@@ -156,8 +156,8 @@ brew install nss nspr
156
156
  ### Using uv (Recommended)
157
157
 
158
158
  ```bash
159
- # Create a virtual environment with Python 3.9+
160
- uv venv --python 3.9
159
+ # Create a virtual environment with Python 3.10+
160
+ uv venv --python 3.10
161
161
 
162
162
  # Activate the environment
163
163
  source .venv/bin/activate # Linux/macOS
@@ -34,7 +34,7 @@ brew install nss nspr pkg-config
34
34
 
35
35
  ### Python Requirements
36
36
 
37
- - Python 3.9 or later
37
+ - Python 3.10 or later
38
38
  - pip or uv package manager
39
39
 
40
40
  ## Quick Setup
@@ -50,7 +50,7 @@ git clone https://github.com/ModeSevenIndustrialSolutions/python-nss-ng.git
50
50
  cd python-nss-ng
51
51
 
52
52
  # Create virtual environment and install dependencies
53
- uv venv --python 3.9
53
+ uv venv --python 3.10
54
54
  source .venv/bin/activate # Linux/macOS
55
55
  # or
56
56
  .venv\Scripts\activate # Windows
@@ -78,7 +78,7 @@ pip install -e ".[dev]"
78
78
 
79
79
  ```bash
80
80
  # Check Python version
81
- python --version # Should be 3.9+
81
+ python --version # Should be 3.10+
82
82
 
83
83
  # Check NSS/NSPR installation
84
84
  pkg-config --modversion nss
@@ -7,7 +7,7 @@ SPDX-FileCopyrightText: 2025 The Linux Foundation
7
7
 
8
8
  [![Platform Compatibility](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/compatibility.yaml/badge.svg)](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/compatibility.yaml)
9
9
  [![CI/CD Pipeline](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/build-test.yaml/badge.svg)](https://github.com/ModeSevenIndustrialSolutions/python-nss-ng/actions/workflows/build-test.yaml)
10
- [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
10
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
11
11
  [![License: MPL-2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
12
12
 
13
13
  Python bindings for Network Security Services (NSS) and Netscape Portable
@@ -42,7 +42,7 @@ and build standards:
42
42
 
43
43
  ### Changes Made
44
44
 
45
- - **Python Support**: Now supports Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14
45
+ - **Python Support**: Now supports Python 3.10, 3.11, 3.12, 3.13, and 3.14
46
46
  - **Build System**: Migrated from legacy `distutils` to modern `setuptools`
47
47
  with `pyproject.toml`
48
48
  - **Version Management**: Implemented dynamic versioning using
@@ -67,7 +67,7 @@ works with NSS 3.117.
67
67
 
68
68
  - NSS 3.117
69
69
  - NSPR 4.38.2
70
- - Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
70
+ - Python 3.10, 3.11, 3.12, 3.13, 3.14
71
71
 
72
72
  ## System Requirements
73
73
 
@@ -99,8 +99,8 @@ brew install nss nspr
99
99
  ### Using uv (Recommended)
100
100
 
101
101
  ```bash
102
- # Create a virtual environment with Python 3.9+
103
- uv venv --python 3.9
102
+ # Create a virtual environment with Python 3.10+
103
+ uv venv --python 3.10
104
104
 
105
105
  # Activate the environment
106
106
  source .venv/bin/activate # Linux/macOS
@@ -0,0 +1,39 @@
1
+ version = 1
2
+
3
+ # SPDX-License-Identifier: MPL-2.0
4
+ # SPDX-FileCopyrightText: 2025 The Linux Foundation
5
+
6
+ # Licensing statement required for GHA tests and linting to pass for only this repository
7
+
8
+ [[annotations]]
9
+ path = [
10
+ "test/pki/**",
11
+ "uv.lock",
12
+ "tests/dist/**",
13
+ "img/**",
14
+ "*.lock",
15
+ "test_coverage_report*"
16
+ ]
17
+ SPDX-License-Identifier = "MPL-2.0"
18
+ SPDX-FileCopyrightText = "2025 The Linux Foundation"
19
+
20
+ # Project configuration files and ancillary documentation that
21
+ # cannot easily carry inline SPDX headers.
22
+ [[annotations]]
23
+ path = [
24
+ "pyrightconfig.json",
25
+ "scripts/README.md",
26
+ "doc/ChangeLog",
27
+ ]
28
+ SPDX-License-Identifier = "MPL-2.0"
29
+ SPDX-FileCopyrightText = "Copyright (c) 2010-2025 python-nss-ng contributors"
30
+
31
+ # Mutation testing artifacts produced by mutmut. These are generated
32
+ # files (mutated source copies and metadata) and inherit the license
33
+ # of the source they were produced from.
34
+ [[annotations]]
35
+ path = [
36
+ "mutants/**",
37
+ ]
38
+ SPDX-License-Identifier = "MPL-2.0"
39
+ SPDX-FileCopyrightText = "Copyright (c) 2010-2025 python-nss-ng contributors"
@@ -365,7 +365,7 @@
365
365
  password file and writes hardcoded responses to the stdin of
366
366
  certuil and modutil.
367
367
 
368
- * setup_certs now creates a new sql sytle NSS database (sql:pki)
368
+ * setup_certs now creates a new sql style NSS database (sql:pki)
369
369
 
370
370
  * All tests and examples now load the sql:pki database. Command line
371
371
  arg and variable changed from dbdir to db_name to reflect the
@@ -380,11 +380,11 @@
380
380
  External Changes
381
381
  ----------------
382
382
 
383
- The primary enhancements in this version is support of certifcate
383
+ The primary enhancements in this version is support of certificate
384
384
  validation, OCSP support, and support for the certificate "Authority
385
385
  Information Access" extension.
386
386
 
387
- Enhanced certifcate validation including CA certs can be done via
387
+ Enhanced certificate validation including CA certs can be done via
388
388
  Certificate.verify() or Certificate.is_ca_cert(). When cert
389
389
  validation fails you can now obtain diagnostic information as to why
390
390
  the cert failed to validate. This is encapsulated in the
@@ -575,7 +575,7 @@
575
575
  * For NSS >= 3.13 support CERTDB_TERMINAL_RECORD
576
576
 
577
577
  * You can now query for a specific certificate extension
578
- Certficate.get_extension()
578
+ Certificate.get_extension()
579
579
 
580
580
  * The following classes were added:
581
581
  - RSAGenParams
@@ -594,14 +594,14 @@
594
594
  - SecItem_new_alloc()
595
595
 
596
596
  * The following class constructors were modified to accept
597
- intialization parameters
597
+ initialization parameters
598
598
 
599
599
  - KEYPQGParams (DSA generation parameters)
600
600
 
601
601
  * The PublicKey formatting (i.e. format_lines) was augmented
602
602
  to format DSA keys (formerly it only recognized RSA keys).
603
603
 
604
- * Allow lables and values to be justified when printing objects
604
+ * Allow labels and values to be justified when printing objects
605
605
 
606
606
  * The following were deprecated:
607
607
  - nss.nss.make_line_pairs (replaced by nss.nss.make_line_fmt_tuples)
@@ -609,12 +609,12 @@
609
609
  Deprecated Functionality:
610
610
  -------------------------
611
611
  - make_line_pairs() has been replaced by make_line_fmt_tuples()
612
- because 2-valued tuples were not sufficently general. It is
612
+ because 2-valued tuples were not sufficiently general. It is
613
613
  expected very few programs will have used this function, it's mostly
614
614
  used internally but provided as a support utility.
615
615
 
616
616
  2011-04-22 John Dennis <jdennis@redhat.com> 0.12
617
- * Major new enhancement is additon of PKCS12 support and
617
+ * Major new enhancement is addition of PKCS12 support and
618
618
  AlgorithmID's.
619
619
 
620
620
  * setup.py build enhancements
@@ -757,7 +757,7 @@
757
757
  optional family parameter. This is necessary for utilizing
758
758
  PR_GetAddrInfoByName().
759
759
 
760
- * NetworkAddress initialized via a string paramter are now initalized via
760
+ * NetworkAddress initialized via a string parameter are now initialized via
761
761
  PR_GetAddrInfoByName using family.
762
762
 
763
763
  * Add NetworkAddress.address property to return the address sans the
@@ -785,7 +785,7 @@
785
785
  Deprecated Functionality:
786
786
  -------------------------
787
787
 
788
- * NetworkAddress initialized via a string paramter is now
788
+ * NetworkAddress initialized via a string parameter is now
789
789
  deprecated. AddrInfo should be used instead.
790
790
 
791
791
  * NetworkAddress.set_from_string is now deprecated. AddrInfo should be
@@ -793,7 +793,7 @@
793
793
 
794
794
  * NetworkAddress.hostentry is deprecated. It was a bad idea,
795
795
  NetworkAddress objects can support both IPv4 and IPv6, but a HostEntry
796
- object can only support IPv4. Plus the implementation depdended on
796
+ object can only support IPv4. Plus the implementation depended on
797
797
  being able to perform a reverse DNS lookup which is not always
798
798
  possible.
799
799
 
@@ -806,7 +806,7 @@
806
806
  Internal Changes:
807
807
  -----------------
808
808
 
809
- * Utilize PR_NetAddrFamily() access macro instead of explict access.
809
+ * Utilize PR_NetAddrFamily() access macro instead of explicit access.
810
810
 
811
811
  * Add PRNetAddr_port() utility to hide host vs. network byte order
812
812
  requirements when accessing the port inside a PRNetAddr and simplify
@@ -925,7 +925,7 @@
925
925
  nss.nss.x509_key_usage()
926
926
 
927
927
  * The following class methods and properties were added:
928
- Note: it's a method if the name is suffixed with (), a propety otherwise
928
+ Note: it's a method if the name is suffixed with (), a property otherwise
929
929
  Socket.next()
930
930
  Socket.readlines()
931
931
  Socket.sendall()
@@ -13,7 +13,7 @@ project to bring it up to current Python packaging standards (2025).
13
13
  The python-nss-ng project was originally built with the legacy
14
14
  `distutils` build system. This migration updates the project to:
15
15
 
16
- - Support Python 3.9+ (3.9, 3.10, 3.11, 3.12, 3.13, 3.14)
16
+ - Support Python 3.10+ (3.10, 3.11, 3.12, 3.13, 3.14)
17
17
  - Use modern packaging standards (PEP 517, PEP 518, PEP 621)
18
18
  - Use dynamic versioning from git tags
19
19
  - Support modern development tools (uv, pytest, ruff)
@@ -53,7 +53,7 @@ build-backend = "setuptools.build_meta"
53
53
  [project]
54
54
  name = "python-nss-ng"
55
55
  dynamic = ["version"]
56
- requires-python = ">=3.9"
56
+ requires-python = ">=3.10"
57
57
  # ... modern metadata
58
58
  ```
59
59
 
@@ -155,7 +155,7 @@ dev = [
155
155
 
156
156
  #### Modern Support
157
157
 
158
- - Explicit support: Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14
158
+ - Explicit support: Python 3.10, 3.11, 3.12, 3.13, 3.14
159
159
  - Modern `setuptools` build backend
160
160
  - Compatible with PEP 517/518 build frontends (pip, build, uv)
161
161
 
@@ -270,7 +270,7 @@ branch = true
270
270
 
271
271
  ```bash
272
272
  # Development environment
273
- uv venv --python 3.9
273
+ uv venv --python 3.10
274
274
  source .venv/bin/activate
275
275
  uv pip install -e ".[dev]"
276
276
  ```
@@ -293,7 +293,7 @@ python -m build
293
293
 
294
294
  ### Breaking Changes
295
295
 
296
- - **Lower Bound Python version**: Now requires Python 3.9+
296
+ - **Lower Bound Python version**: Now requires Python 3.10+
297
297
  - **Build system**: `python setup.py install` no longer recommended
298
298
  - **Import changes**: None (backward compatible)
299
299
 
@@ -1,6 +1,8 @@
1
1
  # This Source Code Form is subject to the terms of the Mozilla Public
2
2
  # License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
+ # SPDX-License-Identifier: MPL-2.0
5
+ # SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
4
6
 
5
7
  '''
6
8
  This example will pretty print the contents of a certificate loaded from a
@@ -15,18 +17,12 @@ print "Certificate is %s" % cert
15
17
  What this example really aims to do is illustrate how to access the various
16
18
  components of a cert.
17
19
  '''
18
- from __future__ import absolute_import
19
- from __future__ import print_function
20
20
 
21
21
  import argparse
22
- import getpass
23
- import os
24
- import sys
25
22
 
26
- from nss.error import NSPRError
27
- import nss.io as io
28
23
  import nss.nss as nss
29
24
 
25
+
30
26
  # -----------------------------------------------------------------------------
31
27
  def print_extension(level, extension):
32
28
  print(nss.indented_format([(level, 'Name: %s' % extension.name),
@@ -1,11 +1,12 @@
1
- from __future__ import absolute_import
2
- from __future__ import print_function
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
3
+
3
4
 
4
5
  import argparse
5
6
  import sys
6
7
  from typing import Any
8
+
7
9
  import nss.nss as nss
8
- import nss.error as nss_error
9
10
 
10
11
  # Sample program that illustrates how to access certificate trust and/or
11
12
  # modify a certificates trust setting.
@@ -1,21 +1,31 @@
1
- from __future__ import absolute_import
2
- from __future__ import print_function
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
3
3
 
4
4
  # This Source Code Form is subject to the terms of the Mozilla Public
5
5
  # License, v. 2.0. If a copy of the MPL was not distributed with this
6
6
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
7
 
8
+ # This example predates Python 3 and demonstrates NSS HTTPS usage by
9
+ # subclassing the long-removed ``httplib.HTTP`` class via ``six``. It
10
+ # also performs ``int()`` / host-string coercions that the static
11
+ # type system cannot prove safe. Static type checking of this file
12
+ # is intentionally relaxed so the example can remain available as
13
+ # historical documentation without requiring a full Py3 rewrite.
14
+ #
15
+ # pyright: reportAttributeAccessIssue=false, reportArgumentType=false, reportMissingImports=false
16
+
8
17
  import argparse
9
18
  import errno
10
19
  import getpass
11
- import six.moves.http_client # type: ignore[import-untyped]
12
20
  import logging
13
21
  import sys
22
+
23
+ import six.moves.http_client # type: ignore[import-untyped,unused-ignore]
24
+
14
25
  try:
15
26
  import urlparse
16
27
  except ImportError:
17
28
  import urllib.parse as urlparse
18
- from nss.error import NSPRError
19
29
  import nss.io as io
20
30
  import nss.nss as nss
21
31
  import nss.ssl as ssl
@@ -91,7 +101,7 @@ def auth_certificate_callback(sock, check_sig, is_server, certdb):
91
101
 
92
102
  def password_callback(slot, retry, password):
93
103
  if not retry and password: return password
94
- return getpass.getpass("Enter password for %s: " % slot.token_name);
104
+ return getpass.getpass("Enter password for %s: " % slot.token_name)
95
105
 
96
106
  def handshake_callback(sock):
97
107
  """
@@ -133,7 +143,7 @@ class NSSConnection(six.moves.http_client.HTTPConnection):
133
143
  logging.debug("connect: host=%s port=%s", self.host, self.port)
134
144
  try:
135
145
  addr_info = io.AddrInfo(self.host)
136
- except Exception as e:
146
+ except Exception:
137
147
  logging.error("could not resolve host address \"%s\"", self.host)
138
148
  raise
139
149
 
@@ -148,7 +158,7 @@ class NSSConnection(six.moves.http_client.HTTPConnection):
148
158
  except Exception as e:
149
159
  logging.debug("connect failed: %s (%s)", net_addr, e)
150
160
 
151
- raise IOError(errno.ENOTCONN, "could not connect to %s at port %d" % (self.host, self.port))
161
+ raise OSError(errno.ENOTCONN, "could not connect to %s at port %d" % (self.host, self.port))
152
162
 
153
163
  class NSPRConnection(six.moves.http_client.HTTPConnection):
154
164
  default_port = six.moves.http_client.HTTPConnection.default_port
@@ -164,7 +174,7 @@ class NSPRConnection(six.moves.http_client.HTTPConnection):
164
174
  logging.debug("connect: host=%s port=%s", self.host, self.port)
165
175
  try:
166
176
  addr_info = io.AddrInfo(self.host)
167
- except Exception as e:
177
+ except Exception:
168
178
  logging.error("could not resolve host address \"%s\"", self.host)
169
179
  raise
170
180
 
@@ -179,7 +189,7 @@ class NSPRConnection(six.moves.http_client.HTTPConnection):
179
189
  except Exception as e:
180
190
  logging.debug("connect failed: %s (%s)", net_addr, e)
181
191
 
182
- raise IOError(errno.ENOTCONN, "could not connect to %s at port %d" % (self.host, self.port))
192
+ raise OSError(errno.ENOTCONN, "could not connect to %s at port %d" % (self.host, self.port))
183
193
 
184
194
  class NSSHTTPS(six.moves.http_client.HTTP):
185
195
  _http_vsn = 11
@@ -1,14 +1,15 @@
1
- from __future__ import absolute_import
2
- from __future__ import print_function
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
3
+
3
4
 
4
5
  import argparse
5
6
  import sys
6
7
  from typing import Any
7
8
 
8
9
  import nss.nss as nss
9
- import nss.error as nss_error
10
+
10
11
  print(sys.path)
11
- import six # type: ignore[import-untyped]
12
+ import six # type: ignore[import-untyped,unused-ignore]
12
13
 
13
14
  #-------------------------------------------------------------------------------
14
15
 
@@ -1,13 +1,14 @@
1
- from __future__ import absolute_import
2
- from __future__ import print_function
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
3
+
3
4
 
4
5
  import argparse
5
6
  import sys
6
7
 
7
- from nss.error import NSPRError
8
8
  import nss.io as io
9
9
  import nss.nss as nss
10
10
  import nss.ssl as ssl
11
+ from nss.error import NSPRError
11
12
 
12
13
  #-------------------------------------------------------------------------------
13
14
 
@@ -105,7 +106,7 @@ def ssl_connect():
105
106
  try:
106
107
  sock.set_ssl_version_range("tls1.0", "tls1.3")
107
108
  except NSPRError as e:
108
- print("Cannot enable TLS 1.3, {}".format(e))
109
+ print(f"Cannot enable TLS 1.3, {e}")
109
110
 
110
111
  # Provide a callback which notifies us when the SSL handshake is
111
112
  # complete
@@ -1,11 +1,22 @@
1
- from __future__ import absolute_import
2
- from __future__ import print_function
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # SPDX-FileCopyrightText: Copyright (c) 2010-2025 python-nss-ng contributors
3
+
4
+ # This example predates Python 3 in places: it imports a plain TCP
5
+ # socket via ``io.Socket.import_tcp_socket`` and assigns the result
6
+ # back into an ``ssl.SSLSocket``-typed variable, and similarly mixes
7
+ # ``str`` and ``bytes`` payloads on send/recv. Modernising the code
8
+ # to satisfy strict mypy would change observable behaviour and is
9
+ # out of scope for the tooling sync.
10
+ #
11
+ # mypy: ignore-errors
12
+ # pyright: reportOptionalSubscript=false, reportAttributeAccessIssue=false, reportArgumentType=false, reportCallIssue=false
3
13
 
4
14
  # This Source Code Form is subject to the terms of the Mozilla Public
5
15
  # License, v. 2.0. If a copy of the MPL was not distributed with this
6
16
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
17
 
8
18
  import warnings
19
+
9
20
  warnings.simplefilter( "always", DeprecationWarning)
10
21
 
11
22
  import argparse
@@ -13,10 +24,10 @@ import getpass
13
24
  import os
14
25
  import sys
15
26
 
16
- from nss.error import NSPRError
17
27
  import nss.io as io
18
28
  import nss.nss as nss
19
29
  import nss.ssl as ssl
30
+ from nss.error import NSPRError
20
31
 
21
32
  # -----------------------------------------------------------------------------
22
33
  NO_CLIENT_CERT = 0
@@ -38,7 +49,7 @@ timeout_secs = 3
38
49
 
39
50
  def password_callback(slot, retry, password):
40
51
  if password: return password
41
- return getpass.getpass("Enter password: ");
52
+ return getpass.getpass("Enter password: ")
42
53
 
43
54
  def handshake_callback(sock):
44
55
  print("-- handshake complete --")
@@ -145,7 +156,7 @@ def Client():
145
156
  # Get the IP Address of our server
146
157
  try:
147
158
  addr_info = io.AddrInfo(options.hostname)
148
- except Exception as e:
159
+ except Exception:
149
160
  print("could not resolve host address \"%s\"" % options.hostname)
150
161
  return
151
162
 
@@ -243,7 +254,7 @@ def Server():
243
254
  # Get our certificate and private key
244
255
  server_cert = nss.find_cert_from_nickname(options.server_nickname, options.password)
245
256
  priv_key = nss.find_key_by_any_cert(server_cert, options.password)
246
- server_cert_kea = server_cert.find_kea_type();
257
+ server_cert_kea = server_cert.find_kea_type()
247
258
 
248
259
  print("server cert:\n%s" % server_cert)
249
260