File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -769,6 +769,7 @@ static int pk_parse_key_pkcs1_der( mbedtls_rsa_context *rsa,
769
769
goto cleanup ;
770
770
p += len ;
771
771
772
+ #if !defined(MBEDTLS_RSA_NO_CRT )
772
773
/*
773
774
* The RSA CRT parameters DP, DQ and QP are nominally redundant, in
774
775
* that they can be easily recomputed from D, P and Q. However by
@@ -800,6 +801,13 @@ static int pk_parse_key_pkcs1_der( mbedtls_rsa_context *rsa,
800
801
( ret = mbedtls_mpi_read_binary ( & rsa -> QP , p , len ) ) != 0 )
801
802
goto cleanup ;
802
803
p += len ;
804
+ #else
805
+ /* Verify existance of the CRT params */
806
+ if ( ( ret = mbedtls_asn1_get_mpi ( & p , end , & T ) ) != 0 ||
807
+ ( ret = mbedtls_asn1_get_mpi ( & p , end , & T ) ) != 0 ||
808
+ ( ret = mbedtls_asn1_get_mpi ( & p , end , & T ) ) != 0 )
809
+ goto cleanup ;
810
+ #endif
803
811
804
812
/* Complete the RSA private key */
805
813
if ( ( ret = mbedtls_rsa_complete ( rsa ) ) != 0 )
You can’t perform that action at this time.
0 commit comments