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

Delta Between Two Patch Sets: ssh/server.go

Issue 5755054: code review 5755054: go.crypto/ssh: add support for diffie-hellman-group1-sha1. (Closed)
Left Patch Set: Created 13 years ago
Right Patch Set: diff -r b87c16c531f3 http://code.google.com/p/go.crypto 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 | « ssh/common.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
(no file at all)
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 ssh 5 package ssh
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "crypto" 9 "crypto"
10 "crypto/rand" 10 "crypto/rand"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 } 266 }
267 267
268 var H, K []byte 268 var H, K []byte
269 var hashFunc crypto.Hash 269 var hashFunc crypto.Hash
270 switch kexAlgo { 270 switch kexAlgo {
271 case kexAlgoDH14SHA1: 271 case kexAlgoDH14SHA1:
272 hashFunc = crypto.SHA1 272 hashFunc = crypto.SHA1
273 dhGroup14Once.Do(initDHGroup14) 273 dhGroup14Once.Do(initDHGroup14)
274 H, K, err = s.kexDH(dhGroup14, hashFunc, &magics, hostKeyAlgo) 274 H, K, err = s.kexDH(dhGroup14, hashFunc, &magics, hostKeyAlgo)
275 case keyAlgoDH1SHA1:
276 hashFunc = crypto.SHA1
277 dhGroup1Once.Do(initDHGroup1)
278 H, K, err = s.kexDH(dhGroup1, hashFunc, &magics, hostKeyAlgo)
275 default: 279 default:
276 err = errors.New("ssh: unexpected key exchange algorithm " + kex Algo) 280 err = errors.New("ssh: unexpected key exchange algorithm " + kex Algo)
277 } 281 }
278 if err != nil { 282 if err != nil {
279 return err 283 return err
280 } 284 }
281 285
282 if err = s.writePacket([]byte{msgNewKeys}); err != nil { 286 if err = s.writePacket([]byte{msgNewKeys}); err != nil {
283 return err 287 return err
284 } 288 }
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 func Listen(network, addr string, config *ServerConfig) (*Listener, error) { 643 func Listen(network, addr string, config *ServerConfig) (*Listener, error) {
640 l, err := net.Listen(network, addr) 644 l, err := net.Listen(network, addr)
641 if err != nil { 645 if err != nil {
642 return nil, err 646 return nil, err
643 } 647 }
644 return &Listener{ 648 return &Listener{
645 l, 649 l,
646 config, 650 config,
647 }, nil 651 }, nil
648 } 652 }
LEFTRIGHT

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