Don't ignore return value of EVP_DigestInit_ex() in md BIOs and dgst utility.
[openssl.git] / apps / dgst.c
index c1bacd79b7a125bf172be6289209551acbfe10f7..30253149114186123e8159b811248a7d7bdc527f 100644 (file)
@@ -332,7 +332,13 @@ int MAIN(int argc, char **argv)
 
 
        /* we use md as a filter, reading from 'in' */
-       BIO_set_md(bmd,md);
+       if (!BIO_set_md(bmd,md))
+               {
+               BIO_printf(bio_err, "Error setting digest %s\n", pname);
+               ERR_print_errors(bio_err);
+               goto end;
+               }
+               
        inp=BIO_push(bmd,in);
 
        if (argc == 0)