refactor(keys): extract master-key package to top-level keys/

Master-key acquisition and the cross-host dump format are a concern distinct from the raw crypto primitives, so crypto/keyretriever moves to an importable top-level keys/. KeyRetriever→Retriever drops the keys.KeyRetriever stutter.
This commit is contained in:
moonD4rk
2026-06-01 00:38:42 +08:00
parent b901f7dff0
commit c951d7ac16
43 changed files with 365 additions and 439 deletions
+3 -3
View File
@@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/moond4rk/hackbrowserdata/crypto/keyretriever"
"github.com/moond4rk/hackbrowserdata/filemanager"
"github.com/moond4rk/hackbrowserdata/keys"
"github.com/moond4rk/hackbrowserdata/types"
)
@@ -32,7 +32,7 @@ func TestExtractCategory_CustomExtractor(t *testing.T) {
}
data := &types.BrowserData{}
p.extractCategory(data, types.Extension, keyretriever.MasterKeys{}, "unused-path")
p.extractCategory(data, types.Extension, keys.MasterKeys{}, "unused-path")
assert.True(t, called, "custom extractor should be called")
require.Len(t, data.Extensions, 1)
@@ -51,7 +51,7 @@ func TestExtractCategory_DefaultFallback(t *testing.T) {
}
data := &types.BrowserData{}
p.extractCategory(data, types.History, keyretriever.MasterKeys{}, path)
p.extractCategory(data, types.History, keys.MasterKeys{}, path)
require.Len(t, data.Histories, 1)
assert.Equal(t, "Example", data.Histories[0].Title)