14
0

Accepting request 1243372 from home:glaubitz:branches:devel:languages:python

- Update to 0.26.5
  * Future-proofing against an upcoming `asn1crypto`
    that is already being shipped in some distro
    packages.
  * Address some timing issues in tests.
- Drop 5dd5ff95b7b104667eb4f39367eb4f4c00fcedd5.patch, merged upstream
- Use Python 3.11 on SLE-15 by default

OBS-URL: https://build.opensuse.org/request/show/1243372
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyhanko-certvalidator?expand=0&rev=5
This commit is contained in:
2025-02-05 15:49:34 +00:00
committed by Git OBS Bridge
parent 96a1ef0657
commit b41a3cf6c7
5 changed files with 17 additions and 134 deletions

View File

@@ -1,128 +0,0 @@
From 5dd5ff95b7b104667eb4f39367eb4f4c00fcedd5 Mon Sep 17 00:00:00 2001
From: Matthias Valvekens <matthias@mvalvekens.be>
Date: Tue, 12 Nov 2024 21:27:35 +0100
Subject: [PATCH] Freeze time for tests using PKITS certs
---
tests/test_certificate_validator.py | 2 ++
tests/test_policy_proc.py | 9 +++++++--
tests/test_validate.py | 4 ++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tests/test_certificate_validator.py b/tests/test_certificate_validator.py
index 692bdda..2c2845c 100644
--- a/tests/test_certificate_validator.py
+++ b/tests/test_certificate_validator.py
@@ -4,6 +4,7 @@
import pytest
from asn1crypto.util import timezone
+from freezegun import freeze_time
from pyhanko_certvalidator import (
CertificateValidator,
@@ -94,6 +95,7 @@ async def test_basic_certificate_validator_tls_whitelist():
await validator.async_validate_usage({'crl_sign'})
+@freeze_time('2022-05-01')
@pytest.mark.asyncio
async def test_certvalidator_with_params():
cert = load_nist_cert('ValidPolicyMappingTest12EE.crt')
diff --git a/tests/test_policy_proc.py b/tests/test_policy_proc.py
index f95f4bb..8765677 100644
--- a/tests/test_policy_proc.py
+++ b/tests/test_policy_proc.py
@@ -1,7 +1,6 @@
-import os
-
import pytest
from asn1crypto import x509
+from freezegun import freeze_time
from pyhanko_certvalidator.authority import (
CertTrustAnchor,
@@ -49,6 +48,7 @@ def test_extract_permitted_subtrees():
assert tree.tree_base.value == expected_name
+@freeze_time('2022-05-01')
@pytest.mark.asyncio
async def test_validate_with_derived():
crt = load_nist_cert('nameConstraintsDN1CACert.crt')
@@ -64,6 +64,7 @@ async def test_validate_with_derived():
await async_validate_path(context, path)
+@freeze_time('2022-05-01')
@pytest.mark.asyncio
async def test_validate_with_merged_permitted_subtrees():
crt = load_nist_cert('nameConstraintsDN1CACert.crt')
@@ -93,6 +94,7 @@ async def test_validate_with_merged_permitted_subtrees():
await async_validate_path(context, path, parameters=extra_params)
+@freeze_time('2022-05-01')
@pytest.mark.asyncio
async def test_validate_with_merged_excluded_subtrees():
crt = load_nist_cert('nameConstraintsDN3CACert.crt')
@@ -122,6 +124,7 @@ async def test_validate_with_merged_excluded_subtrees():
await async_validate_path(context, path, parameters=extra_params)
+@freeze_time('2022-05-01')
@pytest.mark.asyncio
async def test_validate_with_certless_root():
crt = load_nist_cert('nameConstraintsDN1CACert.crt')
@@ -154,6 +157,7 @@ async def test_validate_with_certless_root():
await async_validate_path(context, path, parameters=extra_params)
+@freeze_time('2022-05-01')
@pytest.mark.asyncio
async def test_validate_with_certless_root_failure():
crt = load_nist_cert('nameConstraintsDN1CACert.crt')
@@ -186,6 +190,7 @@ async def test_validate_with_certless_root_failure():
await async_validate_path(context, path, parameters=extra_params)
+@freeze_time('2022-05-01')
@pytest.mark.asyncio
async def test_validate_empty_path_certless_root():
crt = load_nist_cert('nameConstraintsDN1CACert.crt')
diff --git a/tests/test_validate.py b/tests/test_validate.py
index 77d9f4d..f739cac 100644
--- a/tests/test_validate.py
+++ b/tests/test_validate.py
@@ -9,6 +9,7 @@
import pytest
from asn1crypto import crl, ocsp, x509
from asn1crypto.util import timezone
+from freezegun import freeze_time
from pyhanko_certvalidator import PKIXValidationParams
from pyhanko_certvalidator.authority import Authority, CertTrustAnchor
@@ -617,6 +618,7 @@ def read_pkits_test_params():
return [PKITSTestCase.from_json(obj) for obj in cases]
+@freeze_time('2022-05-01')
@pytest.mark.parametrize(
'test_case', read_pkits_test_params(), ids=lambda case: str(case.test_info)
)
@@ -711,6 +713,7 @@ def read_pkits_user_notice_test_params():
return [PKITSUserNoticeTestCase.from_json(obj) for obj in cases]
+@freeze_time('2022-05-01')
@pytest.mark.parametrize(
'test_case',
read_pkits_user_notice_test_params(),
@@ -741,6 +744,7 @@ def test_nist_pkits_user_notice(test_case: PKITSUserNoticeTestCase):
assert qual_obj['qualifier']['explicit_text'].native == test_case.notice
+@freeze_time('2022-05-01')
def test_408020_cps_pointer_qualifier_test20():
cert = load_nist_cert('CPSPointerQualifierTest20EE.crt')
ca_certs = [load_nist_cert('TrustAnchorRootCertificate.crt')]

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a63f70ee391066e23a457a7ea8c8e0ccff82f31ac947da0300378ddbe99c2cfd
size 567603

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ec5786b05e16235dfd44738590aa8c40e78a6ad4ead0e9a622fa8180c3247992
size 567647

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Feb 5 13:26:06 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 0.26.5
* Future-proofing against an upcoming `asn1crypto`
that is already being shipped in some distro
packages.
* Address some timing issues in tests.
- Drop 5dd5ff95b7b104667eb4f39367eb4f4c00fcedd5.patch, merged upstream
- Use Python 3.11 on SLE-15 by default
-------------------------------------------------------------------
Wed Nov 13 06:13:51 UTC 2024 - Bernhard M. Demo2 Wiedemann <opensusedemo+test2@lsmod.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pyhanko-certvalidator
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,14 +16,14 @@
#
%{?sle15_python_module_pythons}
Name: python-pyhanko-certvalidator
Version: 0.26.4
Version: 0.26.5
Release: 0
Summary: Validates X509 certificates and paths
License: MIT
URL: https://github.com/MatthiasValvekens/certvalidator
Source: https://github.com/MatthiasValvekens/certvalidator/archive/refs/tags/v%{version}.tar.gz#/pyhanko-certvalidator-%{version}.tar.gz
Patch0: https://github.com/MatthiasValvekens/certvalidator/commit/5dd5ff95b7b104667eb4f39367eb4f4c00fcedd5.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 67.4}
BuildRequires: %{python_module wheel}