summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Zangerl <az@snafu.priv.at>2015-08-29 10:41:07 +1000
committerAlexander Zangerl <az@snafu.priv.at>2015-08-29 10:41:07 +1000
commiteeb9c6c18c1e914370afc9cbf59af68b1d37f497 (patch)
tree180478d01ae95d2b84d49c90accc9479e859cf42
parent0578695c7705e604ac67b46a73d86789f998244e (diff)
downloadkuvert-eeb9c6c18c1e914370afc9cbf59af68b1d37f497.tar.gz
kuvert-eeb9c6c18c1e914370afc9cbf59af68b1d37f497.tar.bz2
kuvert-eeb9c6c18c1e914370afc9cbf59af68b1d37f497.tar.xz
kuvert-eeb9c6c18c1e914370afc9cbf59af68b1d37f497.zip
added a bit of polite backoff delay to re-retrievals of passwords
-rwxr-xr-xkuvert14
1 files changed, 14 insertions, 0 deletions
diff --git a/kuvert b/kuvert
index c61ad31..c1519f7 100755
--- a/kuvert
+++ b/kuvert
@@ -289,11 +289,18 @@ sub sign_send
# generate the signature, repeat until proper passphrase given
# or until gpg gives up with a different error indication
my @res;
+ my $backoff = 0;
while (1)
{
@res=&sign_encrypt($signkey,$dumpfile,$output,());
last if ($res[0]!=1); # no error or fatal error
dlogit("gpg reported bad passphrase, retrying.");
+ if ($config{"query-secret"})
+ {
+ # be polite to the query tool and back off up to 8 sec
+ sleep($backoff);
+ $backoff += 2 if ($backoff < 8);
+ }
if (!$config{"use-agent"} && $config{"flush-secret"} && $signkey)
{
dlogit("invalidating passphrase for $signkey");
@@ -351,11 +358,18 @@ sub crypt_send
# generate the encrypted data, repeat until proper passphrase given
my @res;
+ my $backoff = 0;
while (1)
{
@res=&sign_encrypt($signkey,$dumpfile,$output,@{$rec_keys});
last if ($res[0]!=1); # no error or fatal error
dlogit("gpg reported bad passphrase, retrying.");
+ if ($config{"query-secret"})
+ {
+ # be polite to the query tool and back off up to 8 sec
+ sleep($backoff);
+ $backoff += 2 if ($backoff < 8);
+ }
if (!$config{"use-agent"} && $config{"flush-secret"} && $signkey)
{
dlogit("invalidating passphrase for $signkey");