File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ require (
11
11
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c
12
12
github.com/logrusorgru/aurora v0.0.0-20191116043053-66b7ad493a23
13
13
github.com/mattn/go-isatty v0.0.10 // indirect
14
+ github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
14
15
github.com/oschwald/maxminddb-golang v1.5.0 // indirect
15
16
github.com/pires/go-proxyproto v0.0.0-20190615163442-2c19fd512994
16
17
github.com/ugorji/go v1.1.7 // indirect
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ github.com/logrusorgru/aurora v0.0.0-20191116043053-66b7ad493a23/go.mod h1:7rIyQ
27
27
github.com/mattn/go-isatty v0.0.7 /go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s =
28
28
github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10 =
29
29
github.com/mattn/go-isatty v0.0.10 /go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84 =
30
+ github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a h1:eU8j/ClY2Ty3qdHnn0TyW3ivFoPC/0F1gQZz8yTxbbE =
31
+ github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a /go.mod h1:v8eSC2SMp9/7FTKUncp7fH9IwPfw+ysMObcEz5FWheQ =
30
32
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 /go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q =
31
33
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg =
32
34
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd /go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q =
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ package main
2
2
3
3
import (
4
4
"bytes"
5
+ "crypto/ed25519"
5
6
"crypto/rand"
6
- "crypto/rsa"
7
7
"crypto/x509"
8
8
"encoding/pem"
9
9
"fmt"
@@ -21,6 +21,7 @@ import (
21
21
22
22
"github.com/fsnotify/fsnotify"
23
23
"github.com/logrusorgru/aurora"
24
+ "github.com/mikesmitty/edkey"
24
25
"golang.org/x/crypto/ssh"
25
26
)
26
27
@@ -226,16 +227,16 @@ func getSSHConfig() *ssh.ServerConfig {
226
227
}
227
228
228
229
func generatePrivateKey (passphrase string ) []byte {
229
- pk , err := rsa .GenerateKey (rand .Reader , 2048 )
230
+ _ , pk , err := ed25519 .GenerateKey (rand .Reader )
230
231
if err != nil {
231
232
log .Fatal (err )
232
233
}
233
234
234
235
log .Println ("Generated RSA Keypair" )
235
236
236
237
pemBlock := & pem.Block {
237
- Type : "RSA PRIVATE KEY" ,
238
- Bytes : x509 . MarshalPKCS1PrivateKey (pk ),
238
+ Type : "OPENSSH PRIVATE KEY" ,
239
+ Bytes : edkey . MarshalED25519PrivateKey (pk ),
239
240
}
240
241
241
242
var pemData []byte
You can’t perform that action at this time.
0 commit comments