|
|
@ -33,10 +33,7 @@ func (c *chromium) Init() error { |
|
|
|
if err := c.initProfile(); err != nil { |
|
|
|
if err := c.initProfile(); err != nil { |
|
|
|
return fmt.Errorf("profile path '%s' does not exist %w", c.profilePath, ErrBrowserNotExists) |
|
|
|
return fmt.Errorf("profile path '%s' does not exist %w", c.profilePath, ErrBrowserNotExists) |
|
|
|
} |
|
|
|
} |
|
|
|
if err := c.initMasterKey(); err != nil { |
|
|
|
return c.initMasterKey() |
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *chromium) initBrowserData() error { |
|
|
|
func (c *chromium) initBrowserData() error { |
|
|
@ -94,9 +91,7 @@ func (c *chromium) findAllProfiles() ([]string, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *chromium) initMasterKey() error { |
|
|
|
func (c *chromium) initMasterKey() error { |
|
|
|
var ( |
|
|
|
var stdout, stderr bytes.Buffer |
|
|
|
stdout, stderr bytes.Buffer |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
args := []string{"find-generic-password", "-wa", strings.TrimSpace(c.storage)} |
|
|
|
args := []string{"find-generic-password", "-wa", strings.TrimSpace(c.storage)} |
|
|
|
cmd := exec.Command("security", args...) //nolint:gosec
|
|
|
|
cmd := exec.Command("security", args...) //nolint:gosec
|
|
|
|
cmd.Stdout = &stdout |
|
|
|
cmd.Stdout = &stdout |
|
|
|