blob: fd967508850b5fa739caf935d6eb84648367ea56 [file] [log] [blame]
Paul Bakker3ac1b2d2010-06-18 22:47:29 +00001/*
2 * Version information
3 *
Manuel Pégourié-Gonnard6fb81872015-07-27 11:11:48 +02004 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02005 * 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.
Paul Bakkerb96f1542010-07-18 20:36:00 +000018 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000019 * This file is part of mbed TLS (https://tls.mbed.org)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000020 */
21
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020022#if !defined(MBEDTLS_CONFIG_FILE)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000023#include "mbedtls/config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020024#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020025#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020026#endif
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000027
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020028#if defined(MBEDTLS_VERSION_C)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000029
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000030#include "mbedtls/version.h"
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000031#include <string.h>
32
Joris Aertse75b88d2016-11-04 23:05:56 +010033unsigned int mbedtls_version_get_number( void )
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000034{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020035 return( MBEDTLS_VERSION_NUMBER );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000036}
37
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020038void mbedtls_version_get_string( char *string )
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000039{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020040 memcpy( string, MBEDTLS_VERSION_STRING,
41 sizeof( MBEDTLS_VERSION_STRING ) );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000042}
43
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020044void mbedtls_version_get_string_full( char *string )
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000045{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020046 memcpy( string, MBEDTLS_VERSION_STRING_FULL,
47 sizeof( MBEDTLS_VERSION_STRING_FULL ) );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000048}
49
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020050#endif /* MBEDTLS_VERSION_C */