File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 15
15
package network
16
16
17
17
import (
18
- "crypto/ecdsa"
19
- "crypto/elliptic"
20
18
"crypto/rand"
19
+ "crypto/rsa"
21
20
"fmt"
22
21
"io/ioutil"
23
22
"net"
@@ -31,6 +30,7 @@ import (
31
30
const (
32
31
defaultPort = 22
33
32
defaultUser = "core"
33
+ rsaKeySize = 2048
34
34
)
35
35
36
36
// DefaultSSHDir is a process-global path that can be set, and
@@ -57,7 +57,7 @@ type SSHAgent struct {
57
57
// NewSSHAgent constructs a new SSHAgent using dialer to create ssh
58
58
// connections.
59
59
func NewSSHAgent (dialer Dialer ) (* SSHAgent , error ) {
60
- key , err := ecdsa .GenerateKey (elliptic . P256 (), rand .Reader )
60
+ key , err := rsa .GenerateKey (rand .Reader , rsaKeySize )
61
61
if err != nil {
62
62
return nil , err
63
63
}
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ func TestConfCopyKey(t *testing.T) {
52
52
53
53
str := conf .String ()
54
54
55
- if ! strings .Contains (str , "ecdsa-sha2-nistp256 " ) || ! strings .Contains (str , " core@default" ) {
55
+ if ! strings .Contains (str , "ssh-rsa " ) || ! strings .Contains (str , " core@default" ) {
56
56
t .Errorf ("ssh public key not found in config %d: %s" , i , str )
57
57
continue
58
58
}
You can’t perform that action at this time.
0 commit comments