Copy test certificates files from development
Copy updated test certificates and related data (keys, CSR, etc.) from
development. This replaces certificates that will expire on 2023-09-07,
causing the unit tests to fail. This also adds new data files that are not
used, and moves some files.
The replacement data is good until 2023-12-31.
The update causes some parsing unit tests to fail because the new
certificates have a different expiry date. This will be fixed in a
subsequent commit.
```
git checkout dc2d7cce02a273f6ec6a7cd78512dfeaf633a3a5 -- tests/data_files tests/src/test_certs.h tests/src/certs.c
```
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/tests/data_files/test_certs.h.jinja2 b/tests/data_files/test_certs.h.jinja2
new file mode 100644
index 0000000..92131dd
--- /dev/null
+++ b/tests/data_files/test_certs.h.jinja2
@@ -0,0 +1,54 @@
+/*
+ * X.509 test certificates
+ *
+ * Copyright The Mbed TLS Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* 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)}}
+ {% 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 %}