Unsigned. master
authorMarc Burns <m4burns@uwaterloo.ca>
Wed, 21 Nov 2012 01:04:33 +0000 (20:04 -0500)
committerMarc Burns <m4burns@uwaterloo.ca>
Wed, 21 Nov 2012 01:04:33 +0000 (20:04 -0500)
database/salt_store.cpp

index 453cead..bca1bde 100644 (file)
@@ -13,7 +13,7 @@ SaltStore::SaltStore(uint64_t key_lifetime, size_t salt_size, std::string secret
 
 std::string SaltStore::getSalt() {
        expireKeys();
-       char bfr[salt_size];
+       unsigned char bfr[salt_size];
        FILE * rand_in = fopen("/dev/urandom", "r");
        if(!rand_in) {
                fprintf(stderr, "Could not open /dev/urandom!\n");
@@ -32,7 +32,7 @@ std::string SaltStore::getSalt() {
   }
        bfr[salt_size-1] = 0;
 
-       std::string salt(bfr);
+       std::string salt((char*)bfr);
 
        valid_keys.push_back(std::pair<uint64_t, SHA1Hash>((uint64_t)time(NULL), SHA1Hash(salt + secret)));
        return salt;