File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed
Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -50,25 +50,6 @@ def _verify_x509_certificate_chain(pems: list[str]):
5050 return False
5151
5252
53- def _check_chain_len (pems : list ) -> bool :
54- """
55- Check the x509 certificate chain lenght.
56-
57- :param pems: The x509 certificate chain
58- :type pems: list
59-
60- :returns: True if the x509 certificate chain lenght is valid else False
61- :rtype: bool
62- """
63- chain_len = len (pems )
64- if chain_len < 2 :
65- message = f"invalid chain lenght -> minimum expected 2 found { chain_len } "
66- logging .warning (LOG_ERROR .format (message ))
67- return False
68-
69- return True
70-
71-
7253def _check_datetime (exp : datetime | None ):
7354 """
7455 Check the x509 certificate chain expiration date.
@@ -102,7 +83,7 @@ def verify_x509_attestation_chain(x5c: list[bytes]) -> bool:
10283 """
10384 exp = get_expiry_date_from_x5c (x5c )
10485
105- if not _check_chain_len ( x5c ) or not _check_datetime (exp ):
86+ if not _check_datetime (exp ):
10687 return False
10788
10889 pems = [DER_cert_to_PEM_cert (cert ) for cert in x5c ]
@@ -176,10 +157,6 @@ def verify_x509_anchor(pem_str: str) -> bool:
176157
177158 pems = pem_to_pems_list (pem_str )
178159
179- if not _check_chain_len (pems ):
180- logging .error (LOG_ERROR .format ("check chain len failed" ))
181- return False
182-
183160 return _verify_x509_certificate_chain (pems )
184161
185162def get_get_subject_name (der : bytes ) -> Optional [str ]:
You can’t perform that action at this time.
0 commit comments