From 4869454a780e91d74180bf4ce1912a0f96177fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=8D=E1=B4=8F=E1=B4=8F=C9=B4D4=CA=80=E1=B4=8B?= Date: Sat, 1 Aug 2020 16:58:32 +0800 Subject: [PATCH] add doc for interface function. Close #23 --- core/browser.go | 7 +++++++ core/common/parse.go | 9 +++++++++ core/decrypt/decrypt_darwin.go | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/browser.go b/core/browser.go index 35f389a..d3edd8f 100644 --- a/core/browser.go +++ b/core/browser.go @@ -18,9 +18,16 @@ const ( ) type Browser interface { + // InitSecretKey is init chrome secret key, firefox's key always empty InitSecretKey() error + + // GetName return browser name GetName() string + + // GetSecretKey return browser secret key GetSecretKey() []byte + + // GetAllItems, default return all of items(password|bookmark|cookie|history) GetAllItems(itemName string) ([]common.Item, error) } diff --git a/core/common/parse.go b/core/common/parse.go index 6b3042a..b53c445 100644 --- a/core/common/parse.go +++ b/core/common/parse.go @@ -19,10 +19,19 @@ import ( ) type Item interface { + // ChromeParse parse chrome items, Password and Cookie need secret key ChromeParse(key []byte) error + + // FirefoxParse parse firefox items FirefoxParse() error + + // OutPut with json or csv OutPut(format, browser, dir string) error + + // Copy item file to local path CopyItem() error + + // Release item file Release() error } diff --git a/core/decrypt/decrypt_darwin.go b/core/decrypt/decrypt_darwin.go index 1a6751b..9b9a433 100644 --- a/core/decrypt/decrypt_darwin.go +++ b/core/decrypt/decrypt_darwin.go @@ -93,7 +93,7 @@ func decryptPBE(globalSalt, masterPwd, entrySalt, encrypted []byte) ([]byte, err //byte[] k1; //byte[] tk; //byte[] k2; - //byte[] k; // final value conytaining key and iv + //byte[] k; // final value containing key and iv glmp := append(globalSalt, masterPwd...) hp := sha1.Sum(glmp) s := append(hp[:], entrySalt...)