blob: 1517babb85a32512ddc20cb139f5b16a50e7bd7e [file] [log] [blame]
Pengyu Lv7f6933a2023-04-04 16:05:54 +08001#!/usr/bin/env python3
2#
Pengyu Lvf8e5e052023-04-18 15:43:25 +08003# Copyright The Mbed TLS Contributors
4# SPDX-License-Identifier: Apache-2.0
Pengyu Lv7f6933a2023-04-04 16:05:54 +08005#
Pengyu Lvf8e5e052023-04-18 15:43:25 +08006# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License.
8# You may obtain a copy of the License at
Pengyu Lv7f6933a2023-04-04 16:05:54 +08009#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
Pengyu Lv57240952023-04-13 14:42:37 +080018"""Audit validity date of X509 crt/crl/csr.
Pengyu Lv7f6933a2023-04-04 16:05:54 +080019
20This script is used to audit the validity date of crt/crl/csr used for testing.
Pengyu Lvf8e5e052023-04-18 15:43:25 +080021It would print the information about X.509 data if the validity period of the
22X.509 data didn't cover the provided validity period. The data are collected
23from tests/data_files/ and tests/suites/*.data files by default.
Pengyu Lv7f6933a2023-04-04 16:05:54 +080024"""
25
26import os
27import sys
28import re
29import typing
Pengyu Lv7f6933a2023-04-04 16:05:54 +080030import argparse
31import datetime
Pengyu Lv45e32032023-04-06 14:33:41 +080032import glob
Pengyu Lvfcda6d42023-04-21 11:04:07 +080033import logging
Pengyu Lv7f6933a2023-04-04 16:05:54 +080034from enum import Enum
35
Pengyu Lv31792322023-04-11 16:30:54 +080036# The script requires cryptography >= 35.0.0 which is only available
37# for Python >= 3.6. Disable the pylint error here until we were
38# using modern system on our CI.
39from cryptography import x509 #pylint: disable=import-error
Pengyu Lv7f6933a2023-04-04 16:05:54 +080040
Pengyu Lvad306792023-04-19 15:07:03 +080041from generate_test_code import FileWrapper
Pengyu Lv30f26832023-04-07 18:04:07 +080042
Pengyu Lv2d487212023-04-21 12:41:24 +080043import scripts_path # pylint: disable=unused-import
44from mbedtls_dev import build_tree
45
Pengyu Lv7f6933a2023-04-04 16:05:54 +080046class DataType(Enum):
47 CRT = 1 # Certificate
48 CRL = 2 # Certificate Revocation List
49 CSR = 3 # Certificate Signing Request
50
Pengyu Lv2d487212023-04-21 12:41:24 +080051
Pengyu Lv7f6933a2023-04-04 16:05:54 +080052class DataFormat(Enum):
53 PEM = 1 # Privacy-Enhanced Mail
54 DER = 2 # Distinguished Encoding Rules
55
Pengyu Lv2d487212023-04-21 12:41:24 +080056
Pengyu Lv7f6933a2023-04-04 16:05:54 +080057class AuditData:
Pengyu Lvf8e5e052023-04-18 15:43:25 +080058 """Store data location, type and validity period of X.509 objects."""
Pengyu Lv7f6933a2023-04-04 16:05:54 +080059 #pylint: disable=too-few-public-methods
Pengyu Lvcb8fc322023-04-11 15:05:29 +080060 def __init__(self, data_type: DataType, x509_obj):
Pengyu Lv7f6933a2023-04-04 16:05:54 +080061 self.data_type = data_type
Pengyu Lvf8e5e052023-04-18 15:43:25 +080062 self.location = ""
Pengyu Lvcb8fc322023-04-11 15:05:29 +080063 self.fill_validity_duration(x509_obj)
Pengyu Lv7f6933a2023-04-04 16:05:54 +080064
65 def fill_validity_duration(self, x509_obj):
Pengyu Lvf8e5e052023-04-18 15:43:25 +080066 """Read validity period from an X.509 object."""
Pengyu Lv7f6933a2023-04-04 16:05:54 +080067 # Certificate expires after "not_valid_after"
68 # Certificate is invalid before "not_valid_before"
69 if self.data_type == DataType.CRT:
70 self.not_valid_after = x509_obj.not_valid_after
71 self.not_valid_before = x509_obj.not_valid_before
72 # CertificateRevocationList expires after "next_update"
73 # CertificateRevocationList is invalid before "last_update"
74 elif self.data_type == DataType.CRL:
75 self.not_valid_after = x509_obj.next_update
76 self.not_valid_before = x509_obj.last_update
77 # CertificateSigningRequest is always valid.
78 elif self.data_type == DataType.CSR:
79 self.not_valid_after = datetime.datetime.max
80 self.not_valid_before = datetime.datetime.min
81 else:
82 raise ValueError("Unsupported file_type: {}".format(self.data_type))
83
Pengyu Lv2d487212023-04-21 12:41:24 +080084
Pengyu Lvf8e5e052023-04-18 15:43:25 +080085class X509Parser:
Pengyu Lv7f6933a2023-04-04 16:05:54 +080086 """A parser class to parse crt/crl/csr file or data in PEM/DER format."""
87 PEM_REGEX = br'-{5}BEGIN (?P<type>.*?)-{5}\n(?P<data>.*?)-{5}END (?P=type)-{5}\n'
88 PEM_TAG_REGEX = br'-{5}BEGIN (?P<type>.*?)-{5}\n'
89 PEM_TAGS = {
90 DataType.CRT: 'CERTIFICATE',
91 DataType.CRL: 'X509 CRL',
92 DataType.CSR: 'CERTIFICATE REQUEST'
93 }
94
Pengyu Lv8e6794a2023-04-18 17:00:47 +080095 def __init__(self,
96 backends:
97 typing.Dict[DataType,
98 typing.Dict[DataFormat,
99 typing.Callable[[bytes], object]]]) \
100 -> None:
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800101 self.backends = backends
102 self.__generate_parsers()
103
104 def __generate_parser(self, data_type: DataType):
105 """Parser generator for a specific DataType"""
106 tag = self.PEM_TAGS[data_type]
107 pem_loader = self.backends[data_type][DataFormat.PEM]
108 der_loader = self.backends[data_type][DataFormat.DER]
109 def wrapper(data: bytes):
110 pem_type = X509Parser.pem_data_type(data)
111 # It is in PEM format with target tag
112 if pem_type == tag:
113 return pem_loader(data)
114 # It is in PEM format without target tag
115 if pem_type:
116 return None
117 # It might be in DER format
118 try:
119 result = der_loader(data)
120 except ValueError:
121 result = None
122 return result
123 wrapper.__name__ = "{}.parser[{}]".format(type(self).__name__, tag)
124 return wrapper
125
126 def __generate_parsers(self):
127 """Generate parsers for all support DataType"""
128 self.parsers = {}
129 for data_type, _ in self.PEM_TAGS.items():
130 self.parsers[data_type] = self.__generate_parser(data_type)
131
132 def __getitem__(self, item):
133 return self.parsers[item]
134
135 @staticmethod
Pengyu Lv8e6794a2023-04-18 17:00:47 +0800136 def pem_data_type(data: bytes) -> typing.Optional[str]:
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800137 """Get the tag from the data in PEM format
138
139 :param data: data to be checked in binary mode.
140 :return: PEM tag or "" when no tag detected.
141 """
142 m = re.search(X509Parser.PEM_TAG_REGEX, data)
143 if m is not None:
144 return m.group('type').decode('UTF-8')
145 else:
Pengyu Lv8e6794a2023-04-18 17:00:47 +0800146 return None
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800147
Pengyu Lv30f26832023-04-07 18:04:07 +0800148 @staticmethod
149 def check_hex_string(hex_str: str) -> bool:
150 """Check if the hex string is possibly DER data."""
151 hex_len = len(hex_str)
152 # At least 6 hex char for 3 bytes: Type + Length + Content
153 if hex_len < 6:
154 return False
155 # Check if Type (1 byte) is SEQUENCE.
156 if hex_str[0:2] != '30':
157 return False
158 # Check LENGTH (1 byte) value
159 content_len = int(hex_str[2:4], base=16)
160 consumed = 4
161 if content_len in (128, 255):
162 # Indefinite or Reserved
163 return False
164 elif content_len > 127:
165 # Definite, Long
166 length_len = (content_len - 128) * 2
167 content_len = int(hex_str[consumed:consumed+length_len], base=16)
168 consumed += length_len
169 # Check LENGTH
170 if hex_len != content_len * 2 + consumed:
171 return False
172 return True
173
Pengyu Lv2d487212023-04-21 12:41:24 +0800174
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800175class Auditor:
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800176 """
177 A base class that uses X509Parser to parse files to a list of AuditData.
178
179 A subclass must implement the following methods:
180 - collect_default_files: Return a list of file names that are defaultly
181 used for parsing (auditing). The list will be stored in
182 Auditor.default_files.
183 - parse_file: Method that parses a single file to a list of AuditData.
184
185 A subclass may override the following methods:
186 - parse_bytes: Defaultly, it parses `bytes` that contains only one valid
187 X.509 data(DER/PEM format) to an X.509 object.
188 - walk_all: Defaultly, it iterates over all the files in the provided
189 file name list, calls `parse_file` for each file and stores the results
190 by extending Auditor.audit_data.
191 """
Pengyu Lvfcda6d42023-04-21 11:04:07 +0800192 def __init__(self, logger):
193 self.logger = logger
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800194 self.default_files = self.collect_default_files()
Pengyu Lv8e6794a2023-04-18 17:00:47 +0800195 # A list to store the parsed audit_data.
Pengyu Lva228cbc2023-04-21 11:59:25 +0800196 self.audit_data = [] # type: typing.List[AuditData]
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800197 self.parser = X509Parser({
198 DataType.CRT: {
199 DataFormat.PEM: x509.load_pem_x509_certificate,
200 DataFormat.DER: x509.load_der_x509_certificate
201 },
202 DataType.CRL: {
203 DataFormat.PEM: x509.load_pem_x509_crl,
204 DataFormat.DER: x509.load_der_x509_crl
205 },
206 DataType.CSR: {
207 DataFormat.PEM: x509.load_pem_x509_csr,
208 DataFormat.DER: x509.load_der_x509_csr
209 },
210 })
211
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800212 def collect_default_files(self) -> typing.List[str]:
213 """Collect the default files for parsing."""
214 raise NotImplementedError
215
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800216 def parse_file(self, filename: str) -> typing.List[AuditData]:
217 """
218 Parse a list of AuditData from file.
219
220 :param filename: name of the file to parse.
221 :return list of AuditData parsed from the file.
222 """
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800223 raise NotImplementedError
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800224
225 def parse_bytes(self, data: bytes):
226 """Parse AuditData from bytes."""
227 for data_type in list(DataType):
228 try:
229 result = self.parser[data_type](data)
230 except ValueError as val_error:
231 result = None
Pengyu Lvfcda6d42023-04-21 11:04:07 +0800232 self.logger.warning(val_error)
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800233 if result is not None:
Pengyu Lvcb8fc322023-04-11 15:05:29 +0800234 audit_data = AuditData(data_type, result)
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800235 return audit_data
236 return None
237
Pengyu Lv8e6794a2023-04-18 17:00:47 +0800238 def walk_all(self, file_list: typing.Optional[typing.List[str]] = None):
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800239 """
240 Iterate over all the files in the list and get audit data.
241 """
Pengyu Lv8e6794a2023-04-18 17:00:47 +0800242 if file_list is None:
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800243 file_list = self.default_files
244 for filename in file_list:
245 data_list = self.parse_file(filename)
246 self.audit_data.extend(data_list)
247
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800248 @staticmethod
249 def find_test_dir():
250 """Get the relative path for the MbedTLS test directory."""
Pengyu Lv2d487212023-04-21 12:41:24 +0800251 return os.path.relpath(build_tree.guess_mbedtls_root() + '/tests')
252
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800253
254class TestDataAuditor(Auditor):
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800255 """Class for auditing files in `tests/data_files/`"""
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800256
257 def collect_default_files(self):
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800258 """Collect all files in `tests/data_files/`"""
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800259 test_dir = self.find_test_dir()
Pengyu Lv8e6794a2023-04-18 17:00:47 +0800260 test_data_glob = os.path.join(test_dir, 'data_files/**')
261 data_files = [f for f in glob.glob(test_data_glob, recursive=True)
262 if os.path.isfile(f)]
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800263 return data_files
264
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800265 def parse_file(self, filename: str) -> typing.List[AuditData]:
266 """
267 Parse a list of AuditData from data file.
268
269 :param filename: name of the file to parse.
270 :return list of AuditData parsed from the file.
271 """
272 with open(filename, 'rb') as f:
273 data = f.read()
274 result = self.parse_bytes(data)
275 if result is not None:
276 result.location = filename
277 return [result]
278 else:
279 return []
280
Pengyu Lv2d487212023-04-21 12:41:24 +0800281
Pengyu Lv28fe9572023-04-23 13:56:25 +0800282def parse_suite_data(data_f):
283 """
284 Parses .data file for test arguments that possiblly have a
285 valid X.509 data. If you need a more precise parser, please
286 use generate_test_code.parse_test_data instead.
287
288 :param data_f: file object of the data file.
289 :return: Generator that yields test function argument list.
290 """
291 for line in data_f:
292 line = line.strip()
293 # Skip comments
294 if line.startswith('#'):
295 continue
296
297 # Check parameters line
298 match = re.search(r'\A\w+(.*:)?\"', line)
299 if match:
300 # Read test vectors
301 parts = re.split(r'(?<!\\):', line)
302 parts = [x for x in parts if x]
303 args = parts[1:]
304 yield args
305
306
Pengyu Lv45e32032023-04-06 14:33:41 +0800307class SuiteDataAuditor(Auditor):
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800308 """Class for auditing files in `tests/suites/*.data`"""
Pengyu Lv45e32032023-04-06 14:33:41 +0800309
310 def collect_default_files(self):
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800311 """Collect all files in `tests/suites/*.data`"""
Pengyu Lv45e32032023-04-06 14:33:41 +0800312 test_dir = self.find_test_dir()
313 suites_data_folder = os.path.join(test_dir, 'suites')
Pengyu Lv45e32032023-04-06 14:33:41 +0800314 data_files = glob.glob(os.path.join(suites_data_folder, '*.data'))
315 return data_files
316
317 def parse_file(self, filename: str):
Pengyu Lv30f26832023-04-07 18:04:07 +0800318 """
Pengyu Lvc34b9ac2023-04-23 14:51:18 +0800319 Parse a list of AuditData from test suite data file.
Pengyu Lv30f26832023-04-07 18:04:07 +0800320
321 :param filename: name of the file to parse.
322 :return list of AuditData parsed from the file.
323 """
Pengyu Lv45e32032023-04-06 14:33:41 +0800324 audit_data_list = []
Pengyu Lv30f26832023-04-07 18:04:07 +0800325 data_f = FileWrapper(filename)
Pengyu Lv28fe9572023-04-23 13:56:25 +0800326 for test_args in parse_suite_data(data_f):
Pengyu Lv7725c1d2023-04-13 15:55:30 +0800327 for idx, test_arg in enumerate(test_args):
Pengyu Lv30f26832023-04-07 18:04:07 +0800328 match = re.match(r'"(?P<data>[0-9a-fA-F]+)"', test_arg)
329 if not match:
330 continue
331 if not X509Parser.check_hex_string(match.group('data')):
332 continue
333 audit_data = self.parse_bytes(bytes.fromhex(match.group('data')))
334 if audit_data is None:
335 continue
Pengyu Lvf8e5e052023-04-18 15:43:25 +0800336 audit_data.location = "{}:{}:#{}".format(filename,
337 data_f.line_no,
338 idx + 1)
Pengyu Lv30f26832023-04-07 18:04:07 +0800339 audit_data_list.append(audit_data)
340
Pengyu Lv45e32032023-04-06 14:33:41 +0800341 return audit_data_list
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800342
Pengyu Lv2d487212023-04-21 12:41:24 +0800343
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800344def list_all(audit_data: AuditData):
345 print("{}\t{}\t{}\t{}".format(
346 audit_data.not_valid_before.isoformat(timespec='seconds'),
347 audit_data.not_valid_after.isoformat(timespec='seconds'),
348 audit_data.data_type.name,
Pengyu Lvf8e5e052023-04-18 15:43:25 +0800349 audit_data.location))
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800350
Pengyu Lvfcda6d42023-04-21 11:04:07 +0800351
352def configure_logger(logger: logging.Logger) -> None:
353 """
354 Configure the logging.Logger instance so that:
355 - Format is set to "[%(levelname)s]: %(message)s".
356 - loglevel >= WARNING are printed to stderr.
357 - loglevel < WARNING are printed to stdout.
358 """
359 class MaxLevelFilter(logging.Filter):
360 # pylint: disable=too-few-public-methods
361 def __init__(self, max_level, name=''):
362 super().__init__(name)
363 self.max_level = max_level
364
365 def filter(self, record: logging.LogRecord) -> bool:
366 return record.levelno <= self.max_level
367
368 log_formatter = logging.Formatter("[%(levelname)s]: %(message)s")
369
370 # set loglevel >= WARNING to be printed to stderr
371 stderr_hdlr = logging.StreamHandler(sys.stderr)
372 stderr_hdlr.setLevel(logging.WARNING)
373 stderr_hdlr.setFormatter(log_formatter)
374
375 # set loglevel <= INFO to be printed to stdout
376 stdout_hdlr = logging.StreamHandler(sys.stdout)
377 stdout_hdlr.addFilter(MaxLevelFilter(logging.INFO))
378 stdout_hdlr.setFormatter(log_formatter)
379
380 logger.addHandler(stderr_hdlr)
381 logger.addHandler(stdout_hdlr)
382
383
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800384def main():
385 """
386 Perform argument parsing.
387 """
Pengyu Lv57240952023-04-13 14:42:37 +0800388 parser = argparse.ArgumentParser(description=__doc__)
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800389
390 parser.add_argument('-a', '--all',
391 action='store_true',
Pengyu Lv57240952023-04-13 14:42:37 +0800392 help='list the information of all the files')
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800393 parser.add_argument('-v', '--verbose',
394 action='store_true', dest='verbose',
Pengyu Lvfcda6d42023-04-21 11:04:07 +0800395 help='show logs')
Pengyu Lvebf011f2023-04-11 13:39:31 +0800396 parser.add_argument('--not-before', dest='not_before',
Pengyu Lv57240952023-04-13 14:42:37 +0800397 help=('not valid before this date (UTC, YYYY-MM-DD). '
398 'Default: today'),
Pengyu Lvebf011f2023-04-11 13:39:31 +0800399 metavar='DATE')
400 parser.add_argument('--not-after', dest='not_after',
Pengyu Lv57240952023-04-13 14:42:37 +0800401 help=('not valid after this date (UTC, YYYY-MM-DD). '
402 'Default: not-before'),
Pengyu Lvebf011f2023-04-11 13:39:31 +0800403 metavar='DATE')
Pengyu Lva228cbc2023-04-21 11:59:25 +0800404 parser.add_argument('--data-files', action='append', nargs='*',
405 help='data files to audit',
406 metavar='FILE')
407 parser.add_argument('--suite-data-files', action='append', nargs='*',
408 help='suite data files to audit',
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800409 metavar='FILE')
410
411 args = parser.parse_args()
412
413 # start main routine
Pengyu Lvfcda6d42023-04-21 11:04:07 +0800414 # setup logger
415 logger = logging.getLogger()
416 configure_logger(logger)
417 logger.setLevel(logging.DEBUG if args.verbose else logging.ERROR)
418
419 td_auditor = TestDataAuditor(logger)
420 sd_auditor = SuiteDataAuditor(logger)
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800421
Pengyu Lva228cbc2023-04-21 11:59:25 +0800422 data_files = []
423 suite_data_files = []
424 if args.data_files is None and args.suite_data_files is None:
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800425 data_files = td_auditor.default_files
Pengyu Lv45e32032023-04-06 14:33:41 +0800426 suite_data_files = sd_auditor.default_files
Pengyu Lva228cbc2023-04-21 11:59:25 +0800427 else:
428 if args.data_files is not None:
429 data_files = [x for l in args.data_files for x in l]
430 if args.suite_data_files is not None:
431 suite_data_files = [x for l in args.suite_data_files for x in l]
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800432
Pengyu Lva228cbc2023-04-21 11:59:25 +0800433 # validity period start date
Pengyu Lvebf011f2023-04-11 13:39:31 +0800434 if args.not_before:
435 not_before_date = datetime.datetime.fromisoformat(args.not_before)
436 else:
437 not_before_date = datetime.datetime.today()
Pengyu Lva228cbc2023-04-21 11:59:25 +0800438 # validity period end date
Pengyu Lvebf011f2023-04-11 13:39:31 +0800439 if args.not_after:
440 not_after_date = datetime.datetime.fromisoformat(args.not_after)
441 else:
442 not_after_date = not_before_date
443
Pengyu Lva228cbc2023-04-21 11:59:25 +0800444 # go through all the files
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800445 td_auditor.walk_all(data_files)
Pengyu Lv45e32032023-04-06 14:33:41 +0800446 sd_auditor.walk_all(suite_data_files)
Pengyu Lvebf011f2023-04-11 13:39:31 +0800447 audit_results = td_auditor.audit_data + sd_auditor.audit_data
448
Pengyu Lv57240952023-04-13 14:42:37 +0800449 # we filter out the files whose validity duration covers the provided
Pengyu Lvebf011f2023-04-11 13:39:31 +0800450 # duration.
451 filter_func = lambda d: (not_before_date < d.not_valid_before) or \
452 (d.not_valid_after < not_after_date)
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800453
454 if args.all:
Pengyu Lvebf011f2023-04-11 13:39:31 +0800455 filter_func = None
456
Pengyu Lva228cbc2023-04-21 11:59:25 +0800457 # filter and output the results
Pengyu Lvebf011f2023-04-11 13:39:31 +0800458 for d in filter(filter_func, audit_results):
459 list_all(d)
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800460
Pengyu Lvfcda6d42023-04-21 11:04:07 +0800461 logger.debug("Done!")
Pengyu Lv7f6933a2023-04-04 16:05:54 +0800462
463if __name__ == "__main__":
464 main()