bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small bug in MD5Digest


From: Federico Montesino Pouzols
Subject: Re: Small bug in MD5Digest
Date: Thu, 9 Jan 2003 11:13:33 +0100
User-agent: Mutt/1.4i

        It looks like the 'updated = false;' line prevents people from
being able to use initDigest, as if only the call from the constructor
had been taken into account. I have commited your patch.

On Thu, Jan 02, 2003 at 10:28:44PM -0800, Chad Yates wrote:
> I have isolated the bug in the MD5Digest class as pointed out by Albert.  It
> appears that if you use a MD5Digest, and then .initDigest and then export
> the digest, the last value is reported.  I have attributed it to code in
> initDigest that sets updated equal to false which apparently keeps it from
> updating the internal digest.  changing this seems to fix it without
> breaking my other test cases (Construction, Empty Message, Small Message,
> Re-Initialization, Large Message, Piecewise Message, and Typical Usage).
> 
> If someone that is an expert on the md5 class and the algorithm (I know very
> little about the internals of the md5 algorithm), can they let me know if
> this sounds right.
> 
> thanks,
> 
> Chad
> 
> P.S if this is correct we should also be able to remove the updated = true
> line in the constructor after the call to initDigest.
> 
> Index: md5.cpp
> ===================================================================
> RCS file: /cvsroot/commoncpp/commoncpp2/src/md5.cpp,v
> retrieving revision 1.2
> diff -r1.2 md5.cpp
> 142c142,143
> <       updated = false;
> ---
> >       //updated = false;
> >       updated = true; // CCY Added
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]