Esempio n. 1
0
func (cach *connectionAwaitClientHandshake) verifyPeerCerts(topology *configuration.Topology, peerCerts []*x509.Certificate) (authenticated bool, hashsum [sha256.Size]byte) {
	fingerprints := topology.Fingerprints()
	for _, cert := range peerCerts {
		hashsum = sha256.Sum256(cert.Raw)
		if _, found := fingerprints[hashsum]; found {
			return true, hashsum
		}
	}
	return false, hashsum
}