blob: 390ea088fcdcc12418b1394dcd7175662bcb317e [file] [log] [blame]
Jerry Yu58118692023-05-23 16:14:47 +08001/*
2 * X.509 test certificates
3 *
4 * Copyright The Mbed TLS Contributors
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20/* THIS FILE is generated by `tests/scripts/generate_test_cert_macros.py` */
21/* *INDENT-OFF* */
22
23{% for mode, name, value in macros %}
24 {% if mode == 'string' %}
25/* This is taken from {{value}}. */
26/* BEGIN FILE string macro {{name}} {{value}} */
27#define {{name}}{{ '\\' | put_to_column(position=80-9-name|length)}}
28 {% for line in value | read_lines %}
29 "{{line}}\r\n"{% if not loop.last %}{{ '\\' | put_to_column(position=80-10-1-line|length)}}
30 {% endif %}
31 {% endfor %}
32
33/* END FILE */
34 {% endif %}
35 {% if mode == 'binary' %}
36/* This is generated from {{value}}. */
37/* BEGIN FILE binary macro {{name}} {{value}} */
38#define {{name}} {% raw -%} { {%- endraw %} {{ '\\' | put_to_column(position=80-11-name|length)}}
39 {% for line in value | read_as_c_array %}
40 {% if not loop.last %}
41 {{line}},{{ '\\' | put_to_column(position=80-9-line|length)}}
42 {% else %}
43 {{line}}{{ '\\' | put_to_column(position=80-8-line|length)}}
44 {% endif %}
45 {% endfor %}
46{% raw -%} } {%- endraw %}
47
48/* END FILE */
49 {% endif %}
50 {% if mode == 'password' %}
51#define {{name}} "{{value}}"
52 {% endif %}
53
54{% endfor %}