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

Side by Side Diff: ssh/server.go

Issue 13415046: code review 13415046: go.crypto/ssh: remove misleading marshalPrivRSA. (Closed)
Patch Set: diff -r 1d2f9a3b9863 https://code.google.com/p/go.crypto Created 11 years, 6 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:
View unified diff | Download patch
« no previous file with comments | « ssh/keys.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ecdsa" 10 "crypto/ecdsa"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 block, _ := pem.Decode(pemBytes) 75 block, _ := pem.Decode(pemBytes)
76 if block == nil { 76 if block == nil {
77 return errors.New("ssh: no key found") 77 return errors.New("ssh: no key found")
78 } 78 }
79 var err error 79 var err error
80 s.rsa, err = x509.ParsePKCS1PrivateKey(block.Bytes) 80 s.rsa, err = x509.ParsePKCS1PrivateKey(block.Bytes)
81 if err != nil { 81 if err != nil {
82 return err 82 return err
83 } 83 }
84 84
85 » s.rsaSerialized = marshalPrivRSA(s.rsa) 85 » s.rsaSerialized = serializePublicKey(&s.rsa.PublicKey)
86 return nil 86 return nil
87 } 87 }
88 88
89 func parseRSASig(in []byte) (sig []byte, ok bool) { 89 func parseRSASig(in []byte) (sig []byte, ok bool) {
90 algo, in, ok := parseString(in) 90 algo, in, ok := parseString(in)
91 if !ok || string(algo) != hostAlgoRSA { 91 if !ok || string(algo) != hostAlgoRSA {
92 return nil, false 92 return nil, false
93 } 93 }
94 sig, in, ok = parseString(in) 94 sig, in, ok = parseString(in)
95 if len(in) > 0 { 95 if len(in) > 0 {
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 func Listen(network, addr string, config *ServerConfig) (*Listener, error) { 903 func Listen(network, addr string, config *ServerConfig) (*Listener, error) {
904 l, err := net.Listen(network, addr) 904 l, err := net.Listen(network, addr)
905 if err != nil { 905 if err != nil {
906 return nil, err 906 return nil, err
907 } 907 }
908 return &Listener{ 908 return &Listener{
909 l, 909 l,
910 config, 910 config,
911 }, nil 911 }, nil
912 } 912 }
OLDNEW
« no previous file with comments | « ssh/keys.go ('k') | no next file » | no next file with comments »

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