Tkabber

Check-in [2102ce602b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Show the last 16 hexadecimal digits as keyid for GPG keys instead of 8 because of existing examples of keys with the same short keyids.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2102ce602bae731ba6d7197dd9e2170a2fc74be0
User & Date: sgolovan 2016-07-09 08:51:42
Context
2016-08-18
12:35
Changed the meaning of omitted priority argument for hook::remove. Now it means 'remove all matched scripts from a hook' instead of 'remove matched script with priority 50'. check-in: 93d0303aad user: sgolovan tags: trunk
2016-07-09
08:51
Show the last 16 hexadecimal digits as keyid for GPG keys instead of 8 because of existing examples of keys with the same short keyids. check-in: 2102ce602b user: sgolovan tags: trunk
2016-06-30
04:16
Fixed typo. check-in: 0c110e46a5 user: sgolovan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2016-06-30  Sergei Golovan  <sgolovan@nes.ru>

	* richtext.tcl: Fixed typo.

2016-04-25  Sergei Golovan  <sgolovan@nes.ru>

	* plugins/unix/dockingtray.tcl, plugins/unix/systray.tcl: Removed
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2016-07-09  Sergei Golovan  <sgolovan@nes.ru>

	* plugins/general/gpgme.tcl: Show the last 16 hexadecimal digits as
	  keyid for GPG keys instead of 8 because of existing examples of
	  keys with the same short keyids.

2016-06-30  Sergei Golovan  <sgolovan@nes.ru>

	* richtext.tcl: Fixed typo.

2016-04-25  Sergei Golovan  <sgolovan@nes.ru>

	* plugins/unix/dockingtray.tcl, plugins/unix/systray.tcl: Removed

Changes to plugins/general/gpgme.tcl.

282
283
284
285
286
287
288




289
290
291
292
293
294
295
296
297
298
299
300
301

    CbDialog $dw [::msgcat::mc "Select Key for Signing %s Traffic" $pattern] \
        [list [::msgcat::mc "Select"] [list ::ssj::once_only_aux $dw $xlib] \
              [::msgcat::mc "Cancel"] [list destroy $dw]] \
        ::ssj::selectkey[psuffix $xlib] $titles $balloons \
        -modal local
}





