-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from neicnordic/bugfix/unencrypted_private_key
Add support for unencrypted private crypt4gh keys
- Loading branch information
Showing
4 changed files
with
127 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,11 @@ ECAwQ= | |
-----END OPENSSH PRIVATE KEY----- | ||
` | ||
|
||
const unencryptedCrypt4GH = `-----BEGIN CRYPT4GH PRIVATE KEY----- | ||
YzRnaC12MQAEbm9uZQAEbm9uZQAgCvMeraG2L8NC9rDji46RXESWcXkoV5JeF0IiJdvzyhQ= | ||
-----END CRYPT4GH PRIVATE KEY----- | ||
` | ||
|
||
const sshEd25519Pub = `ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGShUtbgxD70Gj+alwupjPHpTeIHf/s7pWNfx10VvYHV [email protected] | ||
` | ||
|
||
|
@@ -100,6 +105,14 @@ func TestReadKey(t *testing.T) { | |
passPhrase []byte | ||
hash string | ||
}{ | ||
{ | ||
name: "unencrypted.sec.pem", | ||
content: unencryptedCrypt4GH, | ||
readPrivateKeyFunction: ReadPrivateKey, | ||
readPublicKeyFunction: nil, | ||
passPhrase: nil, | ||
hash: "0af31eada1b62fc342f6b0e38b8e915c449671792857925e17422225dbf3ca14", | ||
}, | ||
{ | ||
name: "crypt4gh-x25519-enc.sec.pem", | ||
content: crypt4ghX25519Sec, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters