Menu

#204 SHA1Digest broken in 1.0.13?

open
nobody
5
2012-11-20
2004-11-10
No

I'm getting the same checksum for every data when using
SHA1Digest. This seems to occur with SHA256Digest aswell.
I'm using the CommonC++ RPM shipping with SUSE 9.1:
$ rpm -q CommonC++
CommonC++-2.1.0.13-125

$ cat digest.cpp
#include <cc++/digest.h>
#include <iostream>

using namespace std;
using namespace ost;

int main()
{
SHA1Digest digest;

digest << "test";
cout << digest << endl;;
return 0;
}
$ gcc -I/usr/include/cc++2/ digest.cpp -lccext2
-lccgnu2 -lpthread -ldl -lxml2
$ ./a.out
9844f81e1408f6ecb932137d33bed7cfdcf518a3
$ cat digest.cpp | sed -e 's/test/pippo/' > digest2.cpp
$ cat digest2.cpp
#include <cc++/digest.h>
#include <iostream>

using namespace std;
using namespace ost;

int main()
{
SHA1Digest digest;

digest << "pippo";
cout << digest << endl;;
return 0;
}
$ gcc -I/usr/include/cc++2/ digest2.cpp -lccext2
-lccgnu2 -lpthread -ldl -lxml2
$ ./a.out
9844f81e1408f6ecb932137d33bed7cfdcf518a3
$

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.