mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-07-04 21:37:47 +02:00
refactor: rename keys package to masterkey
"keys" was too generic — it collided with the keys local var, the keys.MasterKeys field, and the CLI keys subcommand. Folds in PickOptions→DiscoverOptions and browser/ comment cleanup.
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/moond4rk/hackbrowserdata/crypto"
|
||||
"github.com/moond4rk/hackbrowserdata/keys"
|
||||
"github.com/moond4rk/hackbrowserdata/masterkey"
|
||||
)
|
||||
|
||||
// encryptWithDPAPI encrypts data using Windows DPAPI (CryptProtectData).
|
||||
@@ -64,7 +64,7 @@ func TestDecryptValue_V10_Windows(t *testing.T) {
|
||||
// v10 format on Windows: "v10" + nonce(12) + encrypted
|
||||
ciphertext := append([]byte("v10"), append(nonce, gcmEncrypted...)...)
|
||||
|
||||
got, err := decryptValue(keys.MasterKeys{V10: testAESKey}, ciphertext)
|
||||
got, err := decryptValue(masterkey.MasterKeys{V10: testAESKey}, ciphertext)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, plaintext, got)
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func TestDecryptValue_DPAPI_Windows(t *testing.T) {
|
||||
require.NotEmpty(t, encrypted)
|
||||
|
||||
// No v10/v20 prefix → decryptValue routes to DPAPI path; no per-tier key needed.
|
||||
got, err := decryptValue(keys.MasterKeys{}, encrypted)
|
||||
got, err := decryptValue(masterkey.MasterKeys{}, encrypted)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, plaintext, got)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user