Fix passvault on 32-bit systems

The passvault's id is created with math.rand as a native int.
If the vault is created on a 64-bit system, it breaks compatibility
with 32-bit systems.

- Generate vaults with 32-bit ids.
- Update testcode
This commit is contained in:
Nick Sullivan
2013-11-27 10:55:24 -08:00
parent 0dc73c5c3a
commit 8cc69edefe
2 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -311,7 +311,7 @@ func InitFromDisk(path string) error {
if records.Version == 0 {
records.Version = DEFAULT_VERSION
records.VaultId = mrand.Int()
records.VaultId = int(mrand.Int31())
records.HmacKey, err = makeRandom(16)
if err != nil {
return err