From: Sergey Matveev Date: Sun, 12 Sep 2021 19:42:16 +0000 (+0300) Subject: Hotkeys X-Git-Tag: v0.1.0~65 X-Git-Url: http://www.git.stargrave.org/?p=tofuproxy.git;a=commitdiff_plain;h=67ef2e681c52faa970eeb4858101bf67d2b09646 Hotkeys --- diff --git a/doc/usage.texi b/doc/usage.texi index eb88636..e179a42 100644 --- a/doc/usage.texi +++ b/doc/usage.texi @@ -74,6 +74,20 @@ will be shown Tk-dialog through the @command{wish} invocation. GnuTLS'es @image{dialog,,,Example dialog,.webp} +@item +Certificate trust decision dialog (like above one) has multiple hotkeys: + + @itemize + @item @code{a} -- accept and save certificate chain to disk + @item @code{o} -- accept once per session (@command{tofuproxy} running) + @item @code{r} -- reject certificate + @item @code{q} -- reject certificate really once, same as closing the window + @item @code{n} -- next page of "their" certificate chain + @item @code{p} -- previous page of "their" certificate chain + @item @code{N} -- next page of "our" certificate chain + @item @code{P} -- previous page of "our" certificate chain + @end itemize + @item To list currently accepted, rejected, HTTP authorized, TLS client authenticated hosts: diff --git a/verify.go b/verify.go index ed98650..4c5ad35 100644 --- a/verify.go +++ b/verify.go @@ -114,13 +114,27 @@ if {$daneStatus ne ""} { $lDANE configure -bg $daneColour($daneStatus) $lDANE configure -text "DANE-EE: $daneStatus" } -button .bAccept -text "Accept" -bg green -command { exit 10 } -button .bOnce -text "Once" -bg green -command { exit 11 } -button .bReject -text "Reject" -bg red -command { exit 12 } +proc doAccept {} { exit 10 } +proc doOnce {} { exit 11 } +proc doReject {} { exit 12 } +button .bAccept -text "Accept" -bg green -command doAccept +button .bOnce -text "Once" -bg green -command doOnce +button .bReject -text "Reject" -bg red -command doReject grid .fButtons grid .lDANE .bAccept .bOnce .bReject -in .fButtons grid rowconfigure . 0 -weight 1 grid columnconfigure . 0 -weight 1 + +bind . {switch -exact %K { + q {exit 0} ; # reject once + a doAccept + o doOnce + r doReject + n {.bNextTheir invoke} + p {.bPrevTheir invoke} + N {.bNextOur invoke} + P {.bPrevOur invoke} +}} ` var (