g10: Record and show statistics for encrypted messages when using TOFU
authorNeal H. Walfield <neal@g10code.com>
Tue, 6 Sep 2016 13:45:38 +0000 (15:45 +0200)
committerNeal H. Walfield <neal@g10code.com>
Tue, 6 Sep 2016 19:37:48 +0000 (21:37 +0200)
commit875ac9216f1383851a82bd240cadb17c7112f6a8
treef5ec927728294d2fbfedaae8204a03e8171f1bc0
parenta9e6db6c7e23d9f4b8de59f5cabbf9eb6a59e626
g10: Record and show statistics for encrypted messages when using TOFU

* g10/tofu.c: Include "sqrtu32.h".
(struct tofu_dbs_s.s): Rename get_trust_gather_other_keys to
get_trust_gather_signature_stats.  Add new field
get_trust_gather_encryption_stats.
(initdb): Create the encryptions table.
(ask_about_binding): Show the encryption statistics too.
(tofu_register): Rename from this...
(tofu_register_signature): ... to this and update callers.
(tofu_register_encryption): New function.
(write_stats_status): Add parameters encryption_count,
encryption_first_done and encryption_most_recent.  Update callers.
Compute the trust using the euclidean distance of the signature and
signature count.  Compare with twice the threshold.  Include
encryption count information in the TFS and TOFU_STATS lines.
(show_statistics): Also get information about the encrypted messages.
* g10/trustdb.c (tdb_get_validity_core): Use it.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
doc/DETAILS
g10/Makefile.am
g10/pkclist.c
g10/tofu.c
g10/tofu.h
g10/trustdb.c