1/* 2 * X.509 test certificates 3 * 4 * Copyright The Mbed TLS Contributors 5 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 6 */ 7 8/* THIS FILE is generated by `tests/scripts/generate_test_cert_macros.py` */ 9/* *INDENT-OFF* */ 10 11{% for mode, name, value in macros %} 12 {% if mode == 'string' %} 13/* This is taken from {{value}}. */ 14/* BEGIN FILE string macro {{name}} {{value}} */ 15#define {{name}}{{ '\\' | put_to_column(position=80-9-name|length)}} 16 {% for line in value | read_lines %} 17 "{{line}}\r\n"{% if not loop.last %}{{ '\\' | put_to_column(position=80-10-1-line|length)}} 18 {% endif %} 19 {% endfor %} 20 21/* END FILE */ 22 {% endif %} 23 {% if mode == 'binary' %} 24/* This is generated from {{value}}. */ 25/* BEGIN FILE binary macro {{name}} {{value}} */ 26#define {{name}} {% raw -%} { {%- endraw %} {{ '\\' | put_to_column(position=80-11-name|length)}} 27 {% for line in value | read_as_c_array %} 28 {% if not loop.last %} 29 {{line}},{{ '\\' | put_to_column(position=80-9-line|length)}} 30 {% else %} 31 {{line}}{{ '\\' | put_to_column(position=80-8-line|length)}} 32 {% endif %} 33 {% endfor %} 34{% raw -%} } {%- endraw %} 35 36/* END FILE */ 37 {% endif %} 38 {% if mode == 'password' %} 39#define {{name}} "{{value}}" 40 {% endif %} 41 42{% endfor %} 43