OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________
________________
Server: cvs.openssl.org Name: Dr.
Stephen Henson
Root: /v/openssl/cvs Email: steve openssl.org
Module: openssl Date:
17-May-2007 14:55:03
Branch: HEAD Handle:
2007051713550300
Modified files:
openssl/apps dgst.c
Log:
Use default md if none specified in dgst utility.
Summary:
Revision Changes Path
1.45 +16 -6 openssl/apps/dgst.c
____________________________________________________________
________________
patch -p0 <<' .'
Index: openssl/apps/dgst.c
============================================================
================
$ cvs diff -u -r1.44 -r1.45 dgst.c
--- openssl/apps/dgst.c 17 May 2007 12:35:32 -0000 1.44
+++ openssl/apps/dgst.c 17 May 2007 12:55:03 -0000 1.45
 -231,8 +231,6 
argv++;
}
- if (md == NULL)
- md=EVP_md5();
if(do_verify && !sigfile) {
BIO_printf(bio_err, "No signature to verify: use
the -signature optionn");
 -447,11 +445,16 
}
}
/* we use md as a filter, reading from 'in' */
- else if (!BIO_set_md(bmd,md))
+ else
{
- BIO_printf(bio_err, "Error setting digest
%sn", pname);
- ERR_print_errors(bio_err);
- goto end;
+ if (md == NULL)
+ md = EVP_md5();
+ if (!BIO_set_md(bmd,md))
+ {
+ BIO_printf(bio_err, "Error setting digest
%sn", pname);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
}
if(sigfile && sigkey) {
 -476,6 +479,13 
}
inp=BIO_push(bmd,in);
+ if (md == NULL)
+ {
+ EVP_MD_CTX *tctx;
+ BIO_get_md_ctx(bmd, &tctx);
+ md = EVP_MD_CTX_md(tctx);
+ }
+
if (argc == 0)
{
BIO_set_fp(in,stdin,BIO_NOCLOSE);
 .
____________________________________________________________
__________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List
openssl-cvs openssl.org
Automated List Manager
majordomo openssl.org
|