From 1d233391a613e6b189e277d556d082f464d398b5 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 28 Sep 2017 16:49:40 +0100 Subject: [PATCH] Remove unreachable branches in pkparse.c --- library/pkparse.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/library/pkparse.c b/library/pkparse.c index acca2af83..63c519994 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -1067,12 +1067,7 @@ int pk_parse_key( pk_context *pk, key, pwd, pwdlen, &len ); if( ret == 0 ) { - if( ( pk_info = pk_info_from_type( POLARSSL_PK_RSA ) ) == NULL ) - { - pem_free( &pem ); - return( POLARSSL_ERR_PK_UNKNOWN_PK_ALG ); - } - + pk_info = pk_info_from_type( POLARSSL_PK_RSA ); if( ( ret = pk_init_ctx( pk, pk_info ) ) != 0 || ( ret = pk_parse_key_pkcs1_der( pk_rsa( *pk ), pem.buf, pem.buflen ) ) != 0 ) @@ -1098,12 +1093,7 @@ int pk_parse_key( pk_context *pk, key, pwd, pwdlen, &len ); if( ret == 0 ) { - if( ( pk_info = pk_info_from_type( POLARSSL_PK_ECKEY ) ) == NULL ) - { - pem_free( &pem ); - return( POLARSSL_ERR_PK_UNKNOWN_PK_ALG ); - } - + pk_info = pk_info_from_type( POLARSSL_PK_ECKEY ); if( ( ret = pk_init_ctx( pk, pk_info ) ) != 0 || ( ret = pk_parse_key_sec1_der( pk_ec( *pk ), pem.buf, pem.buflen ) ) != 0 )