File: test_certs.h.jinja2

package info (click to toggle)
mbedtls 3.6.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 50,424 kB
  • sloc: ansic: 164,526; sh: 25,295; python: 14,825; makefile: 2,761; perl: 1,043; tcl: 4
file content (43 lines) | stat: -rw-r--r-- 1,363 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 *  X.509 test certificates
 *
 *  Copyright The Mbed TLS Contributors
 *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
 */

/* THIS FILE is generated by `framework/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)}}
        {% for line in value | read_as_c_array %}
            {% if not loop.last %}
        {{line}},{{ '\\' | put_to_column(position=80-9-line|length)}}
            {% else %}
        {{line}}{{ '\\' | put_to_column(position=80-8-line|length)}}
            {% endif %}
        {% endfor %}
{% raw -%} } {%- endraw %}

/* END FILE */
    {% endif %}
    {% if mode == 'password' %}
#define {{name}} "{{value}}"
    {% endif %}

{% endfor %}
/* End of generated file */