version.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Version information
  3. *
  4. * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
  5. * SPDX-License-Identifier: GPL-2.0
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * This file is part of mbed TLS (https://tls.mbed.org)
  22. */
  23. #if !defined(MBEDTLS_CONFIG_FILE)
  24. #include "mbedtls/config.h"
  25. #else
  26. #include MBEDTLS_CONFIG_FILE
  27. #endif
  28. #if defined(MBEDTLS_VERSION_C)
  29. #include "mbedtls/version.h"
  30. #include <string.h>
  31. unsigned int mbedtls_version_get_number()
  32. {
  33. return( MBEDTLS_VERSION_NUMBER );
  34. }
  35. void mbedtls_version_get_string( char *string )
  36. {
  37. memcpy( string, MBEDTLS_VERSION_STRING,
  38. sizeof( MBEDTLS_VERSION_STRING ) );
  39. }
  40. void mbedtls_version_get_string_full( char *string )
  41. {
  42. memcpy( string, MBEDTLS_VERSION_STRING_FULL,
  43. sizeof( MBEDTLS_VERSION_STRING_FULL ) );
  44. }
  45. #endif /* MBEDTLS_VERSION_C */