Compare commits

...

32 Commits

Author SHA256 Message Date
Ana Guerrero
d270246030 Accepting request 1221503 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1221503
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=15
2024-11-06 15:50:03 +00:00
Dominique Leuenberger
548f2ef935 Accepting request 1196403 from devel:languages:python
- Add patch add-aki-to-child-certs.patch
  * Also add Authority Key Identifiers to children certs.

OBS-URL: https://build.opensuse.org/request/show/1196403
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=14
2024-08-29 13:42:49 +00:00
Steve Kowalik
bf5e92b161 - Add patch add-aki-to-child-certs.patch
* Also add Authority Key Identifiers to children certs.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=29
2024-08-28 06:39:24 +00:00
Dominique Leuenberger
7faeea4dee Accepting request 1154940 from devel:languages:python
- Switch to pyproject and autosetup macros.

OBS-URL: https://build.opensuse.org/request/show/1154940
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=13
2024-03-06 22:03:10 +00:00
Steve Kowalik
1b2d56b090 - Switch to pyproject and autosetup macros.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=27
2024-03-05 02:53:04 +00:00
Ana Guerrero
888381edf8 Accepting request 1109513 from devel:languages:python
- update to 1.1.0:
  * Allow `os.PathLike` in typing of `Blob.write_to_path`
  * Add support for PyPy 3.10 and Python 3.12
  * Remove support for Python 3.7
