tests: Provide testing keys also in OpenSSH format

This extends the torture API to provide a way to request
keys in different formats. This extends the keys with
private keys in the new OpenSSH format (default since
OpenSSH 7.8).

This also needs modifications to the ed25519 tests, which
do not support PEM format and expected the new format out of the
box.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2018-09-06 16:52:32 +02:00
committed by Andreas Schneider
parent d23bda8181
commit e365aed6d2
4 changed files with 272 additions and 18 deletions

View File

@@ -28,6 +28,12 @@
#define TORTURE_TESTKEY_PASSWORD "libssh-rocks"
/* Return the encrypted private key in a new OpenSSH format */
const char *torture_get_openssh_testkey(enum ssh_keytypes_e type,
int ecdsa_bits,
bool with_passphrase);
/* Return the private key in the legacy PEM format */
const char *torture_get_testkey(enum ssh_keytypes_e type,
int ecdsa_bits,
bool with_passphrase);