aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2014-08-15 12:27:47 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-08-15 12:32:57 +0200
commit25eb9c4914feabb9afd2756dc581c49114f7f709 (patch)
tree0cb9cca24380bc513f6338230245143cc55448f3 /tests
parentc6210f5aef6ded994f33744116a05d2859aaa407 (diff)
downloadlibssh-25eb9c4914feabb9afd2756dc581c49114f7f709.tar.gz
libssh-25eb9c4914feabb9afd2756dc581c49114f7f709.tar.xz
libssh-25eb9c4914feabb9afd2756dc581c49114f7f709.zip
tests: Use public testkey passphrase function in pki test.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/torture_pki.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/unittests/torture_pki.c b/tests/unittests/torture_pki.c
index 6fb1c781..48d82af7 100644
--- a/tests/unittests/torture_pki.c
+++ b/tests/unittests/torture_pki.c
@@ -8,7 +8,6 @@
#define LIBSSH_RSA_TESTKEY "libssh_testkey.id_rsa"
#define LIBSSH_DSA_TESTKEY "libssh_testkey.id_dsa"
#define LIBSSH_ECDSA_TESTKEY "libssh_testkey.id_ecdsa"
-#define LIBSSH_PASSPHRASE "libssh-rocks"
const unsigned char HASH[] = "12345678901234567890";
@@ -185,7 +184,7 @@ static void torture_pki_import_privkey_base64_RSA(void **state) {
int rc;
char *key_str;
ssh_key key;
- const char *passphrase = LIBSSH_PASSPHRASE;
+ const char *passphrase = torture_get_testkey_passphrase();
enum ssh_keytypes_e type;
(void) state; /* unused */
@@ -208,7 +207,7 @@ static void torture_pki_import_privkey_base64_RSA(void **state) {
static void torture_pki_import_privkey_base64_NULL_key(void **state) {
int rc;
- const char *passphrase = LIBSSH_PASSPHRASE;
+ const char *passphrase = torture_get_testkey_passphrase();
(void) state; /* unused */
@@ -225,7 +224,7 @@ static void torture_pki_import_privkey_base64_NULL_key(void **state) {
static void torture_pki_import_privkey_base64_NULL_str(void **state) {
int rc;
ssh_key key = NULL;
- const char *passphrase = LIBSSH_PASSPHRASE;
+ const char *passphrase = torture_get_testkey_passphrase();
(void) state; /* unused */
@@ -239,7 +238,7 @@ static void torture_pki_import_privkey_base64_NULL_str(void **state) {
static void torture_pki_import_privkey_base64_DSA(void **state) {
int rc;
ssh_key key;
- const char *passphrase = LIBSSH_PASSPHRASE;
+ const char *passphrase = torture_get_testkey_passphrase();
(void) state; /* unused */
@@ -258,7 +257,7 @@ static void torture_pki_import_privkey_base64_ECDSA(void **state) {
int rc;
char *key_str;
ssh_key key;
- const char *passphrase = LIBSSH_PASSPHRASE;
+ const char *passphrase = torture_get_testkey_passphrase();
(void) state; /* unused */
@@ -276,7 +275,7 @@ static void torture_pki_import_privkey_base64_ECDSA(void **state) {
static void torture_pki_import_privkey_base64_passphrase(void **state) {
int rc;
ssh_key key = NULL;
- const char *passphrase = LIBSSH_PASSPHRASE;
+ const char *passphrase = torture_get_testkey_passphrase();
(void) state; /* unused */