Fix known hosts expiration timestamps

This commit is contained in:
Adnan Maolood
2020-11-25 14:24:49 -05:00
parent 8ee55ee009
commit 3c7940f153
2 changed files with 31 additions and 97 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ func (k *KnownHostsFile) WriteAll(w io.Writer) error {
// writeKnownHost writes a known host to the provided io.Writer.
func (k *KnownHostsFile) writeKnownHost(w io.Writer, hostname string, f Fingerprint) (int, error) {
s := base64.StdEncoding.EncodeToString([]byte(f.Raw))
return fmt.Fprintf(w, "%s %s %s %d\n", hostname, f.Algorithm, s, f.Expires)
return fmt.Fprintf(w, "%s %s %s %d\n", hostname, f.Algorithm, s, f.Expires.Unix())
}
// Load loads the known hosts from the provided path.