Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(562)

Delta Between Two Patch Sets: src/pkg/crypto/tls/handshake_client.go

Issue 5262041: code review 5262041: crypto/tls: fetch root certificates using Mac OS API (Closed)
Left Patch Set: diff -r 988a7f023895 https://go.googlecode.com/hg/ Created 12 years, 5 months ago
Right Patch Set: diff -r 988a7f023895 https://go.googlecode.com/hg/ Created 12 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/crypto/tls/common.go ('k') | src/pkg/crypto/tls/handshake_server_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package tls 5 package tls
6 6
7 import ( 7 import (
8 "crypto" 8 "crypto"
9 "crypto/rsa" 9 "crypto/rsa"
10 "crypto/subtle" 10 "crypto/subtle"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 certs := make([]*x509.Certificate, len(certMsg.certificates)) 90 certs := make([]*x509.Certificate, len(certMsg.certificates))
91 for i, asn1Data := range certMsg.certificates { 91 for i, asn1Data := range certMsg.certificates {
92 cert, err := x509.ParseCertificate(asn1Data) 92 cert, err := x509.ParseCertificate(asn1Data)
93 if err != nil { 93 if err != nil {
94 c.sendAlert(alertBadCertificate) 94 c.sendAlert(alertBadCertificate)
95 return os.NewError("failed to parse certificate from ser ver: " + err.String()) 95 return os.NewError("failed to parse certificate from ser ver: " + err.String())
96 } 96 }
97 certs[i] = cert 97 certs[i] = cert
98 } 98 }
99 99
100 » if c.config.InsecureSkipVerify == false { 100 » if !c.config.InsecureSkipVerify {
rsc 2011/10/13 17:17:59 if !c.config.InsecureSkipVerify {
101 opts := x509.VerifyOptions{ 101 opts := x509.VerifyOptions{
102 Roots: c.config.rootCAs(), 102 Roots: c.config.rootCAs(),
103 CurrentTime: c.config.time(), 103 CurrentTime: c.config.time(),
104 DNSName: c.config.ServerName, 104 DNSName: c.config.ServerName,
105 Intermediates: x509.NewCertPool(), 105 Intermediates: x509.NewCertPool(),
106 } 106 }
107 107
108 for i, cert := range certs { 108 for i, cert := range certs {
109 if i == 0 { 109 if i == 0 {
110 continue 110 continue
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 for _, s := range serverProtos { 304 for _, s := range serverProtos {
305 for _, c := range clientProtos { 305 for _, c := range clientProtos {
306 if s == c { 306 if s == c {
307 return s, false 307 return s, false
308 } 308 }
309 } 309 }
310 } 310 }
311 311
312 return clientProtos[0], true 312 return clientProtos[0], true
313 } 313 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b