Fix character range in salts, just for JavaScript.
authorMarc Burns <m4burns@uwaterloo.ca>
Wed, 21 Nov 2012 00:56:18 +0000 (19:56 -0500)
committerMarc Burns <m4burns@uwaterloo.ca>
Wed, 21 Nov 2012 00:56:18 +0000 (19:56 -0500)
database/salt_store.cpp

index e9ca878..453cead 100644 (file)
@@ -26,10 +26,10 @@ std::string SaltStore::getSalt() {
        }
        fclose(rand_in);
 
-       // zero-terminated strings suck
-       for(unsigned int i=0;i<salt_size;++i)
-               if(bfr[i] == 0)
-                       bfr[i] = 1;
+       // everything sucks
+       for(unsigned int i=0;i<salt_size;++i) {
+               bfr[i] = (bfr[i] % 78) + 48;
+  }
        bfr[salt_size-1] = 0;
 
        std::string salt(bfr);