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

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

Issue 4244055: code review 4244055: net: drop laddr from Dial, cname from LookupHost; new f... (Closed)
Left Patch Set: diff -r 5ccb9b6f8cd1 https://go.googlecode.com/hg Created 13 years ago
Right Patch Set: diff -r 8b9c0b903333 https://go.googlecode.com/hg/ Created 13 years 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/crypto/tls/handshake_client_test.go ('k') | src/pkg/net/Makefile » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 // This package partially implements the TLS 1.1 protocol, as specified in RFC 4 346. 5 // This package partially implements the TLS 1.1 protocol, as specified in RFC 4 346.
6 package tls 6 package tls
7 7
8 import ( 8 import (
9 "crypto/rsa" 9 "crypto/rsa"
10 "crypto/x509" 10 "crypto/x509"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 return NewListener(l, config), nil 81 return NewListener(l, config), nil
82 } 82 }
83 83
84 // Dial connects to the given network address using net.Dial 84 // Dial connects to the given network address using net.Dial
85 // and then initiates a TLS handshake, returning the resulting 85 // and then initiates a TLS handshake, returning the resulting
86 // TLS connection. 86 // TLS connection.
87 // Dial interprets a nil configuration as equivalent to 87 // Dial interprets a nil configuration as equivalent to
88 // the zero configuration; see the documentation of Config 88 // the zero configuration; see the documentation of Config
89 // for the defaults. 89 // for the defaults.
90 func Dial(network, laddr, raddr string, config *Config) (*Conn, os.Error) { 90 func Dial(network, addr string, config *Config) (*Conn, os.Error) {
91 » c, err := net.Dial(network, laddr, raddr) 91 » raddr := addr
92 » c, err := net.Dial(network, raddr)
92 if err != nil { 93 if err != nil {
93 return nil, err 94 return nil, err
94 } 95 }
95 96
96 colonPos := strings.LastIndex(raddr, ":") 97 colonPos := strings.LastIndex(raddr, ":")
97 if colonPos == -1 { 98 if colonPos == -1 {
98 colonPos = len(raddr) 99 colonPos = len(raddr)
99 } 100 }
100 hostname := raddr[:colonPos] 101 hostname := raddr[:colonPos]
101 102
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return 167 return
167 } 168 }
168 169
169 if x509Cert.PublicKeyAlgorithm != x509.RSA || x509Cert.PublicKey.(*rsa.P ublicKey).N.Cmp(key.PublicKey.N) != 0 { 170 if x509Cert.PublicKeyAlgorithm != x509.RSA || x509Cert.PublicKey.(*rsa.P ublicKey).N.Cmp(key.PublicKey.N) != 0 {
170 err = os.ErrorString("crypto/tls: private key does not match pub lic key") 171 err = os.ErrorString("crypto/tls: private key does not match pub lic key")
171 return 172 return
172 } 173 }
173 174
174 return 175 return
175 } 176 }
LEFTRIGHT

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