From da8af5dbcb76c24f751478d0aaf46394635030e2 Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Thu, 14 Jan 2021 19:40:19 -0500 Subject: [PATCH] tofu: Update documentation --- tofu/tofu.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tofu/tofu.go b/tofu/tofu.go index e4bceab..3343a78 100644 --- a/tofu/tofu.go +++ b/tofu/tofu.go @@ -128,7 +128,11 @@ func (k *KnownHosts) Parse(r io.Reader) error { return scanner.Err() } -// TOFU implements a basic Trust On First Use flow. +// TOFU implements basic Trust on First Use. +// +// If the host is not on file, it is added to the list. +// If the host on file is expired, it is replaced with the provided host. +// If the fingerprint does not match the one on file, an error is returned. func (k *KnownHosts) TOFU(hostname string, cert *x509.Certificate) error { host := NewHost(hostname, cert.Raw, cert.NotAfter)