verification: add missing max_chain_depth kwargs (#9847)

Missed these on the original PR.

Signed-off-by: William Woodruff <william@trailofbits.com>
This commit is contained in:
William Woodruff 2023-11-09 17:43:03 -05:00 committed by GitHub
parent 8caafd741d
commit e7dbca6260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -57,6 +57,12 @@ chain building, etc.
The verifier's validation time.
.. attribute:: max_chain_depth
:type: :class:`int`
The verifier's maximum intermediate CA chain depth.
.. attribute:: store
:type: :class:`Store`

View file

@ -38,7 +38,11 @@ class PolicyBuilder:
if self._time is not None:
raise ValueError("The validation time may only be set once.")
return PolicyBuilder(time=new_time, store=self._store)
return PolicyBuilder(
time=new_time,
store=self._store,
max_chain_depth=self._max_chain_depth,
)
def store(self, new_store: Store) -> PolicyBuilder:
"""
@ -48,7 +52,11 @@ class PolicyBuilder:
if self._store is not None:
raise ValueError("The trust store may only be set once.")
return PolicyBuilder(time=self._time, store=new_store)
return PolicyBuilder(
time=self._time,
store=new_store,
max_chain_depth=self._max_chain_depth,
)
def max_chain_depth(self, new_max_chain_depth: int) -> PolicyBuilder:
"""