Modified mbed TLS headers for AES functionality only to reduce build size

Dependents:   BLE_Gateway_Linker_fix BLE_Gateway

Fork of mbedtls by sandbox

Committer:
electronichamsters
Date:
Mon Jul 10 04:00:25 2017 +0000
Revision:
5:f09f5ed830ca
Parent:
1:24750b9ad5ef
working gateway

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Christopher Haster 1:24750b9ad5ef 1 /**
Christopher Haster 1:24750b9ad5ef 2 * \file debug.h
Christopher Haster 1:24750b9ad5ef 3 *
Christopher Haster 1:24750b9ad5ef 4 * \brief Debug functions
Christopher Haster 1:24750b9ad5ef 5 *
Christopher Haster 1:24750b9ad5ef 6 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Christopher Haster 1:24750b9ad5ef 7 * SPDX-License-Identifier: Apache-2.0
Christopher Haster 1:24750b9ad5ef 8 *
Christopher Haster 1:24750b9ad5ef 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
Christopher Haster 1:24750b9ad5ef 10 * not use this file except in compliance with the License.
Christopher Haster 1:24750b9ad5ef 11 * You may obtain a copy of the License at
Christopher Haster 1:24750b9ad5ef 12 *
Christopher Haster 1:24750b9ad5ef 13 * http://www.apache.org/licenses/LICENSE-2.0
Christopher Haster 1:24750b9ad5ef 14 *
Christopher Haster 1:24750b9ad5ef 15 * Unless required by applicable law or agreed to in writing, software
Christopher Haster 1:24750b9ad5ef 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Christopher Haster 1:24750b9ad5ef 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Christopher Haster 1:24750b9ad5ef 18 * See the License for the specific language governing permissions and
Christopher Haster 1:24750b9ad5ef 19 * limitations under the License.
Christopher Haster 1:24750b9ad5ef 20 *
Christopher Haster 1:24750b9ad5ef 21 * This file is part of mbed TLS (https://tls.mbed.org)
Christopher Haster 1:24750b9ad5ef 22 */
Christopher Haster 1:24750b9ad5ef 23 #ifndef MBEDTLS_DEBUG_H
Christopher Haster 1:24750b9ad5ef 24 #define MBEDTLS_DEBUG_H
Christopher Haster 1:24750b9ad5ef 25
Christopher Haster 1:24750b9ad5ef 26 #if !defined(MBEDTLS_CONFIG_FILE)
Christopher Haster 1:24750b9ad5ef 27 #include "config.h"
Christopher Haster 1:24750b9ad5ef 28 #else
Christopher Haster 1:24750b9ad5ef 29 #include MBEDTLS_CONFIG_FILE
Christopher Haster 1:24750b9ad5ef 30 #endif
Christopher Haster 1:24750b9ad5ef 31
Christopher Haster 1:24750b9ad5ef 32 #include "ssl.h"
Christopher Haster 1:24750b9ad5ef 33
Christopher Haster 1:24750b9ad5ef 34 #if defined(MBEDTLS_ECP_C)
Christopher Haster 1:24750b9ad5ef 35 #include "ecp.h"
Christopher Haster 1:24750b9ad5ef 36 #endif
Christopher Haster 1:24750b9ad5ef 37
Christopher Haster 1:24750b9ad5ef 38 #if defined(MBEDTLS_DEBUG_C)
Christopher Haster 1:24750b9ad5ef 39
Christopher Haster 1:24750b9ad5ef 40 #define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__
Christopher Haster 1:24750b9ad5ef 41
Christopher Haster 1:24750b9ad5ef 42 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) \
Christopher Haster 1:24750b9ad5ef 43 mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \
Christopher Haster 1:24750b9ad5ef 44 MBEDTLS_DEBUG_STRIP_PARENS args )
Christopher Haster 1:24750b9ad5ef 45
Christopher Haster 1:24750b9ad5ef 46 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \
Christopher Haster 1:24750b9ad5ef 47 mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )
Christopher Haster 1:24750b9ad5ef 48
Christopher Haster 1:24750b9ad5ef 49 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \
Christopher Haster 1:24750b9ad5ef 50 mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )
Christopher Haster 1:24750b9ad5ef 51
Christopher Haster 1:24750b9ad5ef 52 #if defined(MBEDTLS_BIGNUM_C)
Christopher Haster 1:24750b9ad5ef 53 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \
Christopher Haster 1:24750b9ad5ef 54 mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )
Christopher Haster 1:24750b9ad5ef 55 #endif
Christopher Haster 1:24750b9ad5ef 56
Christopher Haster 1:24750b9ad5ef 57 #if defined(MBEDTLS_ECP_C)
Christopher Haster 1:24750b9ad5ef 58 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \
Christopher Haster 1:24750b9ad5ef 59 mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )
Christopher Haster 1:24750b9ad5ef 60 #endif
Christopher Haster 1:24750b9ad5ef 61
Christopher Haster 1:24750b9ad5ef 62 #if defined(MBEDTLS_X509_CRT_PARSE_C)
Christopher Haster 1:24750b9ad5ef 63 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \
Christopher Haster 1:24750b9ad5ef 64 mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )
Christopher Haster 1:24750b9ad5ef 65 #endif
Christopher Haster 1:24750b9ad5ef 66
Christopher Haster 1:24750b9ad5ef 67 #else /* MBEDTLS_DEBUG_C */
Christopher Haster 1:24750b9ad5ef 68
Christopher Haster 1:24750b9ad5ef 69 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 )
Christopher Haster 1:24750b9ad5ef 70 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
Christopher Haster 1:24750b9ad5ef 71 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )
Christopher Haster 1:24750b9ad5ef 72 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 )
Christopher Haster 1:24750b9ad5ef 73 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
Christopher Haster 1:24750b9ad5ef 74 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
Christopher Haster 1:24750b9ad5ef 75
Christopher Haster 1:24750b9ad5ef 76 #endif /* MBEDTLS_DEBUG_C */
Christopher Haster 1:24750b9ad5ef 77
Christopher Haster 1:24750b9ad5ef 78 #ifdef __cplusplus
Christopher Haster 1:24750b9ad5ef 79 extern "C" {
Christopher Haster 1:24750b9ad5ef 80 #endif
Christopher Haster 1:24750b9ad5ef 81
Christopher Haster 1:24750b9ad5ef 82 /**
Christopher Haster 1:24750b9ad5ef 83 * \brief Set the level threshold to handle globally. Messages that have a
Christopher Haster 1:24750b9ad5ef 84 * level over the threshold value are ignored.
Christopher Haster 1:24750b9ad5ef 85 * (Default value: 0 (No debug))
Christopher Haster 1:24750b9ad5ef 86 *
Christopher Haster 1:24750b9ad5ef 87 * \param threshold maximum level of messages to pass on
Christopher Haster 1:24750b9ad5ef 88 */
Christopher Haster 1:24750b9ad5ef 89 void mbedtls_debug_set_threshold( int threshold );
Christopher Haster 1:24750b9ad5ef 90
Christopher Haster 1:24750b9ad5ef 91 void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level,
Christopher Haster 1:24750b9ad5ef 92 const char *file, int line,
Christopher Haster 1:24750b9ad5ef 93 const char *format, ... );
Christopher Haster 1:24750b9ad5ef 94
Christopher Haster 1:24750b9ad5ef 95 void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level,
Christopher Haster 1:24750b9ad5ef 96 const char *file, int line,
Christopher Haster 1:24750b9ad5ef 97 const char *text, int ret );
Christopher Haster 1:24750b9ad5ef 98
Christopher Haster 1:24750b9ad5ef 99 void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level,
Christopher Haster 1:24750b9ad5ef 100 const char *file, int line, const char *text,
Christopher Haster 1:24750b9ad5ef 101 const unsigned char *buf, size_t len );
Christopher Haster 1:24750b9ad5ef 102
Christopher Haster 1:24750b9ad5ef 103 #if defined(MBEDTLS_BIGNUM_C)
Christopher Haster 1:24750b9ad5ef 104 void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level,
Christopher Haster 1:24750b9ad5ef 105 const char *file, int line,
Christopher Haster 1:24750b9ad5ef 106 const char *text, const mbedtls_mpi *X );
Christopher Haster 1:24750b9ad5ef 107 #endif
Christopher Haster 1:24750b9ad5ef 108
Christopher Haster 1:24750b9ad5ef 109 #if defined(MBEDTLS_ECP_C)
Christopher Haster 1:24750b9ad5ef 110 void mbedtls_debug_print_ecp( const mbedtls_ssl_context *ssl, int level,
Christopher Haster 1:24750b9ad5ef 111 const char *file, int line,
Christopher Haster 1:24750b9ad5ef 112 const char *text, const mbedtls_ecp_point *X );
Christopher Haster 1:24750b9ad5ef 113 #endif
Christopher Haster 1:24750b9ad5ef 114
Christopher Haster 1:24750b9ad5ef 115 #if defined(MBEDTLS_X509_CRT_PARSE_C)
Christopher Haster 1:24750b9ad5ef 116 void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level,
Christopher Haster 1:24750b9ad5ef 117 const char *file, int line,
Christopher Haster 1:24750b9ad5ef 118 const char *text, const mbedtls_x509_crt *crt );
Christopher Haster 1:24750b9ad5ef 119 #endif
Christopher Haster 1:24750b9ad5ef 120
Christopher Haster 1:24750b9ad5ef 121 #ifdef __cplusplus
Christopher Haster 1:24750b9ad5ef 122 }
Christopher Haster 1:24750b9ad5ef 123 #endif
Christopher Haster 1:24750b9ad5ef 124
Christopher Haster 1:24750b9ad5ef 125 #endif /* debug.h */