From 05f0b23ed976454674adb53b8298753454b7cbf3 Mon Sep 17 00:00:00 2001 From: grindsa Date: Tue, 6 Feb 2024 08:10:58 +0100 Subject: [PATCH 1/3] [fix] #132 - return serial numbers with leading zero --- acme_srv/helper.py | 2 ++ test/test_helper.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/acme_srv/helper.py b/acme_srv/helper.py index da43f11f..33423cfd 100644 --- a/acme_srv/helper.py +++ b/acme_srv/helper.py @@ -411,6 +411,8 @@ def cert_serial_get(logger: logging.Logger, certificate: str, hexformat: bool = cert = cert_load(logger, certificate, recode=True) if hexformat: serial_number = f'{cert.serial_number:x}' + # add leading zero if needed + serial_number = serial_number.zfill(len(serial_number) + len(serial_number) % 2) else: serial_number = cert.serial_number logger.debug('cert_serial_get() ended with: %s', serial_number) diff --git a/test/test_helper.py b/test/test_helper.py index deec7132..1f4401cc 100644 --- a/test/test_helper.py +++ b/test/test_helper.py @@ -376,7 +376,7 @@ def test_043_helper_cert_serial_get(self): bta75ocePrurdNxsxKJhLlXbnKD6lurCb4khRhrmLmpK8JxhuaevEVklSQX0gqlR fxAH4XQsaqcaedPNI+W5OUITMz40ezDCbUqxS9KEMCGPoOTXNRAjbr72sc4Vkw7H t+eRUDECE+0UnjyeCjTn3EU=""" - self.assertEqual('a', self.cert_serial_get(self.logger, cert, hexformat=True)) + self.assertEqual('0a', self.cert_serial_get(self.logger, cert, hexformat=True)) def test_044_helper_cert_issuer_get(self): """ test cert_issuer_get """ From 1afbf664882b98ed5a48f16331a59fe9ab4e1d55 Mon Sep 17 00:00:00 2001 From: grindsa Date: Tue, 6 Feb 2024 08:43:52 +0100 Subject: [PATCH 2/3] [rel] bump to v0.33.1 --- CHANGES.md | 6 ++++++ acme_srv/version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e7178dc5..44d57e95 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,12 @@ This is a high-level summary of the most important changes. For a full list of changes, see the [git commit log](https://github.com/grindsa/acme2certifier/commits) and pick the appropriate release branch. +# Changes in 0.33.1 + +**Bugfixes** + +- [132](https://github.com/grindsa/acme2certifier/issues/132) - returning serial numbers in hex-format with leading zero + # Changes in 0.33 **Upgrade notes**: diff --git a/acme_srv/version.py b/acme_srv/version.py index c92a3981..e2879d3c 100644 --- a/acme_srv/version.py +++ b/acme_srv/version.py @@ -3,5 +3,5 @@ # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module -__version__ = '0.33' +__version__ = '0.33.1' __dbversion__ = '0.33' From 56550d01c7525a66802ee66fc6f7e7767a3a171a Mon Sep 17 00:00:00 2001 From: grindsa Date: Tue, 6 Feb 2024 09:31:31 +0100 Subject: [PATCH 3/3] [fix] md linting --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 44d57e95..131b5714 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,7 +7,7 @@ and pick the appropriate release branch. # Changes in 0.33.1 -**Bugfixes** +**Bugfixes**: - [132](https://github.com/grindsa/acme2certifier/issues/132) - returning serial numbers in hex-format with leading zero