Skip to content

Commit 01160d4

Browse files
committed
update typename to CertificateChains
1 parent 8147924 commit 01160d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

security/advancedtls/advancedtls.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
credinternal "google.golang.org/grpc/internal/credentials"
3636
)
3737

38-
type CertChains [][]*x509.Certificate
38+
type CertificateChains [][]*x509.Certificate
3939

4040
// HandshakeVerificationInfo contains information about a handshake needed for
4141
// verification for use when implementing the `PostHandshakeVerificationFunc`
@@ -49,7 +49,7 @@ type HandshakeVerificationInfo struct {
4949
RawCerts [][]byte
5050
// The verification chain obtained by checking peer RawCerts against the
5151
// trust certificate bundle(s), if applicable.
52-
VerifiedChains CertChains
52+
VerifiedChains CertificateChains
5353
// The leaf certificate sent from peer, if choosing to verify the peer
5454
// certificate(s) and that verification passed. This field would be nil if
5555
// either user chose not to verify or the verification failed.
@@ -486,7 +486,7 @@ func (c *advancedTLSCreds) ClientHandshake(ctx context.Context, authority string
486486
if cfg.ServerName == "" {
487487
cfg.ServerName = authority
488488
}
489-
peerVerifiedChains := CertChains{}
489+
peerVerifiedChains := CertificateChains{}
490490
cfg.VerifyPeerCertificate = buildVerifyFunc(c, cfg.ServerName, rawConn, &peerVerifiedChains)
491491
conn := tls.Client(rawConn, cfg)
492492
errChannel := make(chan error, 1)
@@ -517,7 +517,7 @@ func (c *advancedTLSCreds) ClientHandshake(ctx context.Context, authority string
517517

518518
func (c *advancedTLSCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) {
519519
cfg := credinternal.CloneTLSConfig(c.config)
520-
peerVerifiedChains := CertChains{}
520+
peerVerifiedChains := CertificateChains{}
521521
cfg.VerifyPeerCertificate = buildVerifyFunc(c, "", rawConn, &peerVerifiedChains)
522522
conn := tls.Server(rawConn, cfg)
523523
if err := conn.Handshake(); err != nil {
@@ -564,7 +564,7 @@ func (c *advancedTLSCreds) OverrideServerName(serverNameOverride string) error {
564564
func buildVerifyFunc(c *advancedTLSCreds,
565565
serverName string,
566566
rawConn net.Conn,
567-
peerVerifiedChains *CertChains) func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
567+
peerVerifiedChains *CertificateChains) func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
568568
return func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
569569
chains := verifiedChains
570570
var leafCert *x509.Certificate
@@ -628,7 +628,7 @@ func buildVerifyFunc(c *advancedTLSCreds,
628628
if c.revocationOptions != nil {
629629
verifiedChains := chains
630630
if verifiedChains == nil {
631-
verifiedChains = CertChains{rawCertList}
631+
verifiedChains = CertificateChains{rawCertList}
632632
}
633633
if err := checkChainRevocation(verifiedChains, *c.revocationOptions); err != nil {
634634
return err

0 commit comments

Comments
 (0)