diff options
author | Gilles Peskine <gilles.peskine@arm.com> | 2020-05-12 10:46:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 10:46:47 +0200 |
commit | e24fc7b0a1cce1b4ecc8c706c8eda2593d17e711 (patch) | |
tree | 5d1f74771dceff27e169d2645a410d61787569ad /programs/pkey | |
parent | c39a80daeefc0945024f4438be72b3be1cedf74f (diff) | |
parent | b88bb5fd7f2877ba181d985007aa5aa1d31055c7 (diff) | |
download | mbedtls-e24fc7b0a1cce1b4ecc8c706c8eda2593d17e711.zip mbedtls-e24fc7b0a1cce1b4ecc8c706c8eda2593d17e711.tar.gz mbedtls-e24fc7b0a1cce1b4ecc8c706c8eda2593d17e711.tar.bz2 |
Merge pull request #2595 from k-stachowiak/unified-exit-in-examples
Unify the example programs' termination
Diffstat (limited to 'programs/pkey')
-rw-r--r-- | programs/pkey/dh_client.c | 4 | ||||
-rw-r--r-- | programs/pkey/dh_genprime.c | 6 | ||||
-rw-r--r-- | programs/pkey/dh_server.c | 4 | ||||
-rw-r--r-- | programs/pkey/ecdh_curve25519.c | 4 | ||||
-rw-r--r-- | programs/pkey/ecdsa.c | 4 | ||||
-rw-r--r-- | programs/pkey/gen_key.c | 4 | ||||
-rw-r--r-- | programs/pkey/key_app.c | 4 | ||||
-rw-r--r-- | programs/pkey/key_app_writer.c | 4 | ||||
-rw-r--r-- | programs/pkey/mpi_demo.c | 4 | ||||
-rw-r--r-- | programs/pkey/pk_decrypt.c | 4 | ||||
-rw-r--r-- | programs/pkey/pk_encrypt.c | 4 | ||||
-rw-r--r-- | programs/pkey/pk_sign.c | 4 | ||||
-rw-r--r-- | programs/pkey/pk_verify.c | 4 | ||||
-rw-r--r-- | programs/pkey/rsa_decrypt.c | 4 | ||||
-rw-r--r-- | programs/pkey/rsa_encrypt.c | 4 | ||||
-rw-r--r-- | programs/pkey/rsa_genkey.c | 4 | ||||
-rw-r--r-- | programs/pkey/rsa_sign.c | 4 | ||||
-rw-r--r-- | programs/pkey/rsa_sign_pss.c | 4 | ||||
-rw-r--r-- | programs/pkey/rsa_verify.c | 4 | ||||
-rw-r--r-- | programs/pkey/rsa_verify_pss.c | 4 |
20 files changed, 41 insertions, 41 deletions
diff --git a/programs/pkey/dh_client.c b/programs/pkey/dh_client.c index 86b260c..90fc4e5 100644 --- a/programs/pkey/dh_client.c +++ b/programs/pkey/dh_client.c @@ -68,7 +68,7 @@ int main( void ) "and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or " "MBEDTLS_SHA256_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -307,7 +307,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_AES_C && MBEDTLS_DHM_C && MBEDTLS_ENTROPY_C && MBEDTLS_NET_C && MBEDTLS_RSA_C && MBEDTLS_SHA256_C && diff --git a/programs/pkey/dh_genprime.c b/programs/pkey/dh_genprime.c index bf5482e..5293f89 100644 --- a/programs/pkey/dh_genprime.c +++ b/programs/pkey/dh_genprime.c @@ -45,7 +45,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or " "MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C and/or " "MBEDTLS_GENPRIME not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -91,7 +91,7 @@ int main( int argc, char **argv ) { usage: mbedtls_printf( USAGE ); - return( exit_code ); + mbedtls_exit( exit_code ); } for( i = 1; i < argc; i++ ) @@ -197,7 +197,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_FS_IO && MBEDTLS_CTR_DRBG_C && MBEDTLS_GENPRIME */ diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c index c011774..06676c0 100644 --- a/programs/pkey/dh_server.c +++ b/programs/pkey/dh_server.c @@ -68,7 +68,7 @@ int main( void ) "and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or " "MBEDTLS_SHA256_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -330,7 +330,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_AES_C && MBEDTLS_DHM_C && MBEDTLS_ENTROPY_C && MBEDTLS_NET_C && MBEDTLS_RSA_C && MBEDTLS_SHA256_C && diff --git a/programs/pkey/ecdh_curve25519.c b/programs/pkey/ecdh_curve25519.c index 9f849dd..e79dce0 100644 --- a/programs/pkey/ecdh_curve25519.c +++ b/programs/pkey/ecdh_curve25519.c @@ -45,7 +45,7 @@ int main( void ) "MBEDTLS_ECP_DP_CURVE25519_ENABLED and/or " "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C " "not defined\n" ); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -238,7 +238,7 @@ exit: mbedtls_ctr_drbg_free( &ctr_drbg ); mbedtls_entropy_free( &entropy ); - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_ECDH_C && MBEDTLS_ECP_DP_CURVE25519_ENABLED && MBEDTLS_ENTROPY_C && MBEDTLS_CTR_DRBG_C */ diff --git a/programs/pkey/ecdsa.c b/programs/pkey/ecdsa.c index 9feb160..72744e7 100644 --- a/programs/pkey/ecdsa.c +++ b/programs/pkey/ecdsa.c @@ -66,7 +66,7 @@ int main( void ) { mbedtls_printf("MBEDTLS_ECDSA_C and/or MBEDTLS_SHA256_C and/or " "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C not defined\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else #if defined(VERBOSE) @@ -248,7 +248,7 @@ exit: mbedtls_ctr_drbg_free( &ctr_drbg ); mbedtls_entropy_free( &entropy ); - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_ECDSA_C && MBEDTLS_ENTROPY_C && MBEDTLS_CTR_DRBG_C && ECPARAMS */ diff --git a/programs/pkey/gen_key.c b/programs/pkey/gen_key.c index 9c1a91c..c5d8ac9 100644 --- a/programs/pkey/gen_key.c +++ b/programs/pkey/gen_key.c @@ -133,7 +133,7 @@ int main( void ) "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or " "MBEDTLS_PEM_WRITE_C" "not defined.\n" ); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -446,7 +446,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_PK_WRITE_C && MBEDTLS_PEM_WRITE_C && MBEDTLS_FS_IO && * MBEDTLS_ENTROPY_C && MBEDTLS_CTR_DRBG_C */ diff --git a/programs/pkey/key_app.c b/programs/pkey/key_app.c index 345b7b8..d7387f3 100644 --- a/programs/pkey/key_app.c +++ b/programs/pkey/key_app.c @@ -70,7 +70,7 @@ int main( void ) { mbedtls_printf("MBEDTLS_BIGNUM_C and/or " "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -311,6 +311,6 @@ cleanup: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO */ diff --git a/programs/pkey/key_app_writer.c b/programs/pkey/key_app_writer.c index 937fe90..46cb704 100644 --- a/programs/pkey/key_app_writer.c +++ b/programs/pkey/key_app_writer.c @@ -94,7 +94,7 @@ int main( void ) { mbedtls_printf( "MBEDTLS_PK_PARSE_C and/or MBEDTLS_PK_WRITE_C and/or MBEDTLS_FS_IO not defined.\n" ); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -436,6 +436,6 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_PK_PARSE_C && MBEDTLS_PK_WRITE_C && MBEDTLS_FS_IO */ diff --git a/programs/pkey/mpi_demo.c b/programs/pkey/mpi_demo.c index ecdcd32..8163781 100644 --- a/programs/pkey/mpi_demo.c +++ b/programs/pkey/mpi_demo.c @@ -46,7 +46,7 @@ int main( void ) { mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_FS_IO not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -112,6 +112,6 @@ cleanup: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_FS_IO */ diff --git a/programs/pkey/pk_decrypt.c b/programs/pkey/pk_decrypt.c index 44d094e..494bb80 100644 --- a/programs/pkey/pk_decrypt.c +++ b/programs/pkey/pk_decrypt.c @@ -56,7 +56,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_PK_PARSE_C and/or " "MBEDTLS_FS_IO and/or MBEDTLS_ENTROPY_C and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -172,7 +172,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO && MBEDTLS_ENTROPY_C && MBEDTLS_CTR_DRBG_C */ diff --git a/programs/pkey/pk_encrypt.c b/programs/pkey/pk_encrypt.c index 16cd3f0..673e2cb 100644 --- a/programs/pkey/pk_encrypt.c +++ b/programs/pkey/pk_encrypt.c @@ -57,7 +57,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_PK_PARSE_C and/or " "MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -176,7 +176,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_PK_PARSE_C && MBEDTLS_ENTROPY_C && MBEDTLS_FS_IO && MBEDTLS_CTR_DRBG_C */ diff --git a/programs/pkey/pk_sign.c b/programs/pkey/pk_sign.c index 4e755c0..3504bff 100644 --- a/programs/pkey/pk_sign.c +++ b/programs/pkey/pk_sign.c @@ -47,7 +47,7 @@ int main( void ) "MBEDTLS_SHA256_C and/or MBEDTLS_MD_C and/or " "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -173,7 +173,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_SHA256_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO && diff --git a/programs/pkey/pk_verify.c b/programs/pkey/pk_verify.c index 2e08763..b1374b6 100644 --- a/programs/pkey/pk_verify.c +++ b/programs/pkey/pk_verify.c @@ -45,7 +45,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_MD_C and/or " "MBEDTLS_SHA256_C and/or MBEDTLS_PK_PARSE_C and/or " "MBEDTLS_FS_IO not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -147,7 +147,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_SHA256_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO */ diff --git a/programs/pkey/rsa_decrypt.c b/programs/pkey/rsa_decrypt.c index 4cfe400..6aca217 100644 --- a/programs/pkey/rsa_decrypt.c +++ b/programs/pkey/rsa_decrypt.c @@ -55,7 +55,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or " "MBEDTLS_FS_IO and/or MBEDTLS_ENTROPY_C and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -207,6 +207,6 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_RSA_C && MBEDTLS_FS_IO */ diff --git a/programs/pkey/rsa_encrypt.c b/programs/pkey/rsa_encrypt.c index 4a71c15..48f01ab 100644 --- a/programs/pkey/rsa_encrypt.c +++ b/programs/pkey/rsa_encrypt.c @@ -55,7 +55,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or " "MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -184,7 +184,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_RSA_C && MBEDTLS_ENTROPY_C && MBEDTLS_FS_IO && MBEDTLS_CTR_DRBG_C */ diff --git a/programs/pkey/rsa_genkey.c b/programs/pkey/rsa_genkey.c index f2b7b50..719923a 100644 --- a/programs/pkey/rsa_genkey.c +++ b/programs/pkey/rsa_genkey.c @@ -59,7 +59,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or " "MBEDTLS_RSA_C and/or MBEDTLS_GENPRIME and/or " "MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -172,7 +172,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_RSA_C && MBEDTLS_GENPRIME && MBEDTLS_FS_IO && MBEDTLS_CTR_DRBG_C */ diff --git a/programs/pkey/rsa_sign.c b/programs/pkey/rsa_sign.c index 78ab176..38a1f3d 100644 --- a/programs/pkey/rsa_sign.c +++ b/programs/pkey/rsa_sign.c @@ -46,7 +46,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or " "MBEDTLS_MD_C and/or " "MBEDTLS_SHA256_C and/or MBEDTLS_FS_IO not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -188,7 +188,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_RSA_C && MBEDTLS_SHA256_C && MBEDTLS_FS_IO */ diff --git a/programs/pkey/rsa_sign_pss.c b/programs/pkey/rsa_sign_pss.c index 5019f28..938b93a 100644 --- a/programs/pkey/rsa_sign_pss.c +++ b/programs/pkey/rsa_sign_pss.c @@ -47,7 +47,7 @@ int main( void ) "MBEDTLS_RSA_C and/or MBEDTLS_SHA256_C and/or " "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -175,7 +175,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_RSA_C && MBEDTLS_SHA256_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO && diff --git a/programs/pkey/rsa_verify.c b/programs/pkey/rsa_verify.c index 74248f9..8ea5d51 100644 --- a/programs/pkey/rsa_verify.c +++ b/programs/pkey/rsa_verify.c @@ -45,7 +45,7 @@ int main( void ) mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or " "MBEDTLS_MD_C and/or " "MBEDTLS_SHA256_C and/or MBEDTLS_FS_IO not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -162,7 +162,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_RSA_C && MBEDTLS_SHA256_C && MBEDTLS_FS_IO */ diff --git a/programs/pkey/rsa_verify_pss.c b/programs/pkey/rsa_verify_pss.c index de28337..5e4e98e 100644 --- a/programs/pkey/rsa_verify_pss.c +++ b/programs/pkey/rsa_verify_pss.c @@ -47,7 +47,7 @@ int main( void ) "MBEDTLS_RSA_C and/or MBEDTLS_SHA256_C and/or " "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); - return( 0 ); + mbedtls_exit( 0 ); } #else @@ -151,7 +151,7 @@ exit: fflush( stdout ); getchar(); #endif - return( exit_code ); + mbedtls_exit( exit_code ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_RSA_C && MBEDTLS_SHA256_C && MBEDTLS_PK_PARSE_C && MBEDTLS_FS_IO */ |