aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-05-19 22:31:56 +0700
committerShulhan <ms@kilabit.info>2023-05-19 22:31:56 +0700
commita31b534b36eda669bab99819e4b45fa343ff38d9 (patch)
treeda14195f9625565adf362484c5740bded25ffe6f /config.go
parentdded88bf1546f30185e2fc30c11e4f1322abd213 (diff)
downloadgotp-a31b534b36eda669bab99819e4b45fa343ff38d9.tar.xz
all: load private key only when needed
In case the configuration use private key with passphrase, the bash completion will hang due to the command ask for passphrase. This changes fix this issue by loading private key only when doing add, generate, import, or remote-private-key.
Diffstat (limited to 'config.go')
-rw-r--r--config.go7
1 files changed, 0 insertions, 7 deletions
diff --git a/config.go b/config.go
index 29a63e3..024450c 100644
--- a/config.go
+++ b/config.go
@@ -77,13 +77,6 @@ func loadConfig(content []byte) (cfg *config, err error) {
return nil, fmt.Errorf(`%s: %w`, logp, err)
}
- if len(cfg.PrivateKey) > 0 {
- cfg.privateKey, err = loadPrivateKey(cfg.PrivateKey, nil)
- if err != nil {
- return nil, fmt.Errorf(`%s: %w`, logp, err)
- }
- }
-
return cfg, nil
}