checking in some more research and primitive functions. i cannot, for the life of me, figure out why i can't (seemingly) properly decrypt private keys.

This commit is contained in:
2020-09-17 08:37:05 -04:00
parent 5f5d77a2a6
commit 6b956a3a49
10 changed files with 190 additions and 65 deletions

View File

@@ -4,9 +4,8 @@ package sshkeys
type EncryptedSSHKeyV1 struct {
SSHKeyV1
CipherName string
KDFName string
KDFOpts SSHKDFOpts
Passphrase string
Passphrase []byte
}
// SSHKDFOpts contains a set of KDF options.
@@ -20,19 +19,26 @@ type SSHKDFOpts struct {
// Patch your shit.
type SSHKeyV1 struct {
Magic string
BitSize uint32
DefKeyType string
KDFName string
KeySize uint32
BlockSize uint32
PublicKeys []SSHPubKey
PrivateKeys []SSHPrivKey
}
// SSHPubKey contains the Public key of an SSH Keypair.
type SSHPubKey struct {
KeyType string
PrivateKey *SSHPrivKey
KeyType string
Key []byte
}
// SSHPrivKey contains the Private key of an SSH Keypair.
type SSHPrivKey struct {
PublicKey *SSHPubKey
Checksum uint32
Key []byte
Checksum []byte
Comment string
}