-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.text
53 lines (32 loc) · 950 Bytes
/
notes.text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# SSH-EXT
# SSH-PATCH
# SSH-PATCH-PACKET
# SSH-PATCH-CRYPTO
if onNewKey != nil { // SSH-EXT: ADDON
privateKey, err := onNewKey()
if err != nil {
return nil, err
}
key, err := ParseRawPrivateKey(privateKey)
if err != nil {
return nil, err
}
rsaPrivateKey := key.(rsa.PrivateKey)
// crypto_PrivateKey, _ := parseOpenSSHPrivateKey(privateKey)
// fmt.Println(crypto_PrivateKey)
copy(kp.priv[:], rsaPrivateKey.Primes)
copy(kp.pub[:], []byte{}) // signer.PublicKey().Marshal()[:]
} else if err := kp.generate(rand); err != nil { // SSH-EXT: ORIGINAL
return nil, err
}
if onNewKey != nil { // SSH-EXT: ADDON
privateKey, err := onNewKey()
if err != nil {
return nil, err
}
signer, _ := ParsePrivateKey(privateKey)
copy(kp.priv[:], privateKey[:])
copy(kp.pub[:], signer.PublicKey().Marshal()[:])
} else if err := kp.generate(rand); err != nil { // SSH-EXT: ORIGINAL
return nil, err
}