diff --git a/examples/client.go b/examples/client.go index e3c7537..251c6cd 100644 --- a/examples/client.go +++ b/examples/client.go @@ -17,11 +17,12 @@ import ( "time" "git.sr.ht/~adnano/go-gemini" + "git.sr.ht/~adnano/go-gemini/tofu" "git.sr.ht/~adnano/go-xdg" ) var ( - hosts gemini.KnownHostsFile + hosts tofu.KnownHostsFile scanner *bufio.Scanner ) @@ -46,7 +47,7 @@ Otherwise, this should be safe to trust. => ` func trustCertificate(hostname string, cert *x509.Certificate) error { - fingerprint := gemini.NewFingerprint(cert.Raw, cert.NotAfter) + fingerprint := tofu.NewFingerprint(cert.Raw, cert.NotAfter) knownHost, ok := hosts.Lookup(hostname) if ok && time.Now().Before(knownHost.Expires) { // Check fingerprint diff --git a/tofu.go b/tofu/tofu.go similarity index 97% rename from tofu.go rename to tofu/tofu.go index 9a252d6..547894a 100644 --- a/tofu.go +++ b/tofu/tofu.go @@ -1,4 +1,5 @@ -package gemini +// Package tofu implements trust on first use using hosts and fingerprints. +package tofu import ( "bufio"