proc ::ssj::key_balloon_text {key} {
    array set params $key
    if {[catch {format "%d%s/%s %s" $params(length)          \
                       [string range $params(algorithm) 0 0]   \
                       [string range $params(keyid) end-7 end] \
                       [clock format $params(created)          \
                                     -format "%Y-%m-%d"]} text]} {
        return ""
    }

    foreach {k v} $key {
        switch -- $k {







>
>
>
>





|







282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305

    CbDialog $dw [::msgcat::mc "Select Key for Signing %s Traffic" $pattern] \
        [list [::msgcat::mc "Select"] [list ::ssj::once_only_aux $dw $xlib] \
              [::msgcat::mc "Cancel"] [list destroy $dw]] \
        ::ssj::selectkey[psuffix $xlib] $titles $balloons \
        -modal local
}

proc ::ssj::keyid {fingerprint} {
    string range $fingerprint end-15 end
}

proc ::ssj::key_balloon_text {key} {
    array set params $key
    if {[catch {format "%d%s/%s %s" $params(length)          \
                       [string range $params(algorithm) 0 0]   \
                       [keyid $params(keyid)] \
                       [clock format $params(created)          \
                                     -format "%Y-%m-%d"]} text]} {
        return ""
    }

    foreach {k v} $key {
        switch -- $k {
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
                        ![info exists warnings(verify,$from)]} {
            set warnings(verify,$from) 1
            if {[info exists j2k($from)]} {
                set message [::msgcat::mc "%s purportedly signed by %s\
                                           using key 0x%s can't be\
                                           verified: %s." \
                                          $what $from \
                                          [string range $j2k($from) end-7 end] \
                                          $result]
            } else {
                set message [::msgcat::mc "%s purportedly signed by %s\
                                           can't be verified: %s." \
                                          $what $from $result]
            }
            hook::run gpg_input_error_hook $xlib $from $what $message







|







496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
                        ![info exists warnings(verify,$from)]} {
            set warnings(verify,$from) 1
            if {[info exists j2k($from)]} {
                set message [::msgcat::mc "%s purportedly signed by %s\
                                           using key 0x%s can't be\
                                           verified: %s." \
                                          $what $from \
                                          [keyid $j2k($from)] \
                                          $result]
            } else {
                set message [::msgcat::mc "%s purportedly signed by %s\
                                           can't be verified: %s." \
                                          $what $from $result]
            }
            hook::run gpg_input_error_hook $xlib $from $what $message
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
                created {
                    append info "created: [clock format $v]\n"
                }
                expires {
                    append info "expires: [clock format $v]\n"
                }
                fingerprint {
                    append info [format "keyid: 0x%s\n" \
                                        [string range $v end-7 end]]
                    append info [format "%s: %s\n" $k $v]
                }
                default {
                    if {$v ne ""} {
                        append info [format "%s: %s\n" $k $v]
                    }
                }







|
<







623
624
625
626
627
628
629
630

631
632
633
634
635
636
637
                created {
                    append info "created: [clock format $v]\n"
                }
                expires {
                    append info "expires: [clock format $v]\n"
                }
                fingerprint {
                    append info [format "keyid: 0x%s\n" [keyid $v]]

                    append info [format "%s: %s\n" $k $v]
                }
                default {
                    if {$v ne ""} {
                        append info [format "%s: %s\n" $k $v]
                    }
                }
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
    variable f2s

    set text ""
    foreach {fp info} $output {
        unset -nocomplain status
        array set status $info
        if {$status(status) ne "ok"} {
            append text "\n0x[string range $fp end-7 end]: $status(reason)"
        } else {
            set flags {}
            foreach f $status(flags) {
                lappend flags $f2s($f)
            }
            set tflags [join $flags ",\n\t"]
            if {[catch {$ctx($xlib) info-key -key $fp} keyinfo]} {
                append text "\n0x[string range $fp end-7 end]:\n\t$tflags"
            } else {
                set uids ""
                foreach {k v} $keyinfo {
                    if {$k eq "userid"} {
                        append uids "\n    $v"
                    }
                }
                append text "\n0x[string range $fp end-7 end]$uids:\n\t$tflags"
            }
        }
    }

    NonmodalMessageDlg .keyfetch_ok[incr gpg_error_id] \
            -aspect 50000 -icon info \
            -message "Key fetch result\n$text"







|







|







|







804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
    variable f2s

    set text ""
    foreach {fp info} $output {
        unset -nocomplain status
        array set status $info
        if {$status(status) ne "ok"} {
            append text "\n0x[keyid $fp]: $status(reason)"
        } else {
            set flags {}
            foreach f $status(flags) {
                lappend flags $f2s($f)
            }
            set tflags [join $flags ",\n\t"]
            if {[catch {$ctx($xlib) info-key -key $fp} keyinfo]} {
                append text "\n0x[keyid $fp]:\n\t$tflags"
            } else {
                set uids ""
                foreach {k v} $keyinfo {
                    if {$k eq "userid"} {
                        append uids "\n    $v"
                    }
                }
                append text "\n0x[keyid $fp]$uids:\n\t$tflags"
            }
        }
    }

    NonmodalMessageDlg .keyfetch_ok[incr gpg_error_id] \
            -aspect 50000 -icon info \
            -message "Key fetch result\n$text"
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
                            continue
                        }
                        created -
                        expires {
                            set v [clock format $v]
                        }
                        fingerprint {
                            lappend kv keyid \
                                [format "0x%s" [string range $v end-7 end]]
                        }
                        default {
                            if {$v eq ""} continue
                        }
                    }

                    lappend kv $k $v







|
<







1497
1498
1499
1500
1501
1502
1503
1504

1505
1506
1507
1508
1509
1510
1511
                            continue
                        }
                        created -
                        expires {
                            set v [clock format $v]
                        }
                        fingerprint {
                            lappend kv keyid [format "0x%s" [keyid $v]]

                        }
                        default {
                            if {$v eq ""} continue
                        }
                    }

                    lappend kv $k $v