diff --git a/programs/x509/cert_req.c b/programs/x509/cert_req.c index d25ad4c56..b2052ecf1 100644 --- a/programs/x509/cert_req.c +++ b/programs/x509/cert_req.c @@ -102,7 +102,7 @@ int main( void ) " Add NsCertType even if it is empty\n" \ " md=%%s default: SHA256\n" \ " possible values:\n" \ - " MD4, MD5, SHA1\n" \ + " MD2, MD4, MD5, SHA1\n" \ " SHA224, SHA256\n" \ " SHA384, SHA512\n" \ "\n" @@ -252,6 +252,13 @@ int main( int argc, char *argv[] ) } else #endif /* MBEDTLS_MD5_C */ +#if defined(MBEDTLS_MD2_C) + if( strcmp( q, "MD2" ) == 0 ) + { + opt.md_alg = MBEDTLS_MD_MD2; + } + else +#endif /* MBEDTLS_MD2_C */ #if defined(MBEDTLS_SHA1_C) if( strcmp( q, "SHA1" ) == 0 ) { diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c index cd39108f2..8579831a9 100644 --- a/programs/x509/cert_write.c +++ b/programs/x509/cert_write.c @@ -372,6 +372,10 @@ int main( int argc, char *argv[] ) opt.md = MBEDTLS_MD_SHA256; else if( strcmp( q, "SHA512" ) == 0 ) opt.md = MBEDTLS_MD_SHA512; + else if( strcmp( q, "MD2" ) == 0 ) + opt.md = MBEDTLS_MD_MD2; + else if( strcmp( q, "MD4" ) == 0 ) + opt.md = MBEDTLS_MD_MD4; else if( strcmp( q, "MD5" ) == 0 ) opt.md = MBEDTLS_MD_MD5; else