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

Delta Between Two Patch Sets: src/pkg/crypto/x509/cert_pool.go

Issue 5448093: crypto/tls: Make TLS Client Authentication work according to the spec (Closed)
Left Patch Set: diff -r 85e087089edf https://go.googlecode.com/hg/ Created 12 years, 3 months ago
Right Patch Set: diff -r 7ec969250bfc https://go.googlecode.com/hg/ Created 12 years, 2 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/tls.go ('k') | no next file » | 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 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 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 x509 5 package x509
6 6
7 import ( 7 import (
8 "encoding/pem" 8 "encoding/pem"
9 ) 9 )
10 10
(...skipping 10 matching lines...) Expand all
21 make(map[string][]int), 21 make(map[string][]int),
22 make(map[string][]int), 22 make(map[string][]int),
23 nil, 23 nil,
24 } 24 }
25 } 25 }
26 26
27 // findVerifiedParents attempts to find certificates in s which have signed the 27 // findVerifiedParents attempts to find certificates in s which have signed the
28 // given certificate. If no such certificate can be found or the signature 28 // given certificate. If no such certificate can be found or the signature
29 // doesn't match, it returns nil. 29 // doesn't match, it returns nil.
30 func (s *CertPool) findVerifiedParents(cert *Certificate) (parents []int) { 30 func (s *CertPool) findVerifiedParents(cert *Certificate) (parents []int) {
31 if s == nil {
32 return
33 }
31 var candidates []int 34 var candidates []int
32 35
33 if len(cert.AuthorityKeyId) > 0 { 36 if len(cert.AuthorityKeyId) > 0 {
34 candidates = s.bySubjectKeyId[string(cert.AuthorityKeyId)] 37 candidates = s.bySubjectKeyId[string(cert.AuthorityKeyId)]
35 } 38 }
36 if len(candidates) == 0 { 39 if len(candidates) == 0 {
37 candidates = s.byName[string(cert.RawIssuer)] 40 candidates = s.byName[string(cert.RawIssuer)]
38 } 41 }
39 42
40 for _, c := range candidates { 43 for _, c := range candidates {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 104
102 // Subjects returns a list of the DER-encoded subjects of 105 // Subjects returns a list of the DER-encoded subjects of
103 // all of the certificates in the pool.· 106 // all of the certificates in the pool.·
104 func (s *CertPool) Subjects() (res [][]byte) { 107 func (s *CertPool) Subjects() (res [][]byte) {
105 res = make([][]byte, len(s.certs)) 108 res = make([][]byte, len(s.certs))
106 for i, c := range s.certs { 109 for i, c := range s.certs {
107 res[i] = c.RawSubject 110 res[i] = c.RawSubject
108 } 111 }
109 return 112 return
110 } 113 }
LEFTRIGHT

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