]> Sergey Matveev's repositories - tofuproxy.git/commitdiff
Hotkeys
authorSergey Matveev <stargrave@stargrave.org>
Sun, 12 Sep 2021 19:42:16 +0000 (22:42 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 12 Sep 2021 19:42:16 +0000 (22:42 +0300)
doc/usage.texi
verify.go

index eb88636dcf3e104a627df3078d3310ff1aa3bb51..e179a42167eb99058027132aadb4ecdf7ec401fc 100644 (file)
@@ -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:
index ed9865094a8d6768ebef4cc9fbadacdeb593f08a..4c5ad35d526b9f0ab7daa709473c6b0423bccd48 100644 (file)
--- 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 . <KeyPress> {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 (