bug-commoncpp
[Top][All Lists]
Advanced

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

Small bug in MD5Digest


From: Chad Yates
Subject: Small bug in MD5Digest
Date: Thu, 02 Jan 2003 22:28:44 -0800

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




reply via email to

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