1a8e1175bSopenharmony_ci/*
2a8e1175bSopenharmony_ci *  Version information
3a8e1175bSopenharmony_ci *
4a8e1175bSopenharmony_ci *  Copyright The Mbed TLS Contributors
5a8e1175bSopenharmony_ci *  SPDX-License-Identifier: Apache-2.0
6a8e1175bSopenharmony_ci *
7a8e1175bSopenharmony_ci *  Licensed under the Apache License, Version 2.0 (the "License"); you may
8a8e1175bSopenharmony_ci *  not use this file except in compliance with the License.
9a8e1175bSopenharmony_ci *  You may obtain a copy of the License at
10a8e1175bSopenharmony_ci *
11a8e1175bSopenharmony_ci *  http://www.apache.org/licenses/LICENSE-2.0
12a8e1175bSopenharmony_ci *
13a8e1175bSopenharmony_ci *  Unless required by applicable law or agreed to in writing, software
14a8e1175bSopenharmony_ci *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15a8e1175bSopenharmony_ci *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16a8e1175bSopenharmony_ci *  See the License for the specific language governing permissions and
17a8e1175bSopenharmony_ci *  limitations under the License.
18a8e1175bSopenharmony_ci */
19a8e1175bSopenharmony_ci
20a8e1175bSopenharmony_ci#include "common.h"
21a8e1175bSopenharmony_ci
22a8e1175bSopenharmony_ci#if defined(MBEDTLS_VERSION_C)
23a8e1175bSopenharmony_ci
24a8e1175bSopenharmony_ci#include "mbedtls/version.h"
25a8e1175bSopenharmony_ci#include <string.h>
26a8e1175bSopenharmony_ci
27a8e1175bSopenharmony_ciunsigned int mbedtls_version_get_number(void)
28a8e1175bSopenharmony_ci{
29a8e1175bSopenharmony_ci    return MBEDTLS_VERSION_NUMBER;
30a8e1175bSopenharmony_ci}
31a8e1175bSopenharmony_ci
32a8e1175bSopenharmony_civoid mbedtls_version_get_string(char *string)
33a8e1175bSopenharmony_ci{
34a8e1175bSopenharmony_ci    memcpy(string, MBEDTLS_VERSION_STRING,
35a8e1175bSopenharmony_ci           sizeof(MBEDTLS_VERSION_STRING));
36a8e1175bSopenharmony_ci}
37a8e1175bSopenharmony_ci
38a8e1175bSopenharmony_civoid mbedtls_version_get_string_full(char *string)
39a8e1175bSopenharmony_ci{
40a8e1175bSopenharmony_ci    memcpy(string, MBEDTLS_VERSION_STRING_FULL,
41a8e1175bSopenharmony_ci           sizeof(MBEDTLS_VERSION_STRING_FULL));
42a8e1175bSopenharmony_ci}
43a8e1175bSopenharmony_ci
44a8e1175bSopenharmony_ci#endif /* MBEDTLS_VERSION_C */
45