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
@@ -6,7 +6,7 @@ import (
"database/sql"
"sort"
"github.com/moond4rk/hackbrowserdata/crypto/keyretriever"
"github.com/moond4rk/hackbrowserdata/keys"
"github.com/moond4rk/hackbrowserdata/types"
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
)
@@ -18,7 +18,7 @@ const (
countCookieQuery = `SELECT COUNT(*) FROM cookies`
)
func extractCookies(keys keyretriever.MasterKeys, path string) ([]types.CookieEntry, error) {
func extractCookies(masterKeys keys.MasterKeys, path string) ([]types.CookieEntry, error) {
cookies, err := sqliteutil.QueryRows(path, false, defaultCookieQuery,
func(rows *sql.Rows) (types.CookieEntry, error) {
var (
@@ -34,7 +34,7 @@ func extractCookies(keys keyretriever.MasterKeys, path string) ([]types.CookieEn
return types.CookieEntry{}, err
}
value, _ := decryptValue(keys, encryptedValue)
value, _ := decryptValue(masterKeys, encryptedValue)
value = stripCookieHash(value, host)
return types.CookieEntry{
Name: name,