2023-05-23 10:14:47 +02:00
|
|
|
/*
|
|
|
|
* X.509 test certificates
|
|
|
|
*
|
|
|
|
* Copyright The Mbed TLS Contributors
|
2023-11-02 20:47:20 +01:00
|
|
|
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
2023-05-23 10:14:47 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* THIS FILE is generated by `tests/scripts/generate_test_cert_macros.py` */
|
|
|
|
/* *INDENT-OFF* */
|
|
|
|
|
|
|
|
{% for mode, name, value in macros %}
|
|
|
|
{% if mode == 'string' %}
|
|
|
|
/* This is taken from {{value}}. */
|
|
|
|
/* BEGIN FILE string macro {{name}} {{value}} */
|
|
|
|
#define {{name}}{{ '\\' | put_to_column(position=80-9-name|length)}}
|
|
|
|
{% for line in value | read_lines %}
|
|
|
|
"{{line}}\r\n"{% if not loop.last %}{{ '\\' | put_to_column(position=80-10-1-line|length)}}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
/* END FILE */
|
|
|
|
{% endif %}
|
|
|
|
{% if mode == 'binary' %}
|
|
|
|
/* This is generated from {{value}}. */
|
|
|
|
/* BEGIN FILE binary macro {{name}} {{value}} */
|
|
|
|
#define {{name}} {% raw -%} { {%- endraw %} {{ '\\' | put_to_column(position=80-11-name|length)}}
|
2023-07-03 12:16:37 +02:00
|
|
|
{% for line in value | read_as_c_array %}
|
|
|
|
{% if not loop.last %}
|
2023-05-23 10:14:47 +02:00
|
|
|
{{line}},{{ '\\' | put_to_column(position=80-9-line|length)}}
|
2023-07-03 12:16:37 +02:00
|
|
|
{% else %}
|
2023-05-23 10:14:47 +02:00
|
|
|
{{line}}{{ '\\' | put_to_column(position=80-8-line|length)}}
|
2023-07-03 12:16:37 +02:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2023-05-23 10:14:47 +02:00
|
|
|
{% raw -%} } {%- endraw %}
|
|
|
|
|
|
|
|
/* END FILE */
|
|
|
|
{% endif %}
|
|
|
|
{% if mode == 'password' %}
|
|
|
|
#define {{name}} "{{value}}"
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% endfor %}
|