mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-06-25 12:41:56 +03:00
generate_test_keys: add default output file option
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
@ -91,14 +91,16 @@ def get_look_up_table_entry(key_type: str, group_id_or_keybits: str,
|
|||||||
yield " {0}, sizeof({0}) }},".format(pub_array_name)
|
yield " {0}, sizeof({0}) }},".format(pub_array_name)
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
current_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
default_output_path = current_path + "/../src/test_keys.h"
|
||||||
|
|
||||||
argparser = argparse.ArgumentParser()
|
argparser = argparse.ArgumentParser()
|
||||||
argparser.add_argument("--output", required=True, help="Output file")
|
argparser.add_argument("--output", help="Output file", default=default_output_path)
|
||||||
args = argparser.parse_args()
|
args = argparser.parse_args()
|
||||||
|
|
||||||
output_file = args.output
|
output_file = args.output
|
||||||
# Remove output file if already existing.
|
# Remove output file if already existing.
|
||||||
if os.path.exists(output_file):
|
if os.path.exists(output_file):
|
||||||
print("Warning: {} already existing, it will be overwritten.", output_file)
|
|
||||||
os.remove(output_file)
|
os.remove(output_file)
|
||||||
|
|
||||||
output_file = open(output_file, 'at')
|
output_file = open(output_file, 'at')
|
||||||
|
Reference in New Issue
Block a user