Clarify key types message from ssl_client2 and ssl_server2
If no key is loaded in a slot, say "none", not "invalid PK".
When listing two key types, use punctuation that's visibly a sequence
separator (",").
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index 57f7d8f..68dcf6b 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -1703,7 +1703,8 @@
}
#endif /* MBEDTLS_USE_PSA_CRYPTO */
- mbedtls_printf( " ok (key type: %s)\n", mbedtls_pk_get_name( &pkey ) );
+ mbedtls_printf( " ok (key type: %s)\n",
+ strlen( opt.key_file ) ? mbedtls_pk_get_name( &pkey ) : "none" );
#endif /* MBEDTLS_X509_CRT_PARSE_C */
/*