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

Delta Between Two Patch Sets: ssh/certs.go

Issue 13338044: code review 13338044: go.crypto/ssh: introduce PrivateKey method. (Closed)
Left Patch Set: diff -r c923f02daf74 https://code.google.com/p/go.crypto Created 10 years, 6 months ago
Right Patch Set: diff -r c923f02daf74 https://code.google.com/p/go.crypto Created 10 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:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | ssh/client_auth_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
(no file at all)
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 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 "time" 8 "time"
9 ) 9 )
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 KeyAlgoECDSA384: CertAlgoECDSA384v01, 59 KeyAlgoECDSA384: CertAlgoECDSA384v01,
60 KeyAlgoECDSA521: CertAlgoECDSA521v01, 60 KeyAlgoECDSA521: CertAlgoECDSA521v01,
61 } 61 }
62 62
63 func (c *OpenSSHCertV01) PublicKeyAlgo() string { 63 func (c *OpenSSHCertV01) PublicKeyAlgo() string {
64 algo, ok := certAlgoNames[c.Key.PublicKeyAlgo()] 64 algo, ok := certAlgoNames[c.Key.PublicKeyAlgo()]
65 if !ok { 65 if !ok {
66 panic("unknown cert key type") 66 panic("unknown cert key type")
67 } 67 }
68 return algo 68 return algo
69 }
70
71 func (c *OpenSSHCertV01) RawKey() interface{} {
72 return c.Key.RawKey()
73 } 69 }
74 70
75 func (c *OpenSSHCertV01) PrivateKeyAlgo() string { 71 func (c *OpenSSHCertV01) PrivateKeyAlgo() string {
76 return c.Key.PrivateKeyAlgo() 72 return c.Key.PrivateKeyAlgo()
77 } 73 }
78 74
79 func (c *OpenSSHCertV01) Verify(data []byte, sig []byte) bool { 75 func (c *OpenSSHCertV01) Verify(data []byte, sig []byte) bool {
80 return c.Key.Verify(data, sig) 76 return c.Key.Verify(data, sig)
81 } 77 }
82 78
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 304
309 func parseSignature(in []byte) (out *signature, rest []byte, ok bool) { 305 func parseSignature(in []byte) (out *signature, rest []byte, ok bool) {
310 var sigBytes []byte 306 var sigBytes []byte
311 if sigBytes, rest, ok = parseString(in); !ok { 307 if sigBytes, rest, ok = parseString(in); !ok {
312 return 308 return
313 } 309 }
314 310
315 // TODO(hanwen): this is a bug; 'rest' gets swallowed. 311 // TODO(hanwen): this is a bug; 'rest' gets swallowed.
316 return parseSignatureBody(sigBytes) 312 return parseSignatureBody(sigBytes)
317 } 313 }
LEFTRIGHT

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