| Jerry Yu | 5811869 | 2023-05-23 16:14:47 +0800 | [diff] [blame] | 1 | /* | 
|  | 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)}} | 
| Jerry Yu | ba3eee7 | 2023-07-03 18:16:37 +0800 | [diff] [blame] | 39 | {% for line in value | read_as_c_array %} | 
|  | 40 | {% if not loop.last %} | 
| Jerry Yu | 5811869 | 2023-05-23 16:14:47 +0800 | [diff] [blame] | 41 | {{line}},{{ '\\' | put_to_column(position=80-9-line|length)}} | 
| Jerry Yu | ba3eee7 | 2023-07-03 18:16:37 +0800 | [diff] [blame] | 42 | {% else %} | 
| Jerry Yu | 5811869 | 2023-05-23 16:14:47 +0800 | [diff] [blame] | 43 | {{line}}{{ '\\' | put_to_column(position=80-8-line|length)}} | 
| Jerry Yu | ba3eee7 | 2023-07-03 18:16:37 +0800 | [diff] [blame] | 44 | {% endif %} | 
|  | 45 | {% endfor %} | 
| Jerry Yu | 5811869 | 2023-05-23 16:14:47 +0800 | [diff] [blame] | 46 | {% raw -%} } {%- endraw %} | 
|  | 47 |  | 
|  | 48 | /* END FILE */ | 
|  | 49 | {% endif %} | 
|  | 50 | {% if mode == 'password' %} | 
|  | 51 | #define {{name}} "{{value}}" | 
|  | 52 | {% endif %} | 
|  | 53 |  | 
|  | 54 | {% endfor %} |