Lint 13.go

This commit is contained in:
Christopher Patton 2018-05-29 09:23:27 -07:00 committed by Henry Dorsett Case
parent c20de2f694
commit 81ee64180a

42
13.go
View File

@ -322,18 +322,18 @@ func (hs *serverHandshakeState) readClientFinished13(hasConfirmLock bool) error
return err return err
} }
certVerify, ok := msg.(*certificateVerifyMsg); certVerify, ok := msg.(*certificateVerifyMsg)
if !ok { if !ok {
c.sendAlert(alertUnexpectedMessage) c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(certVerify, msg) return unexpectedMessageError(certVerify, msg)
} }
err, alertCode := verifyPeerCertificate( err, alertCode := verifyPeerCertificate(
certVerify, certVerify,
pubKey, pubKey,
supportedSignatureAlgorithms13, supportedSignatureAlgorithms13,
hs.keySchedule.transcriptHash.Sum(nil), hs.keySchedule.transcriptHash.Sum(nil),
"TLS 1.3, client CertificateVerify"); "TLS 1.3, client CertificateVerify")
if err != nil { if err != nil {
c.sendAlert(alertCode) c.sendAlert(alertCode)
return err return err
@ -824,7 +824,7 @@ func (hs *serverHandshakeState) traceErr(err error) {
} }
} }
func getCertsFromEntries(certEntries []certificateEntry) ([][]byte) { func getCertsFromEntries(certEntries []certificateEntry) [][]byte {
certs := make([][]byte, len(certEntries)) certs := make([][]byte, len(certEntries))
for i, cert := range certEntries { for i, cert := range certEntries {
certs[i] = cert.data certs[i] = cert.data
@ -842,17 +842,17 @@ func (hs *clientHandshakeState) processEncryptedExtensions(ee *encryptedExtensio
} }
func verifyPeerCertificate( func verifyPeerCertificate(
certVerify *certificateVerifyMsg, certVerify *certificateVerifyMsg,
pubKey crypto.PublicKey, pubKey crypto.PublicKey,
signAlgosKnown []SignatureScheme, signAlgosKnown []SignatureScheme,
transHash []byte, transHash []byte,
contextString string) (error, alert) { contextString string) (error, alert) {
_, sigType, hashFunc, err := pickSignatureAlgorithm( _, sigType, hashFunc, err := pickSignatureAlgorithm(
pubKey, pubKey,
[]SignatureScheme{certVerify.signatureAlgorithm}, []SignatureScheme{certVerify.signatureAlgorithm},
signAlgosKnown, signAlgosKnown,
VersionTLS13) VersionTLS13)
if err != nil { if err != nil {
return err, alertHandshakeFailure return err, alertHandshakeFailure
} }
@ -1049,11 +1049,11 @@ func (hs *clientHandshakeState) doTLS13Handshake() error {
return unexpectedMessageError(certVerifyMsg, msg) return unexpectedMessageError(certVerifyMsg, msg)
} }
err, alertCode := verifyPeerCertificate( err, alertCode := verifyPeerCertificate(
certVerifyMsg, certVerifyMsg,
hs.c.peerCertificates[0].PublicKey, hs.c.peerCertificates[0].PublicKey,
hs.hello.supportedSignatureAlgorithms, hs.hello.supportedSignatureAlgorithms,
hs.keySchedule.transcriptHash.Sum(nil), hs.keySchedule.transcriptHash.Sum(nil),
"TLS 1.3, server CertificateVerify"); "TLS 1.3, server CertificateVerify")
if err != nil { if err != nil {
c.sendAlert(alertCode) c.sendAlert(alertCode)
return err return err