blob: d17744922012c7c6413054d32b7ffec1f04b0f12 [file] [log] [blame]
Paul Bakker747a83a2014-02-01 22:50:07 +01001/*
2 * Platform abstraction layer
3 *
Paul Bakkere021a4b2016-06-01 11:25:44 +01004 * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02005 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
Paul Bakker747a83a2014-02-01 22:50:07 +010018 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000019 * This file is part of mbed TLS (https://tls.mbed.org)
Paul Bakker747a83a2014-02-01 22:50:07 +010020 */
21
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020022#if !defined(MBEDTLS_CONFIG_FILE)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000023#include "mbedtls/config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020024#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020025#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020026#endif
Paul Bakker747a83a2014-02-01 22:50:07 +010027
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020028#if defined(MBEDTLS_PLATFORM_C)
Paul Bakker747a83a2014-02-01 22:50:07 +010029
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000030#include "mbedtls/platform.h"
Paul Bakker747a83a2014-02-01 22:50:07 +010031
Manuel Pégourié-Gonnarda268da92017-12-20 12:52:49 +010032#if defined(MBEDTLS_ENTROPY_NV_SEED) && \
33 !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO)
34/* Implementation that should never be optimized out by the compiler */
35static void mbedtls_zeroize( void *v, size_t n ) {
36 volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0;
37}
38#endif
39
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020040#if defined(MBEDTLS_PLATFORM_MEMORY)
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +020041#if !defined(MBEDTLS_PLATFORM_STD_CALLOC)
42static void *platform_calloc_uninit( size_t n, size_t size )
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010043{
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +020044 ((void) n);
45 ((void) size);
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010046 return( NULL );
47}
48
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +020049#define MBEDTLS_PLATFORM_STD_CALLOC platform_calloc_uninit
50#endif /* !MBEDTLS_PLATFORM_STD_CALLOC */
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010051
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020052#if !defined(MBEDTLS_PLATFORM_STD_FREE)
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010053static void platform_free_uninit( void *ptr )
54{
55 ((void) ptr);
56}
57
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020058#define MBEDTLS_PLATFORM_STD_FREE platform_free_uninit
59#endif /* !MBEDTLS_PLATFORM_STD_FREE */
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010060
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +020061void * (*mbedtls_calloc)( size_t, size_t ) = MBEDTLS_PLATFORM_STD_CALLOC;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020062void (*mbedtls_free)( void * ) = MBEDTLS_PLATFORM_STD_FREE;
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010063
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +020064int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ),
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010065 void (*free_func)( void * ) )
66{
Manuel Pégourié-Gonnardb9ef1182015-05-26 16:15:20 +020067 mbedtls_calloc = calloc_func;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020068 mbedtls_free = free_func;
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010069 return( 0 );
70}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020071#endif /* MBEDTLS_PLATFORM_MEMORY */
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010072
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +020073#if defined(_WIN32)
74#include <stdarg.h>
75int mbedtls_platform_win32_snprintf( char *s, size_t n, const char *fmt, ... )
76{
77 int ret;
78 va_list argp;
79
Manuel Pégourié-Gonnardf659d2c2015-06-26 17:45:00 +020080 /* Avoid calling the invalid parameter handler by checking ourselves */
81 if( s == NULL || n == 0 || fmt == NULL )
82 return( -1 );
83
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +020084 va_start( argp, fmt );
Ron Eldorbc18eb32017-09-06 17:49:10 +030085#if defined(_TRUNCATE) && !defined(__MINGW32__)
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +020086 ret = _vsnprintf_s( s, n, _TRUNCATE, fmt, argp );
Manuel Pégourié-Gonnarda4f055f2015-07-08 16:46:13 +020087#else
88 ret = _vsnprintf( s, n, fmt, argp );
89 if( ret < 0 || (size_t) ret == n )
90 {
91 s[n-1] = '\0';
92 ret = -1;
93 }
94#endif
Manuel Pégourié-Gonnard6c0c8e02015-06-22 10:23:34 +020095 va_end( argp );
96
97 return( ret );
98}
99#endif
100
Krzysztof Stachowiak25d34a42018-03-20 16:17:51 +0100101#if defined(MBEDTLS_PLATFORM_TF_SNPRINTF)
102
103static void unsigned_dec_print( char **s, size_t n, size_t *chars_printed,
104 unsigned int unum )
105{
106 /* Enough for a 32-bit unsigned decimal integer (4294967295). */
107 unsigned char num_buf[10];
108 int i = 0, rem;
109
110 do
111 {
112 rem = unum % 10;
113 num_buf[i++] = '0' + rem;
114 } while( unum /= 10 );
115
116 while( --i >= 0 )
117 {
118 if( *chars_printed < n )
119 *(*s)++ = num_buf[i];
120 (*chars_printed)++;
121 }
122}
123
124int tf_snprintf( char *s, size_t n, const char *fmt, ... )
125{
126 va_list args;
127 int num;
128 unsigned int unum;
129 size_t chars_printed = 0;
130
131 if( n == 1 )
132 {
133 /* Buffer is too small to actually write anything else. */
134 *s = '\0';
135 n = 0;
136 }
137 else if( n >= 2 )
138 {
139 /* Reserve space for the terminator character. */
140 n--;
141 }
142
143 va_start( args, fmt );
144 while( *fmt ) {
145
146 if( *fmt == '%' )
147 {
148 fmt++;
149 /* Check the format specifier. */
150 switch( *fmt )
151 {
152 case 'i':
153 case 'd':
154 num = va_arg( args, int );
155
156 if( num < 0 )
157 {
158 if( chars_printed < n )
159 *s++ = '-';
160 chars_printed++;
161
162 unum = (unsigned int)-num;
163 }
164 else
165 {
166 unum = (unsigned int)num;
167 }
168
169 unsigned_dec_print( &s, n, &chars_printed, unum );
170 break;
171 case 'u':
172 unum = va_arg( args, unsigned int );
173 unsigned_dec_print( &s, n, &chars_printed, unum );
174 break;
175 default:
176 /* Return error on any other specifier. */
177 chars_printed = -1;
178 goto exit;
179 }
180 fmt++;
181 continue;
182 }
183
184 if( chars_printed < n )
185 *s++ = *fmt;
186 fmt++;
187 chars_printed++;
188 }
189
190exit:
191 va_end( args );
192
193 if( n > 0 )
194 *s = '\0';
195
196 return( chars_printed );
197}
198
199#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF)
200#undef MBEDTLS_PLATFORM_STD_SNPRINTF
201#endif
202#define MBEDTLS_PLATFORM_STD_SNPRINTF tf_snprintf;
203
204#endif /* MBEDTLS_PLATFORM_TF_SNPRINTF */
205
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200206#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
207#if !defined(MBEDTLS_PLATFORM_STD_SNPRINTF)
Rich Evans46b0a8d2015-01-30 10:47:32 +0000208/*
209 * Make dummy function to prevent NULL pointer dereferences
210 */
211static int platform_snprintf_uninit( char * s, size_t n,
212 const char * format, ... )
213{
214 ((void) s);
215 ((void) n);
Manuel Pégourié-Gonnarddccb80b2015-06-03 10:20:33 +0100216 ((void) format);
Rich Evans46b0a8d2015-01-30 10:47:32 +0000217 return( 0 );
218}
219
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200220#define MBEDTLS_PLATFORM_STD_SNPRINTF platform_snprintf_uninit
221#endif /* !MBEDTLS_PLATFORM_STD_SNPRINTF */
Rich Evans46b0a8d2015-01-30 10:47:32 +0000222
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200223int (*mbedtls_snprintf)( char * s, size_t n,
Rich Evans46b0a8d2015-01-30 10:47:32 +0000224 const char * format,
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200225 ... ) = MBEDTLS_PLATFORM_STD_SNPRINTF;
Rich Evans46b0a8d2015-01-30 10:47:32 +0000226
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200227int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n,
Rich Evans46b0a8d2015-01-30 10:47:32 +0000228 const char * format,
229 ... ) )
230{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200231 mbedtls_snprintf = snprintf_func;
Rich Evans46b0a8d2015-01-30 10:47:32 +0000232 return( 0 );
233}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200234#endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */
Rich Evans46b0a8d2015-01-30 10:47:32 +0000235
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200236#if defined(MBEDTLS_PLATFORM_PRINTF_ALT)
237#if !defined(MBEDTLS_PLATFORM_STD_PRINTF)
Paul Bakker747a83a2014-02-01 22:50:07 +0100238/*
239 * Make dummy function to prevent NULL pointer dereferences
240 */
241static int platform_printf_uninit( const char *format, ... )
242{
243 ((void) format);
244 return( 0 );
245}
246
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200247#define MBEDTLS_PLATFORM_STD_PRINTF platform_printf_uninit
248#endif /* !MBEDTLS_PLATFORM_STD_PRINTF */
Paul Bakker747a83a2014-02-01 22:50:07 +0100249
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200250int (*mbedtls_printf)( const char *, ... ) = MBEDTLS_PLATFORM_STD_PRINTF;
Paul Bakker747a83a2014-02-01 22:50:07 +0100251
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200252int mbedtls_platform_set_printf( int (*printf_func)( const char *, ... ) )
Paul Bakker747a83a2014-02-01 22:50:07 +0100253{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200254 mbedtls_printf = printf_func;
Paul Bakker747a83a2014-02-01 22:50:07 +0100255 return( 0 );
256}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200257#endif /* MBEDTLS_PLATFORM_PRINTF_ALT */
Paul Bakker747a83a2014-02-01 22:50:07 +0100258
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200259#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
260#if !defined(MBEDTLS_PLATFORM_STD_FPRINTF)
Paul Bakker747a83a2014-02-01 22:50:07 +0100261/*
262 * Make dummy function to prevent NULL pointer dereferences
263 */
264static int platform_fprintf_uninit( FILE *stream, const char *format, ... )
265{
266 ((void) stream);
267 ((void) format);
268 return( 0 );
269}
270
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200271#define MBEDTLS_PLATFORM_STD_FPRINTF platform_fprintf_uninit
272#endif /* !MBEDTLS_PLATFORM_STD_FPRINTF */
Paul Bakker747a83a2014-02-01 22:50:07 +0100273
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200274int (*mbedtls_fprintf)( FILE *, const char *, ... ) =
275 MBEDTLS_PLATFORM_STD_FPRINTF;
Paul Bakker747a83a2014-02-01 22:50:07 +0100276
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200277int mbedtls_platform_set_fprintf( int (*fprintf_func)( FILE *, const char *, ... ) )
Paul Bakker747a83a2014-02-01 22:50:07 +0100278{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200279 mbedtls_fprintf = fprintf_func;
Paul Bakker747a83a2014-02-01 22:50:07 +0100280 return( 0 );
281}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200282#endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */
Paul Bakker747a83a2014-02-01 22:50:07 +0100283
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200284#if defined(MBEDTLS_PLATFORM_EXIT_ALT)
285#if !defined(MBEDTLS_PLATFORM_STD_EXIT)
Rich Evansc39cb492015-01-30 12:01:34 +0000286/*
287 * Make dummy function to prevent NULL pointer dereferences
288 */
289static void platform_exit_uninit( int status )
290{
291 ((void) status);
Rich Evansc39cb492015-01-30 12:01:34 +0000292}
293
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200294#define MBEDTLS_PLATFORM_STD_EXIT platform_exit_uninit
295#endif /* !MBEDTLS_PLATFORM_STD_EXIT */
Rich Evansc39cb492015-01-30 12:01:34 +0000296
Manuel Pégourié-Gonnard7ee5ddd2015-06-03 10:33:55 +0100297void (*mbedtls_exit)( int status ) = MBEDTLS_PLATFORM_STD_EXIT;
Rich Evansc39cb492015-01-30 12:01:34 +0000298
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200299int mbedtls_platform_set_exit( void (*exit_func)( int status ) )
Rich Evansc39cb492015-01-30 12:01:34 +0000300{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200301 mbedtls_exit = exit_func;
Rich Evansc39cb492015-01-30 12:01:34 +0000302 return( 0 );
303}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200304#endif /* MBEDTLS_PLATFORM_EXIT_ALT */
Rich Evansc39cb492015-01-30 12:01:34 +0000305
Simon Butcher23e97782016-07-13 13:31:08 +0100306#if defined(MBEDTLS_HAVE_TIME)
307
SimonBd5800b72016-04-26 07:43:27 +0100308#if defined(MBEDTLS_PLATFORM_TIME_ALT)
309#if !defined(MBEDTLS_PLATFORM_STD_TIME)
310/*
311 * Make dummy function to prevent NULL pointer dereferences
312 */
313static mbedtls_time_t platform_time_uninit( mbedtls_time_t* timer )
314{
315 ((void) timer);
Simon Butcher3fe6cd32016-04-26 19:51:29 +0100316 return( 0 );
SimonBd5800b72016-04-26 07:43:27 +0100317}
318
319#define MBEDTLS_PLATFORM_STD_TIME platform_time_uninit
320#endif /* !MBEDTLS_PLATFORM_STD_TIME */
321
Simon Butcher3fe6cd32016-04-26 19:51:29 +0100322mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* timer ) = MBEDTLS_PLATFORM_STD_TIME;
SimonBd5800b72016-04-26 07:43:27 +0100323
Simon Butcher3fe6cd32016-04-26 19:51:29 +0100324int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* timer ) )
SimonBd5800b72016-04-26 07:43:27 +0100325{
326 mbedtls_time = time_func;
327 return( 0 );
328}
329#endif /* MBEDTLS_PLATFORM_TIME_ALT */
330
Simon Butcher23e97782016-07-13 13:31:08 +0100331#endif /* MBEDTLS_HAVE_TIME */
332
Paul Bakkere021a4b2016-06-01 11:25:44 +0100333#if defined(MBEDTLS_ENTROPY_NV_SEED)
334#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO)
335/* Default implementations for the platform independent seed functions use
336 * standard libc file functions to read from and write to a pre-defined filename
337 */
338int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len )
339{
340 FILE *file;
341 size_t n;
342
343 if( ( file = fopen( MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "rb" ) ) == NULL )
Andres Amaya Garcia79a2e7e2017-06-26 11:10:22 +0100344 return( -1 );
Paul Bakkere021a4b2016-06-01 11:25:44 +0100345
346 if( ( n = fread( buf, 1, buf_len, file ) ) != buf_len )
347 {
348 fclose( file );
Andres Amaya Garcia79a2e7e2017-06-26 11:10:22 +0100349 mbedtls_zeroize( buf, buf_len );
350 return( -1 );
Paul Bakkere021a4b2016-06-01 11:25:44 +0100351 }
352
353 fclose( file );
Simon B3249cb72016-11-03 01:11:37 +0000354 return( (int)n );
Paul Bakkere021a4b2016-06-01 11:25:44 +0100355}
356
357int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len )
358{
359 FILE *file;
360 size_t n;
361
362 if( ( file = fopen( MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "w" ) ) == NULL )
363 return -1;
364
365 if( ( n = fwrite( buf, 1, buf_len, file ) ) != buf_len )
366 {
367 fclose( file );
368 return -1;
369 }
370
371 fclose( file );
Simon B3249cb72016-11-03 01:11:37 +0000372 return( (int)n );
Paul Bakkere021a4b2016-06-01 11:25:44 +0100373}
374#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */
375
376#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
377#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ)
378/*
379 * Make dummy function to prevent NULL pointer dereferences
380 */
381static int platform_nv_seed_read_uninit( unsigned char *buf, size_t buf_len )
382{
383 ((void) buf);
384 ((void) buf_len);
385 return( -1 );
386}
387
388#define MBEDTLS_PLATFORM_STD_NV_SEED_READ platform_nv_seed_read_uninit
389#endif /* !MBEDTLS_PLATFORM_STD_NV_SEED_READ */
390
391#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE)
392/*
393 * Make dummy function to prevent NULL pointer dereferences
394 */
395static int platform_nv_seed_write_uninit( unsigned char *buf, size_t buf_len )
396{
397 ((void) buf);
398 ((void) buf_len);
399 return( -1 );
400}
401
402#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE platform_nv_seed_write_uninit
403#endif /* !MBEDTLS_PLATFORM_STD_NV_SEED_WRITE */
404
405int (*mbedtls_nv_seed_read)( unsigned char *buf, size_t buf_len ) =
406 MBEDTLS_PLATFORM_STD_NV_SEED_READ;
407int (*mbedtls_nv_seed_write)( unsigned char *buf, size_t buf_len ) =
408 MBEDTLS_PLATFORM_STD_NV_SEED_WRITE;
409
410int mbedtls_platform_set_nv_seed(
411 int (*nv_seed_read_func)( unsigned char *buf, size_t buf_len ),
412 int (*nv_seed_write_func)( unsigned char *buf, size_t buf_len ) )
413{
414 mbedtls_nv_seed_read = nv_seed_read_func;
415 mbedtls_nv_seed_write = nv_seed_write_func;
416 return( 0 );
417}
418#endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */
419#endif /* MBEDTLS_ENTROPY_NV_SEED */
420
Andres Amaya Garciad91f99f2017-07-18 10:23:04 +0100421#if !defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT)
Andres Amaya Garcia2a6f39c2017-07-07 13:03:23 +0100422/*
Andres Amaya Garcia3c8a39d2017-07-12 11:25:17 +0100423 * Placeholder platform setup that does nothing by default
Andres Amaya Garcia2a6f39c2017-07-07 13:03:23 +0100424 */
Andres Amaya Garcia3c8a39d2017-07-12 11:25:17 +0100425int mbedtls_platform_setup( mbedtls_platform_context *ctx )
Andres Amaya Garcia2a6f39c2017-07-07 13:03:23 +0100426{
427 (void)ctx;
428
429 return( 0 );
430}
431
432/*
Andres Amaya Garcia3c8a39d2017-07-12 11:25:17 +0100433 * Placeholder platform teardown that does nothing by default
Andres Amaya Garcia2a6f39c2017-07-07 13:03:23 +0100434 */
Andres Amaya Garcia3c8a39d2017-07-12 11:25:17 +0100435void mbedtls_platform_teardown( mbedtls_platform_context *ctx )
Andres Amaya Garcia2a6f39c2017-07-07 13:03:23 +0100436{
437 (void)ctx;
438}
Andres Amaya Garciad91f99f2017-07-18 10:23:04 +0100439#endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */
Andres Amaya Garcia2a6f39c2017-07-07 13:03:23 +0100440
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200441#endif /* MBEDTLS_PLATFORM_C */