tofu: Use base64-encoded sha256 fingerprints

This commit is contained in:
Adnan Maolood
2021-03-06 15:24:14 -05:00
parent c639233ea1
commit 6e5c2473e7
2 changed files with 18 additions and 67 deletions

View File

@@ -6,7 +6,6 @@ package main
import (
"bufio"
"bytes"
"context"
"crypto/x509"
"errors"
@@ -64,7 +63,7 @@ func trustCertificate(hostname string, cert *x509.Certificate) error {
knownHost, ok := hosts.Lookup(hostname)
if ok {
// Check fingerprint
if bytes.Equal(knownHost.Fingerprint, host.Fingerprint) {
if knownHost.Fingerprint != host.Fingerprint {
return nil
}
return errors.New("error: fingerprint does not match!")