query_config.fmt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * Query Mbed TLS compile time configurations from config.h
  3. *
  4. * Copyright The Mbed TLS Contributors
  5. * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
  6. *
  7. * This file is provided under the Apache License 2.0, or the
  8. * GNU General Public License v2.0 or later.
  9. *
  10. * **********
  11. * Apache License 2.0:
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  14. * not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * http://www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  21. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. *
  25. * **********
  26. *
  27. * **********
  28. * GNU General Public License v2.0 or later:
  29. *
  30. * This program is free software; you can redistribute it and/or modify
  31. * it under the terms of the GNU General Public License as published by
  32. * the Free Software Foundation; either version 2 of the License, or
  33. * (at your option) any later version.
  34. *
  35. * This program is distributed in the hope that it will be useful,
  36. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. * GNU General Public License for more details.
  39. *
  40. * You should have received a copy of the GNU General Public License along
  41. * with this program; if not, write to the Free Software Foundation, Inc.,
  42. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  43. *
  44. * **********
  45. */
  46. #if !defined(MBEDTLS_CONFIG_FILE)
  47. #include "mbedtls/config.h"
  48. #else
  49. #include MBEDTLS_CONFIG_FILE
  50. #endif
  51. #if defined(MBEDTLS_PLATFORM_C)
  52. #include "mbedtls/platform.h"
  53. #else
  54. #include <stdio.h>
  55. #define mbedtls_printf printf
  56. #endif /* MBEDTLS_PLATFORM_C */
  57. /*
  58. * Include all the headers with public APIs in case they define a macro to its
  59. * default value when that configuration is not set in the config.h.
  60. */
  61. #include "mbedtls/aes.h"
  62. #include "mbedtls/aesni.h"
  63. #include "mbedtls/arc4.h"
  64. #include "mbedtls/aria.h"
  65. #include "mbedtls/asn1.h"
  66. #include "mbedtls/asn1write.h"
  67. #include "mbedtls/base64.h"
  68. #include "mbedtls/bignum.h"
  69. #include "mbedtls/blowfish.h"
  70. #include "mbedtls/camellia.h"
  71. #include "mbedtls/ccm.h"
  72. #include "mbedtls/certs.h"
  73. #include "mbedtls/chacha20.h"
  74. #include "mbedtls/chachapoly.h"
  75. #include "mbedtls/cipher.h"
  76. #include "mbedtls/cmac.h"
  77. #include "mbedtls/ctr_drbg.h"
  78. #include "mbedtls/debug.h"
  79. #include "mbedtls/des.h"
  80. #include "mbedtls/dhm.h"
  81. #include "mbedtls/ecdh.h"
  82. #include "mbedtls/ecdsa.h"
  83. #include "mbedtls/ecjpake.h"
  84. #include "mbedtls/ecp.h"
  85. #include "mbedtls/entropy.h"
  86. #include "mbedtls/entropy_poll.h"
  87. #include "mbedtls/error.h"
  88. #include "mbedtls/gcm.h"
  89. #include "mbedtls/havege.h"
  90. #include "mbedtls/hkdf.h"
  91. #include "mbedtls/hmac_drbg.h"
  92. #include "mbedtls/md.h"
  93. #include "mbedtls/md2.h"
  94. #include "mbedtls/md4.h"
  95. #include "mbedtls/md5.h"
  96. #include "mbedtls/memory_buffer_alloc.h"
  97. #include "mbedtls/net_sockets.h"
  98. #include "mbedtls/nist_kw.h"
  99. #include "mbedtls/oid.h"
  100. #include "mbedtls/padlock.h"
  101. #include "mbedtls/pem.h"
  102. #include "mbedtls/pk.h"
  103. #include "mbedtls/pkcs11.h"
  104. #include "mbedtls/pkcs12.h"
  105. #include "mbedtls/pkcs5.h"
  106. #include "mbedtls/platform_time.h"
  107. #include "mbedtls/platform_util.h"
  108. #include "mbedtls/poly1305.h"
  109. #include "mbedtls/ripemd160.h"
  110. #include "mbedtls/rsa.h"
  111. #include "mbedtls/sha1.h"
  112. #include "mbedtls/sha256.h"
  113. #include "mbedtls/sha512.h"
  114. #include "mbedtls/ssl.h"
  115. #include "mbedtls/ssl_cache.h"
  116. #include "mbedtls/ssl_ciphersuites.h"
  117. #include "mbedtls/ssl_cookie.h"
  118. #include "mbedtls/ssl_internal.h"
  119. #include "mbedtls/ssl_ticket.h"
  120. #include "mbedtls/threading.h"
  121. #include "mbedtls/timing.h"
  122. #include "mbedtls/version.h"
  123. #include "mbedtls/x509.h"
  124. #include "mbedtls/x509_crl.h"
  125. #include "mbedtls/x509_crt.h"
  126. #include "mbedtls/x509_csr.h"
  127. #include "mbedtls/xtea.h"
  128. #include <string.h>
  129. /*
  130. * Helper macros to convert a macro or its expansion into a string
  131. * WARNING: This does not work for expanding function-like macros. However,
  132. * Mbed TLS does not currently have configuration options used in this fashion.
  133. */
  134. #define MACRO_EXPANSION_TO_STR(macro) MACRO_NAME_TO_STR(macro)
  135. #define MACRO_NAME_TO_STR(macro) \
  136. mbedtls_printf( "%s", strlen( #macro "" ) > 0 ? #macro "\n" : "" )
  137. #if defined(_MSC_VER)
  138. /*
  139. * Visual Studio throws the warning 4003 because many Mbed TLS feature macros
  140. * are defined empty. This means that from the preprocessor's point of view
  141. * the macro MBEDTLS_EXPANSION_TO_STR is being invoked without arguments as
  142. * some macros expand to nothing. We suppress that specific warning to get a
  143. * clean build and to ensure that tests treating warnings as errors do not
  144. * fail.
  145. */
  146. #pragma warning(push)
  147. #pragma warning(disable:4003)
  148. #endif /* _MSC_VER */
  149. int query_config( const char *config )
  150. {
  151. CHECK_CONFIG /* If the symbol is not found, return an error */
  152. return( 1 );
  153. }
  154. #if defined(_MSC_VER)
  155. #pragma warning(pop)
  156. #endif /* _MSC_VER */