mirror of
https://github.com/cloudflare/redoctober.git
synced 2026-09-19 22:24:12 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user