Skip to content

Commit

Permalink
pyca: handle build_server_verifier failure
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw committed Jul 16, 2024
1 parent 96715be commit 5a94493
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion harness/pyca-cryptography/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ def evaluate_testcase(testcase: Testcase) -> TestcaseResult:
if max_chain_depth := testcase.max_chain_depth:
builder = builder.max_chain_depth(max_chain_depth)

verifier = builder.build_server_verifier(peer_name)
# This can fail if the peer name is invalid.
try:
verifier = builder.build_server_verifier(peer_name)
except ValueError as e:
return TestcaseResult(id=testcase.id, actual_result=ActualResult.FAILURE, context=str(e))

try:
verifier.verify(peer_certificate, untrusted_intermediates)
return TestcaseResult(id=testcase.id, actual_result=ActualResult.SUCCESS, context=None)
Expand Down

0 comments on commit 5a94493

Please sign in to comment.