LEFT | RIGHT |
(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 Loading... |
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 Loading... |
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 } |
LEFT | RIGHT |