Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Version information |
| 3 | * |
Manuel Pégourié-Gonnard | a658a40 | 2015-01-23 09:45:19 +0000 | [diff] [blame] | 4 | * Copyright (C) 2006-2014, ARM Limited, All Rights Reserved |
Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 5 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 6 | * This file is part of mbed TLS (https://tls.mbed.org) |
Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 7 | * |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 8 | * 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é-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 23 | #if !defined(MBEDTLS_CONFIG_FILE) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 24 | #include "mbedtls/config.h" |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 25 | #else |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 26 | #include MBEDTLS_CONFIG_FILE |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 27 | #endif |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 28 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 29 | #if defined(MBEDTLS_VERSION_C) |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 30 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 31 | #include "mbedtls/version.h" |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 32 | #include <string.h> |
| 33 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 34 | unsigned int mbedtls_version_get_number() |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 35 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 36 | return( MBEDTLS_VERSION_NUMBER ); |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 37 | } |
| 38 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 39 | void mbedtls_version_get_string( char *string ) |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 40 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 41 | memcpy( string, MBEDTLS_VERSION_STRING, |
| 42 | sizeof( MBEDTLS_VERSION_STRING ) ); |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 43 | } |
| 44 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 45 | void mbedtls_version_get_string_full( char *string ) |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 46 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 47 | memcpy( string, MBEDTLS_VERSION_STRING_FULL, |
| 48 | sizeof( MBEDTLS_VERSION_STRING_FULL ) ); |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 49 | } |
| 50 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame^] | 51 | #endif /* MBEDTLS_VERSION_C */ |