- Future-proofing against an upcoming
asn1crypto
that is already being shipped in some distro packages. - Address some timing issues in tests.
- Bump
aiohttp
requirement to>=3.8,<3.11
. - Declare support for Python 3.12 and 3.13
-
Bump
aiohttp
requirement to>=3.8,<3.10
. -
Address two certificate fetching issues (see PR #13)
- Tolerate CMS certificate-only message in response
without
Content-Type
. - Deal with implicit reliance on order of certs when processing such messages.
- Tolerate CMS certificate-only message in response
without
- Bump some dependency versions.
- Handle nonspecific OCSP validation errors cleanly during validation.
- Fix error reporting on banned algorithms in some cases
- Allow caller to assert revocation status of a cert
- More refined POE information tracking in experimental AdES API
- Introduce a more precise error type to signal stale revocation information (see PR #11)
- Ignore content types altogether when fetching certificates and the response payload is PEM (see PR #9)
- Further increase leniency regarding content types when fetching certificates on-the-fly
- Add SLSA provenance data to releases
- Various updates in test dependencies and CI workflow dependencies.
- Improve processing of OCSP responses without
nextUpdate
- Some more package metadata & release flow tweaks
- No implementation changes compared to
0.21.2
- Renamed
async_http
dependency group toasync-http
. - Move towards automated GitHub Actions-based release flow as a move towards better process standardisation.
- Sign release artifacts with Sigstore.
- Fix a typing issue caused by a typo in the
requests
cert fetcher. - Removed a piece of misbehaving and duplicative logic in the revocation freshness checker.
- Fix
DisallowedAlgorithmError
parameters. - Preserve timestamp info in expiration-related errors.
- Disable algo enforcement in prima facie past validation checks.
- Correct a misunderstanding in the interaction between the AdES code and the old "retroactive revinfo" setting.
- Switch to
pyproject.toml
to manage project metadata. - Path validation errors now carry information about the paths that triggered them.
InvalidCertificateError
is no longer a subclass ofPathValidationError
, only ofValidationError
. This is a minor but nonetheless breaking change.
Minor maintenance release without functional changes, only to metadata, documentation and typing.
This is a big release, with many breaking changes in the "deeper" APIs. The impact on the high-level API should be small to nonexistent, but caution when upgrading is advised.
- More uniform and machine-processable errors.
- Move towards a setup using "policy objects" that can be used to
construct
ValidationContext
s in a systematic way. - Move revinfo gathering to a separate revinfo manager class. Some arguably
internal methods on
ValidationContext
were moved to theRevinfoManager
class. - Incubating API for AdES validation primitives (freshness, POE handling, more sophisticated revinfo gathering, time slide) and some certificate-related validation routines.
- Introduce a more fully-fledged API to manage permissible algorithms.
- Broaden trust root provisioning beyond certificates: trust roots
can now have qualifiers, and be provisioned as a name-key pair as opposed
to a (self-signed) certificate. This implies breaking changes for
ValidationPath
. In general, issuance semantics in the internals are now expressed through theAuthority
API as much as possible. - In the same vein,
CertificateRegistry
was refactored intoTrustManager
,CertificateRegistry
andPathBuilder
. These are respectively responsible for managing trust, maintaining the certificate cache, and building paths. - Thorough clean-up of legacy dev tooling; put in place
mypy
andblack
, move topytest
, get rid ofpretty_message
in favour of f-strings.
- Fix double encoding when generating OCSP nonces
- Make certificate fetcher more tolerant (see #2)
- Update
asn1crypto
to1.5.1
- Declare Python 3.11 support
- Maintenance update to bump
asn1crypto
to1.5.0
and get rid of a number of compatibility shims for fixes that were upstreamed toasn1crypto
.
- Fix improper error handling when dealing with expired or not-yet-valid attribute certificates.
- Correct and improve behaviour of certificate fetcher when the server does not supply a Content-Type header.
- Patch
asn1crypto
to work around tagging issue in AC issuer field
- Properly enforce algo matching in AC validation
- Attribute certificate validation support
- Support for
AAControls
extension - Refactored OCSP and CRL logic to work with attribute certificate validation
- Many nominal type checks removed in favour of type annotations
- Many API entry points now accept both
asn1crypto.x509.Certificate
andasn1crypto.cms.AttributeCertificateV2
- Minor breaking change:
bytes
is no longer acceptable as a substitute forasn1crypto.x509.Certificate
in the public API
- Various improvements to error handling in certificate fetchers
- Replace
revocation_mode
with more flexible revocation policy controls, aligned with ETSI TS 119 172. Oldrevocation_mode
params will be transparently translated to corresponding 'refined' policies, but therevocation_mode
property onValidationContext
was removed. - Handle soft fails as part of revocation policies. Concretely, this means that the
SoftFailError
exception type was removed. Exceptions arising from quashed 'soft' failures can still be retrieved via thesoft_fail_exceptions
property onValidationContext
instances; the resulting list can contain any exception type. - Fix various hiccups in CRL and OCSP handling.
- Fix mistaken assumption when a certificate's MIME type is announced as
application/x-x509-ca-cert
. - Update aiohttp to 3.8.0
- Fix a deadlocking bug caused by improper exception handling in the fetcher code.
- Exceptions are now communicated to fetch jobs waiting for results.
- Replace
run_until_complete()
withasyncio.run()
for better event loop state management.
- Fixes a packaging error in
0.17.0
!!Compatibility note!!
This release contains breaking changes in lower-level APIs. High-level API functions should continue to work as-is, although some have been deprecated. However, the rewrite of the CRL & OCSP fetch logic breaks compatibility with the previous version's API.
- Refactor OCSP/certificate/CRL fetch logic to be more modular and swappable.
- Automatically fetch missing issuer certificates if there is an AIA record indicating where to find them
- Favour asynchronous I/O throughout the API.
CertificateValidator.validate_usage
,CertificateValidator.validate_tls
and theValidationContext.retrieve_XYZ
methods were deprecated in favour of their asynchronous equivalents. - Support two backends for fetching revocation information and certificates:
requests
(legacy) andaiohttp
(via theasync-http
optional dependency group).- It is expected that using
aiohttp
fetchers will yield better performance with the asynchronous APIs, but as these require some resource management on the caller's part,requests
is still the default. - Fetcher backends can be swapped out by means of the
fetcher_backend
argument toValidationContext
.
- It is expected that using
- Refactor CertificateRegistry
- Change OCSP responder cert selection procedure to give priority to certificates embedded into the response data (if there are any).
- Short-circuit anyPolicy when reporting policies
- Export PKIXValidationParams
- Limit CRL client to HTTP-based URLs
- Properly handle missing Content-Type header in server response when fetching CA certificates referenced in a CRL.
- Gracefully handle lack of thisUpdate / nextUpdate in OCSP responses.
- Use
pyca/cryptography
for signature validation.oscrypto
is still included to access the system trust list. - Support RSASSA-PSS and EdDSA certificates.
- Support name constraints.
- Support all input parameters to the PKIX validation algorithm (acceptable policy set, policy mapping inhibition, ...).
- Further increase PKITS coverage.
- No code changes, rerelease because distribution package was polluted due to improper build cache cleanup.
- Raise RequestError if CRL / OCSP client returns a status code other than 200. Previously, this would fail with a cryptic ASN.1 deserialisation error instead.
- Rename Python package to
pyhanko_certvalidator
to avoid the potential name conflict with the upstreamcertvalidator
package.
- Consider SHA-1 weak by default, and do not hard-code the list of potential weak hash algos.
- Added an optional
retroactive_revinfo
flag toValidationContext
to ignore thethisUpdate
field in OCSP responses and CRLs. The effect of this is that CRLs and OCSP responses are also considered valid for point-in-time validation with respect to a time in the past. This is useful for some validation profiles. The default state of the flag remainsFalse
nonetheless.
- Fixed a packaging error.
- Forked from certvalidator to add patches for pyHanko.
- Replaced urllib calls with
requests
library for universal mocking. - Added a
time_tolerance
parameter to the validation context to allow for some time drift on CRLs and OCSP responses. - Deal with no-matches on OCSP and CRLs strictly in hard-fail mode.
- Drop support for Python 2, and all Python 3 versions prior to 3.7. It is likely that the code still runs on older Python 3 versions, but I have no interest in maintaining support for those.
- Updated asn1crypto dependency to
0.18.1
, oscrypto dependency to0.16.1
.
- Updated for compatibility with oscrypto 0.16.0
- Backwards compability break: the
require_revocation_checks
parameter was removed and a new keyword parameter,revocation_mode
, was added toValidationContext()
. Validation may now be in asoft-fail
(default),hard-fail
, orrequire
mode. See the documentation for information about the behavior of each mode. - Added certificate signature hash algorithm checks, with a default blacklist
of
md2
andmd5
- Trust roots no longer need to be self-signed, allowing for cross-signed roots
- Keys with no
key_usage
extension are now permitted to sign CRLs - An OCSP or CRL check may fail and not result in an error if the other is successful
- Exceptions for expired or not-yet-valid certificates now include full date and time
- Self-signed certificates now have a unique exception message instead of a generic message indicating the issuer could not be found in the trust roots
crl_client
can now handle CRLs that are PEM-encoded- Fixed encoding of URLs in Python 2 when fetching CRLs and OCSP responses
- Corrected an error when trying to check the signature of a certificate to determine if it is self-signed or not
- Fixed a bug with duplicate HTTP headers during OCSP requests on Python 3
- Fixed an exception that would be thrown if a signature not using RSA, DSA or ECDSA is found
- Fixed a bug with whitelisting certificates on Python 3.2
- Initial release