tofu: Use base64-encoded sha256 fingerprints
This commit is contained in:
@@ -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!")
|
||||
|
||||
Reference in New Issue
Block a user