blob: 4e881f0a74b01a2ef433aac1714dc85936735b82 [file] [log] [blame]
Paul Bakker3ac1b2d2010-06-18 22:47:29 +00001/*
2 * Version information
3 *
Manuel Pégourié-Gonnarda658a402015-01-23 09:45:19 +00004 * Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
Paul Bakkerb96f1542010-07-18 20:36:00 +00005 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +00006 * This file is part of mbed TLS (https://tls.mbed.org)
Paul Bakkerb96f1542010-07-18 20:36:00 +00007 *
Paul Bakker3ac1b2d2010-06-18 22:47:29 +00008 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020023#if !defined(MBEDTLS_CONFIG_FILE)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000024#include "mbedtls/config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020025#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020026#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020027#endif
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000028
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020029#if defined(MBEDTLS_VERSION_C)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000030
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000031#include "mbedtls/version.h"
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000032#include <string.h>
33
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020034unsigned int mbedtls_version_get_number()
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000035{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020036 return( MBEDTLS_VERSION_NUMBER );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000037}
38
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020039void mbedtls_version_get_string( char *string )
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000040{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020041 memcpy( string, MBEDTLS_VERSION_STRING,
42 sizeof( MBEDTLS_VERSION_STRING ) );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000043}
44
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020045void mbedtls_version_get_string_full( char *string )
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000046{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020047 memcpy( string, MBEDTLS_VERSION_STRING_FULL,
48 sizeof( MBEDTLS_VERSION_STRING_FULL ) );
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000049}
50
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020051#endif /* MBEDTLS_VERSION_C */