- drop python 2.x specific conditionals from spec file

  * Support for Python 3.10 and 3.11 (#372, 574)
    trustme``. Get the help with ``python -m trustme --help``.
  * Added attr CA.from_pem to import an existing certificate authority;
- initial package

OBS-URL: https://build.opensuse.org/request/show/1109513
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=12
2023-09-08 19:14:59 +00:00
335c0b425d - drop python 2.x specific conditionals from spec file
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=25
2023-09-07 11:04:24 +00:00
9210c1eb06 - update to 1.1.0:
* Allow `os.PathLike` in typing of `Blob.write_to_path`
  * Add support for PyPy 3.10 and Python 3.12
  * Remove support for Python 3.7
  * Support for Python 3.10 and 3.11 (#372, 574)
    trustme``. Get the help with ``python -m trustme --help``.
  * Added attr CA.from_pem to import an existing certificate authority;
- initial package

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=24
2023-09-07 11:04:09 +00:00
Dominique Leuenberger
758ff91e3d Accepting request 1088141 from devel:languages:python
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1088141
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=11
2023-05-22 11:14:13 +00:00
09830c201e - update to 1.0.0:
* Support for ECDSA keys in certificates and use them by default.
    The type of key used for certificates can be controlled by the
    key_type parameter on the multiple methods that generate
    certificates. ECDSA certificates as they can be generated
    significantly faster.
  * Support for Python 3.10 and 3.11 (#372, 574)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=22
2023-05-14 16:35:07 +00:00
Dominique Leuenberger
bb8bd7a21d Accepting request 1081733 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1081733
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=10
2023-04-22 19:58:17 +00:00
e7f0c5f65d Accepting request 1081674 from home:dirkmueller:acdc:as_python3_module
SR for python stack proposal

OBS-URL: https://build.opensuse.org/request/show/1081674
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=20
2023-04-21 13:29:53 +00:00
Dominique Leuenberger
d41b430602 Accepting request 1058771 from devel:languages:python
- Clean up SPEC file
- Add fix2038.patch to allow tests of python-aiosmtplib to pass after 2038

OBS-URL: https://build.opensuse.org/request/show/1058771
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=9
2023-01-18 12:08:11 +00:00
f6da47d308 - Clean up SPEC file
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=18
2023-01-16 21:04:28 +00:00
8729bbe2c0 Accepting request 1058352 from home:bmwiedemann:reproducible:test
Add fix2038.patch to allow tests of python-aiosmtplib to pass after 2038

OBS-URL: https://build.opensuse.org/request/show/1058352
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=17
2023-01-16 21:00:29 +00:00
Dominique Leuenberger
4f6112c02b Accepting request 915528 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/915528
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=8
2021-09-04 20:32:02 +00:00
c2d45b9828 Accepting request 915093 from home:glaubitz:branches:devel:languages:python
- Update to 0.9.0
  * Bump types-cryptography from 3.3.3 to 3.3.5 (#342)
  * Bump types-pyopenssl from 20.0.4 to 20.0.5 (#343)
  * Add type annotations (#341)
  * Bump charset-normalizer from 2.0.3 to 2.0.4 (#340)
  * Bump sphinx from 4.1.1 to 4.1.2
  * Bump charset-normalizer from 2.0.2 to 2.0.3
  * Bump idna from 2.10 to 3.2
  * Bump sphinx from 4.1.0 to 4.1.1
  * Bump charset-normalizer from 2.0.1 to 2.0.2
  * Bump requests from 2.25.1 to 2.26.0 (#333)
  * Bump sphinx from 4.0.2 to 4.1.0
  * Bump urllib3 from 1.26.5 to 1.26.6
  * Bump version to v0.8.0+dev
- from version 0.8.0
  * retry codecov more
  * try codecov harder
  * require codecov in ci
  * Update tests/test_trustme.py
  * close the wrapped sockets to prevent Unraisable ResourceWarnings
  * Adjust tests
  * py3.10 needs a new version of pytest
  * Set correct KU and EKU extensions
  * test on py 3.10
  * Bump pytest-cov from 2.12.0 to 2.12.1
  * Bump certifi from 2020.12.5 to 2021.5.30
  * Bump urllib3 from 1.26.4 to 1.26.5
  * Bump sphinxcontrib-htmlhelp from 1.0.3 to 2.0.0
  * Bump sphinxcontrib-serializinghtml from 1.1.4 to 1.1.5
  * Bump jinja2 from 2.11.3 to 3.0.1

OBS-URL: https://build.opensuse.org/request/show/915093
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=16
2021-09-01 18:43:29 +00:00
Dominique Leuenberger
bb0990f49e Accepting request 891896 from devel:languages:python
- update to 0.7.0:
  - trustme can now be used a command line interface with ``python -m
    trustme``. Get the help with ``python -m trustme --help``.

OBS-URL: https://build.opensuse.org/request/show/891896
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=7
2021-05-12 17:31:21 +00:00
91a571c843 - update to 0.7.0:
- trustme can now be used a command line interface with ``python -m
    trustme``. Get the help with ``python -m trustme --help``.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=14
2021-05-09 17:13:49 +00:00
Dominique Leuenberger
95ae89d8be Accepting request 784170 from devel:languages:python
- Fix build without python2

OBS-URL: https://build.opensuse.org/request/show/784170
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=6
2020-03-26 23:21:16 +00:00
Tomáš Chvátal
62408d85ba - Fix build without python2
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=12
2020-03-12 07:55:19 +00:00
Oliver Kurz
75815b3135 Accepting request 772472 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/772472
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=5
2020-02-14 15:25:12 +00:00
Tomáš Chvátal
470ac40f02 Accepting request 772132 from home:mcalabkova:branches:devel:languages:python
- update to 0.6.0
  * Allow specifying organization and organization unit in CA and issued certs
  * Added attr CA.from_pem to import an existing certificate authority; 
    this allows migrating to trustme step-by-step.

OBS-URL: https://build.opensuse.org/request/show/772132
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=10
2020-02-09 10:12:53 +00:00
Dominique Leuenberger
11cb80bfd7 Accepting request 707622 from devel:languages:python
- update to 0.5.2
 * support cryptography-2.7

OBS-URL: https://build.opensuse.org/request/show/707622
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=4
2019-06-07 10:18:18 +00:00
a1a681bb5c - update to 0.5.2
* support cryptography-2.7

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=8
2019-06-04 14:20:24 +00:00
Dominique Leuenberger
7380db970e Accepting request 698096 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/698096
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=3
2019-05-03 20:35:21 +00:00
Tomáš Chvátal
c27168bf87 Accepting request 698078 from home:pgajdos
- version update to 0.5.1
  * Update key size to 2048 bits

OBS-URL: https://build.opensuse.org/request/show/698078
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=6
2019-04-26 08:33:38 +00:00
Dominique Leuenberger
c1f708c416 Accepting request 686322 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/686322
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=2
2019-03-29 19:35:57 +00:00
Tomáš Chvátal
a463f7601c Accepting request 686202 from home:jengelh:branches:devel:languages:python
- Replace nonsense summary. Trim storytelling write style
  from description.

OBS-URL: https://build.opensuse.org/request/show/686202
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=4
2019-03-19 08:32:06 +00:00
Dominique Leuenberger
1e88d735b7 Accepting request 679797 from devel:languages:python
ok

OBS-URL: https://build.opensuse.org/request/show/679797
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trustme?expand=0&rev=1
2019-02-27 16:29:36 +00:00
a154ab5611 ok
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=2
2019-02-27 12:39:38 +00:00
3ebdbbaf64 Accepting request 679790 from home:mimi_vx
ok

OBS-URL: https://build.opensuse.org/request/show/679790
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trustme?expand=0&rev=1
2019-02-27 11:50:55 +00:00
3 changed files with 0 additions and 116 deletions

View File

@ -1,96 +0,0 @@
From 84e347d9221e304f0158330e5101d23969d424d0 Mon Sep 17 00:00:00 2001
From: Illia Volochii <illia.volochii@gmail.com>
Date: Wed, 27 Mar 2024 11:45:41 +0000
Subject: [PATCH 1/3] Add AKI to child CA certificates
---
src/trustme/__init__.py | 14 +++++++++++---
tests/test_trustme.py | 5 +++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/trustme/__init__.py b/src/trustme/__init__.py
index 5fb24fb..0db1bb0 100644
--- a/src/trustme/__init__.py
+++ b/src/trustme/__init__.py
@@ -250,14 +250,22 @@ def __init__(
sign_key = parent_cert._private_key
parent_certificate = parent_cert._certificate
issuer = parent_certificate.subject
-
- self._certificate = (
+ ski_ext = parent_certificate.extensions.get_extension_for_class(
+ x509.SubjectKeyIdentifier)
+ aki = x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier(ski_ext.value)
+ else:
+ aki = None
+ cert_builder = (
_cert_builder_common(name, issuer, self._private_key.public_key())
.add_extension(
x509.BasicConstraints(ca=True, path_length=path_length),
critical=True,
)
- .add_extension(
+ )
+ if aki:
+ cert_builder = cert_builder.add_extension(aki, critical=False)
+ self._certificate = (
+ cert_builder.add_extension(
x509.KeyUsage(
digital_signature=True, # OCSP
content_commitment=False,
diff --git a/tests/test_trustme.py b/tests/test_trustme.py
index 1d901ad..581716e 100644
--- a/tests/test_trustme.py
+++ b/tests/test_trustme.py
@@ -200,6 +200,11 @@ def test_intermediate() -> None:
assert_is_ca(child_ca_cert)
assert child_ca_cert.issuer == ca_cert.subject
assert _path_length(child_ca_cert) == 8
+ aki = child_ca_cert.extensions.get_extension_for_class(x509.AuthorityKeyIdentifier)
+ assert aki.critical is False
+ expected_aki_key_id = ca_cert.extensions.get_extension_for_class(
+ x509.SubjectKeyIdentifier).value.digest
+ assert aki.value.key_identifier == expected_aki_key_id
child_server = child_ca.issue_cert("test-host.example.org")
assert len(child_server.cert_chain_pems) == 2
From f507a28e0f4d97d63716aa5a81669bb747235f07 Mon Sep 17 00:00:00 2001
From: Illia Volochii <illia.volochii@gmail.com>
Date: Wed, 27 Mar 2024 12:02:59 +0000
Subject: [PATCH 2/3] Fix a typing issue
---
src/trustme/__init__.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/trustme/__init__.py b/src/trustme/__init__.py
index 0db1bb0..d126180 100644
--- a/src/trustme/__init__.py
+++ b/src/trustme/__init__.py
@@ -246,6 +246,7 @@ def __init__(
)
issuer = name
sign_key = self._private_key
+ aki: Optional[x509.AuthorityKeyIdentifier]
if parent_cert is not None:
sign_key = parent_cert._private_key
parent_certificate = parent_cert._certificate
From cdd2fd61aae9c92f902932bacd6b39189ecde4b1 Mon Sep 17 00:00:00 2001
From: Illia Volochii <illia.volochii@gmail.com>
Date: Wed, 27 Mar 2024 12:09:38 +0000
Subject: [PATCH 3/3] Add a news entry
---
newsfragments/642.bugfix.rst | 1 +
1 file changed, 1 insertion(+)
create mode 100644 newsfragments/642.bugfix.rst
diff --git a/newsfragments/642.bugfix.rst b/newsfragments/642.bugfix.rst
new file mode 100644
index 0000000..9d75e7a
--- /dev/null
+++ b/newsfragments/642.bugfix.rst
@@ -0,0 +1 @@
+Add the Authority Key Identifier extension to child CA certificates.

View File

@ -1,17 +0,0 @@
Author: Bernhard M. Wiedemann <bwiedemann suse de>
Date: 2023-01-14
Subject: Fix tests of python-aiosmtplib after 2038
Index: trustme-1.0.0/src/trustme/__init__.py
===================================================================
--- trustme-1.0.0.orig/src/trustme/__init__.py
+++ trustme-1.0.0/src/trustme/__init__.py
@@ -37,7 +37,7 @@ __all__ = ["CA"]
# Some versions of cryptography on 32-bit platforms fail if you give
# them dates after ~2038-01-19:
# https://github.com/pyca/cryptography/pull/4658
-DEFAULT_EXPIRY = datetime.datetime(2038, 1, 1)
+DEFAULT_EXPIRY = datetime.datetime(2098, 1, 1)
def _name(name: str, organization_name: Optional[str] = None, common_name: Optional[str] = None) -> x509.Name:
name_pieces = [

BIN
trustme-1.1.0.tar.gz (Stored with Git LFS)

Binary file not shown.