* Start move towards SHA-256 hashes instead of MD5.

* Start cleaning up unique store path generation (they weren't always
  unique; in particular the suffix ("-aterm-2.2", "-builder.sh") was
  not part of the hash, therefore changes to the suffix would cause
  multiple store objects with the same hash).
This commit is contained in:
Eelco Dolstra 2005-01-14 13:51:38 +00:00
parent a7b94e87d7
commit 9530cc3170
9 changed files with 63 additions and 34 deletions

View file

@ -22,6 +22,7 @@ Hash::Hash(HashType type)
else if (type == htSHA1) hashSize = sha1HashSize;
else if (type == htSHA256) hashSize = sha256HashSize;
else throw Error("unknown hash type");
assert(hashSize <= maxHashSize);
memset(hash, 0, hashSize);
}

View file

@ -18,7 +18,7 @@ const int sha256HashSize = 32;
struct Hash
{
static const unsigned int maxHashSize = 20;
static const unsigned int maxHashSize = 32;
unsigned int hashSize;
unsigned char hash[maxHashSize];