From 700d9463f30e896959f1ee9da14b935fcf1b5082 Mon Sep 17 00:00:00 2001 From: anwleung Date: Fri, 9 Mar 2007 20:25:47 +0000 Subject: [PATCH] fixed funny hash output thingy git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1191 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/aleung/security1/ceph/crypto/CryptoLib.h | 1 - branches/aleung/security1/ceph/crypto/Makefile | 2 +- branches/aleung/security1/ceph/crypto/MerkleTree.h | 2 +- branches/aleung/security1/ceph/crypto/driver.cc | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/branches/aleung/security1/ceph/crypto/CryptoLib.h b/branches/aleung/security1/ceph/crypto/CryptoLib.h index 9763a5c4a2cc1..4df11d8430449 100644 --- a/branches/aleung/security1/ceph/crypto/CryptoLib.h +++ b/branches/aleung/security1/ceph/crypto/CryptoLib.h @@ -67,7 +67,6 @@ namespace CryptoLib { cfbRC5Dec getRC5Dec(byte*, const unsigned int, byte*); void encryptRC5(byte*, const unsigned int, byte*, cfbRC5Enc); void decryptRC5(byte*, const unsigned int, byte*, cfbRC5Dec); - // asymmetric key generation esignPriv esignPrivKey(char*); diff --git a/branches/aleung/security1/ceph/crypto/Makefile b/branches/aleung/security1/ceph/crypto/Makefile index 1c3f3c5ae3952..24f1113669a82 100644 --- a/branches/aleung/security1/ceph/crypto/Makefile +++ b/branches/aleung/security1/ceph/crypto/Makefile @@ -41,4 +41,4 @@ clean: depend: $(RM) .depend - makedepend -f- -- $(CFLAGS) -- $(SRCS) > .depend 2>/dev/null \ No newline at end of file + makedepend -f- -- $(CFLAGS) -- $(SRCS) > .depend 2>/dev/null diff --git a/branches/aleung/security1/ceph/crypto/MerkleTree.h b/branches/aleung/security1/ceph/crypto/MerkleTree.h index a011e93db4dc4..35b21bbdb900c 100644 --- a/branches/aleung/security1/ceph/crypto/MerkleTree.h +++ b/branches/aleung/security1/ceph/crypto/MerkleTree.h @@ -43,7 +43,7 @@ inline std::ostream& operator<<(std::ostream& out, const hash_t& c) byte hexArray[2*SHA1DIGESTSIZE]; memset(hexArray, 0x00, sizeof(hexArray)); toHex(c.val, hexArray, SHA1DIGESTSIZE, 2*SHA1DIGESTSIZE); - out << string((const char*)hexArray); + out << string((const char*)hexArray, sizeof(hexArray)); return out; } diff --git a/branches/aleung/security1/ceph/crypto/driver.cc b/branches/aleung/security1/ceph/crypto/driver.cc index a13222d7e83a3..0e8a12bd5f7e7 100644 --- a/branches/aleung/security1/ceph/crypto/driver.cc +++ b/branches/aleung/security1/ceph/crypto/driver.cc @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) { sha1(msg,digest,strlen((const char*)msg)); toHex(digest, digestHex, SHA1DIGESTSIZE, 2*SHA1DIGESTSIZE); cout << "SHA-1 of " << msg << " is " << string((const char*)digestHex,2*SHA1DIGESTSIZE) << endl; - + // sha-256 byte digest256[SHA256DIGESTSIZE]; byte hex256[2*SHA256DIGESTSIZE]; -- 2.39.5