Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Key reading application |
| 3 | * |
Manuel Pégourié-Gonnard | 6fb8187 | 2015-07-27 11:11:48 +0200 | [diff] [blame] | 4 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 5 | * 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 Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 18 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 19 | * This file is part of mbed TLS (https://tls.mbed.org) |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 22 | #if !defined(MBEDTLS_CONFIG_FILE) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 23 | #include "mbedtls/config.h" |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 24 | #else |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 25 | #include MBEDTLS_CONFIG_FILE |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 26 | #endif |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 27 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 28 | #if defined(MBEDTLS_PLATFORM_C) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 29 | #include "mbedtls/platform.h" |
Rich Evans | f90016a | 2015-01-19 14:26:37 +0000 | [diff] [blame] | 30 | #else |
Rich Evans | 18b78c7 | 2015-02-11 14:06:19 +0000 | [diff] [blame] | 31 | #include <stdio.h> |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 32 | #define mbedtls_printf printf |
Rich Evans | f90016a | 2015-01-19 14:26:37 +0000 | [diff] [blame] | 33 | #endif |
| 34 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 35 | #if defined(MBEDTLS_BIGNUM_C) && \ |
| 36 | defined(MBEDTLS_PK_PARSE_C) && defined(MBEDTLS_FS_IO) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 37 | #include "mbedtls/error.h" |
| 38 | #include "mbedtls/rsa.h" |
| 39 | #include "mbedtls/x509.h" |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 40 | |
Rich Evans | 18b78c7 | 2015-02-11 14:06:19 +0000 | [diff] [blame] | 41 | #include <string.h> |
| 42 | #endif |
| 43 | |
| 44 | #define MODE_NONE 0 |
| 45 | #define MODE_PRIVATE 1 |
| 46 | #define MODE_PUBLIC 2 |
| 47 | |
| 48 | #define DFL_MODE MODE_NONE |
| 49 | #define DFL_FILENAME "keyfile.key" |
| 50 | #define DFL_PASSWORD "" |
| 51 | #define DFL_PASSWORD_FILE "" |
| 52 | #define DFL_DEBUG_LEVEL 0 |
Manuel Pégourié-Gonnard | 6c5abfa | 2015-02-13 14:12:07 +0000 | [diff] [blame] | 53 | |
Rich Evans | 18b78c7 | 2015-02-11 14:06:19 +0000 | [diff] [blame] | 54 | #define USAGE \ |
| 55 | "\n usage: key_app param=<>...\n" \ |
| 56 | "\n acceptable parameters:\n" \ |
| 57 | " mode=private|public default: none\n" \ |
| 58 | " filename=%%s default: keyfile.key\n" \ |
| 59 | " password=%%s default: \"\"\n" \ |
| 60 | " password_file=%%s default: \"\"\n" \ |
| 61 | "\n" |
| 62 | |
| 63 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 64 | #if !defined(MBEDTLS_BIGNUM_C) || \ |
| 65 | !defined(MBEDTLS_PK_PARSE_C) || !defined(MBEDTLS_FS_IO) |
Rich Evans | 85b05ec | 2015-02-12 11:37:29 +0000 | [diff] [blame] | 66 | int main( void ) |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 67 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 68 | mbedtls_printf("MBEDTLS_BIGNUM_C and/or " |
| 69 | "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO not defined.\n"); |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 70 | return( 0 ); |
| 71 | } |
| 72 | #else |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 73 | /* |
| 74 | * global options |
| 75 | */ |
| 76 | struct options |
| 77 | { |
| 78 | int mode; /* the mode to run the application in */ |
Paul Bakker | ef3f8c7 | 2013-06-24 13:01:08 +0200 | [diff] [blame] | 79 | const char *filename; /* filename of the key file */ |
| 80 | const char *password; /* password for the private key */ |
| 81 | const char *password_file; /* password_file for the private key */ |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 82 | } opt; |
| 83 | |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 84 | int main( int argc, char *argv[] ) |
| 85 | { |
| 86 | int ret = 0; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 87 | mbedtls_pk_context pk; |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 88 | char buf[1024]; |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 89 | int i; |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 90 | char *p, *q; |
| 91 | |
| 92 | /* |
| 93 | * Set to sane values |
| 94 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 95 | mbedtls_pk_init( &pk ); |
Paul Bakker | 2e24ca7 | 2013-09-18 15:21:27 +0200 | [diff] [blame] | 96 | memset( buf, 0, sizeof(buf) ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 97 | |
| 98 | if( argc == 0 ) |
| 99 | { |
| 100 | usage: |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 101 | mbedtls_printf( USAGE ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 102 | goto exit; |
| 103 | } |
| 104 | |
| 105 | opt.mode = DFL_MODE; |
| 106 | opt.filename = DFL_FILENAME; |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 107 | opt.password = DFL_PASSWORD; |
| 108 | opt.password_file = DFL_PASSWORD_FILE; |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 109 | |
| 110 | for( i = 1; i < argc; i++ ) |
| 111 | { |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 112 | p = argv[i]; |
| 113 | if( ( q = strchr( p, '=' ) ) == NULL ) |
| 114 | goto usage; |
| 115 | *q++ = '\0'; |
| 116 | |
| 117 | if( strcmp( p, "mode" ) == 0 ) |
| 118 | { |
| 119 | if( strcmp( q, "private" ) == 0 ) |
| 120 | opt.mode = MODE_PRIVATE; |
| 121 | else if( strcmp( q, "public" ) == 0 ) |
| 122 | opt.mode = MODE_PUBLIC; |
| 123 | else |
| 124 | goto usage; |
| 125 | } |
| 126 | else if( strcmp( p, "filename" ) == 0 ) |
| 127 | opt.filename = q; |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 128 | else if( strcmp( p, "password" ) == 0 ) |
| 129 | opt.password = q; |
| 130 | else if( strcmp( p, "password_file" ) == 0 ) |
| 131 | opt.password_file = q; |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 132 | else |
| 133 | goto usage; |
| 134 | } |
| 135 | |
| 136 | if( opt.mode == MODE_PRIVATE ) |
| 137 | { |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 138 | if( strlen( opt.password ) && strlen( opt.password_file ) ) |
| 139 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 140 | mbedtls_printf( "Error: cannot have both password and password_file\n" ); |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 141 | goto usage; |
| 142 | } |
| 143 | |
| 144 | if( strlen( opt.password_file ) ) |
| 145 | { |
| 146 | FILE *f; |
| 147 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 148 | mbedtls_printf( "\n . Loading the password file ..." ); |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 149 | if( ( f = fopen( opt.password_file, "rb" ) ) == NULL ) |
| 150 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 151 | mbedtls_printf( " failed\n ! fopen returned NULL\n" ); |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 152 | goto exit; |
| 153 | } |
Paul Bakker | 8a0c0a9 | 2014-04-17 16:08:20 +0200 | [diff] [blame] | 154 | if( fgets( buf, sizeof(buf), f ) == NULL ) |
| 155 | { |
| 156 | fclose( f ); |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 157 | mbedtls_printf( "Error: fgets() failed to retrieve password\n" ); |
Paul Bakker | 8a0c0a9 | 2014-04-17 16:08:20 +0200 | [diff] [blame] | 158 | goto exit; |
| 159 | } |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 160 | fclose( f ); |
| 161 | |
Paul Bakker | 840ab20 | 2013-11-30 15:14:38 +0100 | [diff] [blame] | 162 | i = (int) strlen( buf ); |
Paul Bakker | db2509c | 2012-09-27 12:44:31 +0000 | [diff] [blame] | 163 | if( buf[i - 1] == '\n' ) buf[i - 1] = '\0'; |
| 164 | if( buf[i - 2] == '\r' ) buf[i - 2] = '\0'; |
| 165 | opt.password = buf; |
| 166 | } |
| 167 | |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 168 | /* |
| 169 | * 1.1. Load the key |
| 170 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 171 | mbedtls_printf( "\n . Loading the private key ..." ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 172 | fflush( stdout ); |
| 173 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 174 | ret = mbedtls_pk_parse_keyfile( &pk, opt.filename, opt.password ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 175 | |
| 176 | if( ret != 0 ) |
| 177 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 178 | mbedtls_printf( " failed\n ! mbedtls_pk_parse_keyfile returned -0x%04x\n", -ret ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 179 | goto exit; |
| 180 | } |
| 181 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 182 | mbedtls_printf( " ok\n" ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 183 | |
| 184 | /* |
| 185 | * 1.2 Print the key |
| 186 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 187 | mbedtls_printf( " . Key information ...\n" ); |
| 188 | #if defined(MBEDTLS_RSA_C) |
| 189 | if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 190 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 191 | mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); |
| 192 | mbedtls_mpi_write_file( "N: ", &rsa->N, 16, NULL ); |
| 193 | mbedtls_mpi_write_file( "E: ", &rsa->E, 16, NULL ); |
| 194 | mbedtls_mpi_write_file( "D: ", &rsa->D, 16, NULL ); |
| 195 | mbedtls_mpi_write_file( "P: ", &rsa->P, 16, NULL ); |
| 196 | mbedtls_mpi_write_file( "Q: ", &rsa->Q, 16, NULL ); |
| 197 | mbedtls_mpi_write_file( "DP: ", &rsa->DP, 16, NULL ); |
| 198 | mbedtls_mpi_write_file( "DQ: ", &rsa->DQ, 16, NULL ); |
| 199 | mbedtls_mpi_write_file( "QP: ", &rsa->QP, 16, NULL ); |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 200 | } |
| 201 | else |
| 202 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 203 | #if defined(MBEDTLS_ECP_C) |
| 204 | if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY ) |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 205 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 206 | mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk ); |
| 207 | mbedtls_mpi_write_file( "Q(X): ", &ecp->Q.X, 16, NULL ); |
| 208 | mbedtls_mpi_write_file( "Q(Y): ", &ecp->Q.Y, 16, NULL ); |
| 209 | mbedtls_mpi_write_file( "Q(Z): ", &ecp->Q.Z, 16, NULL ); |
| 210 | mbedtls_mpi_write_file( "D : ", &ecp->d , 16, NULL ); |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 211 | } |
| 212 | else |
| 213 | #endif |
| 214 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 215 | mbedtls_printf("Do not know how to print key information for this type\n" ); |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 216 | goto exit; |
| 217 | } |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 218 | } |
| 219 | else if( opt.mode == MODE_PUBLIC ) |
| 220 | { |
| 221 | /* |
| 222 | * 1.1. Load the key |
| 223 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 224 | mbedtls_printf( "\n . Loading the public key ..." ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 225 | fflush( stdout ); |
| 226 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 227 | ret = mbedtls_pk_parse_public_keyfile( &pk, opt.filename ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 228 | |
| 229 | if( ret != 0 ) |
| 230 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 231 | mbedtls_printf( " failed\n ! mbedtls_pk_parse_public_keyfile returned -0x%04x\n", -ret ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 232 | goto exit; |
| 233 | } |
| 234 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 235 | mbedtls_printf( " ok\n" ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 236 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 237 | mbedtls_printf( " . Key information ...\n" ); |
| 238 | #if defined(MBEDTLS_RSA_C) |
| 239 | if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 240 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 241 | mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); |
| 242 | mbedtls_mpi_write_file( "N: ", &rsa->N, 16, NULL ); |
| 243 | mbedtls_mpi_write_file( "E: ", &rsa->E, 16, NULL ); |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 244 | } |
| 245 | else |
| 246 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 247 | #if defined(MBEDTLS_ECP_C) |
| 248 | if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY ) |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 249 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 250 | mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk ); |
| 251 | mbedtls_mpi_write_file( "Q(X): ", &ecp->Q.X, 16, NULL ); |
| 252 | mbedtls_mpi_write_file( "Q(Y): ", &ecp->Q.Y, 16, NULL ); |
| 253 | mbedtls_mpi_write_file( "Q(Z): ", &ecp->Q.Z, 16, NULL ); |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 254 | } |
| 255 | else |
| 256 | #endif |
| 257 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 258 | mbedtls_printf("Do not know how to print key information for this type\n" ); |
Paul Bakker | 1525495 | 2013-09-17 11:24:56 +0200 | [diff] [blame] | 259 | goto exit; |
| 260 | } |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 261 | } |
| 262 | else |
| 263 | goto usage; |
| 264 | |
| 265 | exit: |
| 266 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 267 | #if defined(MBEDTLS_ERROR_C) |
| 268 | mbedtls_strerror( ret, buf, sizeof(buf) ); |
| 269 | mbedtls_printf( " ! Last error was: %s\n", buf ); |
Manuel Pégourié-Gonnard | 92e5b59 | 2013-09-18 18:57:10 +0200 | [diff] [blame] | 270 | #endif |
| 271 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 272 | mbedtls_pk_free( &pk ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 273 | |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 274 | #if defined(_WIN32) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 275 | mbedtls_printf( " + Press Enter to exit this program.\n" ); |
Paul Bakker | ed56b22 | 2011-07-13 11:26:43 +0000 | [diff] [blame] | 276 | fflush( stdout ); getchar(); |
| 277 | #endif |
| 278 | |
| 279 | return( ret ); |
| 280 | } |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 281 | #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO */ |