blob: 42039024acbf3d7f31158493b49856b010926f4d [file] [log] [blame]
Paul Bakkered56b222011-07-13 11:26:43 +00001/*
2 * Key reading application
3 *
Bence Szépkúti1e148272020-08-07 13:07:28 +02004 * Copyright The Mbed TLS Contributors
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 Bakkered56b222011-07-13 11:26:43 +000018 */
19
Bence Szépkútic662b362021-05-27 11:25:03 +020020#include "mbedtls/build_info.h"
Paul Bakkered56b222011-07-13 11:26:43 +000021
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020022#if defined(MBEDTLS_PLATFORM_C)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000023#include "mbedtls/platform.h"
Rich Evansf90016a2015-01-19 14:26:37 +000024#else
Rich Evans18b78c72015-02-11 14:06:19 +000025#include <stdio.h>
Andres Amaya Garcia0faf1a52018-04-29 20:02:18 +010026#include <stdlib.h>
27#define mbedtls_printf printf
Manuel Pégourié-Gonnard3ef6a6d2018-12-10 14:31:45 +010028#define mbedtls_exit exit
Andres Amaya Garcia7d429652018-04-30 22:42:33 +010029#define MBEDTLS_EXIT_SUCCESS EXIT_SUCCESS
Andres Amaya Garcia0faf1a52018-04-29 20:02:18 +010030#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
31#endif /* MBEDTLS_PLATFORM_C */
Rich Evansf90016a2015-01-19 14:26:37 +000032
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020033#if defined(MBEDTLS_BIGNUM_C) && \
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +020034 defined(MBEDTLS_PK_PARSE_C) && defined(MBEDTLS_FS_IO) && \
35 defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_CTR_DRBG_C)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000036#include "mbedtls/error.h"
37#include "mbedtls/rsa.h"
Jaeden Ameroed736992018-10-26 16:55:14 +010038#include "mbedtls/pk.h"
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +020039#include "mbedtls/entropy.h"
40#include "mbedtls/ctr_drbg.h"
Manuel Pégourié-Gonnard84dea012021-06-15 11:29:26 +020041
Rich Evans18b78c72015-02-11 14:06:19 +000042#include <string.h>
43#endif
44
45#define MODE_NONE 0
46#define MODE_PRIVATE 1
47#define MODE_PUBLIC 2
48
49#define DFL_MODE MODE_NONE
50#define DFL_FILENAME "keyfile.key"
51#define DFL_PASSWORD ""
52#define DFL_PASSWORD_FILE ""
53#define DFL_DEBUG_LEVEL 0
Manuel Pégourié-Gonnard6c5abfa2015-02-13 14:12:07 +000054
Rich Evans18b78c72015-02-11 14:06:19 +000055#define USAGE \
56 "\n usage: key_app param=<>...\n" \
57 "\n acceptable parameters:\n" \
58 " mode=private|public default: none\n" \
59 " filename=%%s default: keyfile.key\n" \
60 " password=%%s default: \"\"\n" \
61 " password_file=%%s default: \"\"\n" \
62 "\n"
63
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020064#if !defined(MBEDTLS_BIGNUM_C) || \
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +020065 !defined(MBEDTLS_PK_PARSE_C) || !defined(MBEDTLS_FS_IO) || \
66 !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_CTR_DRBG_C)
Rich Evans85b05ec2015-02-12 11:37:29 +000067int main( void )
Paul Bakker15254952013-09-17 11:24:56 +020068{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020069 mbedtls_printf("MBEDTLS_BIGNUM_C and/or "
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +020070 "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or "
71 "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C not defined.\n");
Krzysztof Stachowiak5e1b1952019-04-24 14:24:46 +020072 mbedtls_exit( 0 );
Paul Bakker15254952013-09-17 11:24:56 +020073}
74#else
Simon Butcher63cb97e2018-12-06 17:43:31 +000075
Simon Butcher63cb97e2018-12-06 17:43:31 +000076
Paul Bakkered56b222011-07-13 11:26:43 +000077/*
78 * global options
79 */
80struct options
81{
82 int mode; /* the mode to run the application in */
Paul Bakkeref3f8c72013-06-24 13:01:08 +020083 const char *filename; /* filename of the key file */
84 const char *password; /* password for the private key */
85 const char *password_file; /* password_file for the private key */
Paul Bakkered56b222011-07-13 11:26:43 +000086} opt;
87
Paul Bakkered56b222011-07-13 11:26:43 +000088int main( int argc, char *argv[] )
89{
Andres Amaya Garcia0faf1a52018-04-29 20:02:18 +010090 int ret = 1;
91 int exit_code = MBEDTLS_EXIT_FAILURE;
Paul Bakkered56b222011-07-13 11:26:43 +000092 char buf[1024];
Paul Bakkerdb2509c2012-09-27 12:44:31 +000093 int i;
Paul Bakkered56b222011-07-13 11:26:43 +000094 char *p, *q;
95
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +020096 const char *pers = "pkey/key_app";
97 mbedtls_entropy_context entropy;
98 mbedtls_ctr_drbg_context ctr_drbg;
99
Hanno Becker54ebf992017-08-23 06:45:38 +0100100 mbedtls_pk_context pk;
101 mbedtls_mpi N, P, Q, D, E, DP, DQ, QP;
102
Paul Bakkered56b222011-07-13 11:26:43 +0000103 /*
104 * Set to sane values
105 */
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +0200106 mbedtls_entropy_init( &entropy );
107 mbedtls_ctr_drbg_init( &ctr_drbg );
108
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200109 mbedtls_pk_init( &pk );
Paul Bakker2e24ca72013-09-18 15:21:27 +0200110 memset( buf, 0, sizeof(buf) );
Paul Bakkered56b222011-07-13 11:26:43 +0000111
Hanno Becker54ebf992017-08-23 06:45:38 +0100112 mbedtls_mpi_init( &N ); mbedtls_mpi_init( &P ); mbedtls_mpi_init( &Q );
113 mbedtls_mpi_init( &D ); mbedtls_mpi_init( &E ); mbedtls_mpi_init( &DP );
114 mbedtls_mpi_init( &DQ ); mbedtls_mpi_init( &QP );
115
Paul Bakkered56b222011-07-13 11:26:43 +0000116 if( argc == 0 )
117 {
118 usage:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200119 mbedtls_printf( USAGE );
Ron Eldor6a9257b2017-08-24 14:20:17 +0300120 goto cleanup;
Paul Bakkered56b222011-07-13 11:26:43 +0000121 }
122
123 opt.mode = DFL_MODE;
124 opt.filename = DFL_FILENAME;
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000125 opt.password = DFL_PASSWORD;
126 opt.password_file = DFL_PASSWORD_FILE;
Paul Bakkered56b222011-07-13 11:26:43 +0000127
128 for( i = 1; i < argc; i++ )
129 {
Paul Bakkered56b222011-07-13 11:26:43 +0000130 p = argv[i];
131 if( ( q = strchr( p, '=' ) ) == NULL )
132 goto usage;
133 *q++ = '\0';
134
135 if( strcmp( p, "mode" ) == 0 )
136 {
137 if( strcmp( q, "private" ) == 0 )
138 opt.mode = MODE_PRIVATE;
139 else if( strcmp( q, "public" ) == 0 )
140 opt.mode = MODE_PUBLIC;
141 else
142 goto usage;
143 }
144 else if( strcmp( p, "filename" ) == 0 )
145 opt.filename = q;
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000146 else if( strcmp( p, "password" ) == 0 )
147 opt.password = q;
148 else if( strcmp( p, "password_file" ) == 0 )
149 opt.password_file = q;
Paul Bakkered56b222011-07-13 11:26:43 +0000150 else
151 goto usage;
152 }
153
154 if( opt.mode == MODE_PRIVATE )
155 {
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000156 if( strlen( opt.password ) && strlen( opt.password_file ) )
157 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200158 mbedtls_printf( "Error: cannot have both password and password_file\n" );
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000159 goto usage;
160 }
161
162 if( strlen( opt.password_file ) )
163 {
164 FILE *f;
165
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200166 mbedtls_printf( "\n . Loading the password file ..." );
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000167 if( ( f = fopen( opt.password_file, "rb" ) ) == NULL )
168 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200169 mbedtls_printf( " failed\n ! fopen returned NULL\n" );
Ron Eldor6a9257b2017-08-24 14:20:17 +0300170 goto cleanup;
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000171 }
Paul Bakker8a0c0a92014-04-17 16:08:20 +0200172 if( fgets( buf, sizeof(buf), f ) == NULL )
173 {
174 fclose( f );
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200175 mbedtls_printf( "Error: fgets() failed to retrieve password\n" );
Ron Eldor6a9257b2017-08-24 14:20:17 +0300176 goto cleanup;
Paul Bakker8a0c0a92014-04-17 16:08:20 +0200177 }
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000178 fclose( f );
179
Paul Bakker840ab202013-11-30 15:14:38 +0100180 i = (int) strlen( buf );
Paul Bakkerdb2509c2012-09-27 12:44:31 +0000181 if( buf[i - 1] == '\n' ) buf[i - 1] = '\0';
182 if( buf[i - 2] == '\r' ) buf[i - 2] = '\0';
183 opt.password = buf;
184 }
185
Paul Bakkered56b222011-07-13 11:26:43 +0000186 /*
187 * 1.1. Load the key
188 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200189 mbedtls_printf( "\n . Loading the private key ..." );
Paul Bakkered56b222011-07-13 11:26:43 +0000190 fflush( stdout );
191
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +0200192 if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy,
193 (const unsigned char *) pers,
194 strlen( pers ) ) ) != 0 )
195 {
196 mbedtls_printf( " failed\n ! mbedtls_ctr_drbg_seed returned -0x%04x\n", (unsigned int) -ret );
197 goto cleanup;
198 }
199
Manuel Pégourié-Gonnard84dea012021-06-15 11:29:26 +0200200 ret = mbedtls_pk_parse_keyfile( &pk, opt.filename, opt.password,
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +0200201 mbedtls_ctr_drbg_random, &ctr_drbg );
Paul Bakkered56b222011-07-13 11:26:43 +0000202
203 if( ret != 0 )
204 {
Kenneth Soerensen518d4352020-04-01 17:22:45 +0200205 mbedtls_printf( " failed\n ! mbedtls_pk_parse_keyfile returned -0x%04x\n", (unsigned int) -ret );
Ron Eldor6a9257b2017-08-24 14:20:17 +0300206 goto cleanup;
Paul Bakkered56b222011-07-13 11:26:43 +0000207 }
208
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200209 mbedtls_printf( " ok\n" );
Paul Bakkered56b222011-07-13 11:26:43 +0000210
211 /*
212 * 1.2 Print the key
213 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200214 mbedtls_printf( " . Key information ...\n" );
215#if defined(MBEDTLS_RSA_C)
216 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA )
Paul Bakker15254952013-09-17 11:24:56 +0200217 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200218 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk );
Hanno Becker54ebf992017-08-23 06:45:38 +0100219
220 if( ( ret = mbedtls_rsa_export ( rsa, &N, &P, &Q, &D, &E ) ) != 0 ||
221 ( ret = mbedtls_rsa_export_crt( rsa, &DP, &DQ, &QP ) ) != 0 )
222 {
223 mbedtls_printf( " failed\n ! could not export RSA parameters\n\n" );
Ron Eldora5221472018-06-27 08:49:00 +0300224 goto cleanup;
Hanno Becker54ebf992017-08-23 06:45:38 +0100225 }
226
Ron Eldorbf470992018-06-27 11:51:46 +0300227 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "N: ", &N, 16, NULL ) );
228 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "E: ", &E, 16, NULL ) );
229 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "D: ", &D, 16, NULL ) );
230 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "P: ", &P, 16, NULL ) );
231 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q: ", &Q, 16, NULL ) );
232 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "DP: ", &DP, 16, NULL ) );
233 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "DQ: ", &DQ, 16, NULL ) );
234 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "QP: ", &QP, 16, NULL ) );
Paul Bakker15254952013-09-17 11:24:56 +0200235 }
236 else
237#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200238#if defined(MBEDTLS_ECP_C)
239 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY )
Paul Bakker15254952013-09-17 11:24:56 +0200240 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200241 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk );
Mateusz Starzyk5dd4f6e2021-05-19 19:35:35 +0200242 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(X): ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(X), 16, NULL ) );
243 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Y): ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Y), 16, NULL ) );
244 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Z): ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Z), 16, NULL ) );
245 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "D : ", &ecp->MBEDTLS_PRIVATE(d) , 16, NULL ) );
Paul Bakker15254952013-09-17 11:24:56 +0200246 }
247 else
248#endif
249 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200250 mbedtls_printf("Do not know how to print key information for this type\n" );
Ron Eldor6a9257b2017-08-24 14:20:17 +0300251 goto cleanup;
Paul Bakker15254952013-09-17 11:24:56 +0200252 }
Paul Bakkered56b222011-07-13 11:26:43 +0000253 }
254 else if( opt.mode == MODE_PUBLIC )
255 {
256 /*
257 * 1.1. Load the key
258 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200259 mbedtls_printf( "\n . Loading the public key ..." );
Paul Bakkered56b222011-07-13 11:26:43 +0000260 fflush( stdout );
261
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200262 ret = mbedtls_pk_parse_public_keyfile( &pk, opt.filename );
Paul Bakkered56b222011-07-13 11:26:43 +0000263
264 if( ret != 0 )
265 {
Kenneth Soerensen518d4352020-04-01 17:22:45 +0200266 mbedtls_printf( " failed\n ! mbedtls_pk_parse_public_keyfile returned -0x%04x\n", (unsigned int) -ret );
Ron Eldor6a9257b2017-08-24 14:20:17 +0300267 goto cleanup;
Paul Bakkered56b222011-07-13 11:26:43 +0000268 }
269
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200270 mbedtls_printf( " ok\n" );
Paul Bakkered56b222011-07-13 11:26:43 +0000271
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200272 mbedtls_printf( " . Key information ...\n" );
273#if defined(MBEDTLS_RSA_C)
274 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA )
Paul Bakker15254952013-09-17 11:24:56 +0200275 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200276 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk );
Hanno Becker54ebf992017-08-23 06:45:38 +0100277
278 if( ( ret = mbedtls_rsa_export( rsa, &N, NULL, NULL,
279 NULL, &E ) ) != 0 )
280 {
281 mbedtls_printf( " failed\n ! could not export RSA parameters\n\n" );
Ron Eldora5221472018-06-27 08:49:00 +0300282 goto cleanup;
Hanno Becker54ebf992017-08-23 06:45:38 +0100283 }
Ron Eldorbf470992018-06-27 11:51:46 +0300284 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "N: ", &N, 16, NULL ) );
285 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "E: ", &E, 16, NULL ) );
Paul Bakker15254952013-09-17 11:24:56 +0200286 }
287 else
288#endif
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200289#if defined(MBEDTLS_ECP_C)
290 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY )
Paul Bakker15254952013-09-17 11:24:56 +0200291 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200292 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk );
Mateusz Starzyk5dd4f6e2021-05-19 19:35:35 +0200293 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(X): ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(X), 16, NULL ) );
294 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Y): ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Y), 16, NULL ) );
295 MBEDTLS_MPI_CHK( mbedtls_mpi_write_file( "Q(Z): ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Z), 16, NULL ) );
Paul Bakker15254952013-09-17 11:24:56 +0200296 }
297 else
298#endif
299 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200300 mbedtls_printf("Do not know how to print key information for this type\n" );
Ron Eldor6a9257b2017-08-24 14:20:17 +0300301 goto cleanup;
Paul Bakker15254952013-09-17 11:24:56 +0200302 }
Paul Bakkered56b222011-07-13 11:26:43 +0000303 }
304 else
305 goto usage;
306
Andres Amaya Garcia0faf1a52018-04-29 20:02:18 +0100307 exit_code = MBEDTLS_EXIT_SUCCESS;
308
Ron Eldor6a9257b2017-08-24 14:20:17 +0300309cleanup:
Paul Bakkered56b222011-07-13 11:26:43 +0000310
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200311#if defined(MBEDTLS_ERROR_C)
Andres Amaya Garcia0faf1a52018-04-29 20:02:18 +0100312 if( exit_code != MBEDTLS_EXIT_SUCCESS )
Hanno Becker54ebf992017-08-23 06:45:38 +0100313 {
Ron Eldor7a814262018-06-24 16:34:15 +0300314 mbedtls_strerror( ret, buf, sizeof( buf ) );
Hanno Becker54ebf992017-08-23 06:45:38 +0100315 mbedtls_printf( " ! Last error was: %s\n", buf );
316 }
Manuel Pégourié-Gonnard92e5b592013-09-18 18:57:10 +0200317#endif
318
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +0200319 mbedtls_ctr_drbg_free( &ctr_drbg );
320 mbedtls_entropy_free( &entropy );
321
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200322 mbedtls_pk_free( &pk );
Hanno Becker54ebf992017-08-23 06:45:38 +0100323 mbedtls_mpi_free( &N ); mbedtls_mpi_free( &P ); mbedtls_mpi_free( &Q );
324 mbedtls_mpi_free( &D ); mbedtls_mpi_free( &E ); mbedtls_mpi_free( &DP );
325 mbedtls_mpi_free( &DQ ); mbedtls_mpi_free( &QP );
Paul Bakkered56b222011-07-13 11:26:43 +0000326
Paul Bakkercce9d772011-11-18 14:26:47 +0000327#if defined(_WIN32)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200328 mbedtls_printf( " + Press Enter to exit this program.\n" );
Paul Bakkered56b222011-07-13 11:26:43 +0000329 fflush( stdout ); getchar();
330#endif
331
Krzysztof Stachowiak5e1b1952019-04-24 14:24:46 +0200332 mbedtls_exit( exit_code );
Paul Bakkered56b222011-07-13 11:26:43 +0000333}
Manuel Pégourié-Gonnard1503a9a2021-06-16 10:35:56 +0200334#endif /* MBEDTLS_BIGNUM_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO &&
335 MBEDTLS_ENTROPY_C && MBEDTLS_CTR_DRBG_C */