aboutsummaryrefslogtreecommitdiff
path: root/tests/unittests/torture_pki_ecdsa.c
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-05-02 18:07:47 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-05-13 16:37:51 +0200
commit7bc53f3957cc5f50a92cb93019b2235b54b07dc8 (patch)
treee08bcc3ef16bc4259cabde44276bb3176a1b3d87 /tests/unittests/torture_pki_ecdsa.c
parentfd9446553b5e06c95c67945959b228e44c870b73 (diff)
downloadlibssh-7bc53f3957cc5f50a92cb93019b2235b54b07dc8.tar.gz
libssh-7bc53f3957cc5f50a92cb93019b2235b54b07dc8.tar.xz
libssh-7bc53f3957cc5f50a92cb93019b2235b54b07dc8.zip
pki_mbedcrypto: Added pki_sign_data() and pki_verify_data_signature()
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/unittests/torture_pki_ecdsa.c')
-rw-r--r--tests/unittests/torture_pki_ecdsa.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unittests/torture_pki_ecdsa.c b/tests/unittests/torture_pki_ecdsa.c
index c35cb27a..1e5380fd 100644
--- a/tests/unittests/torture_pki_ecdsa.c
+++ b/tests/unittests/torture_pki_ecdsa.c
@@ -610,8 +610,7 @@ static void torture_pki_ecdsa_cert_verify(void **state)
ssh_free(session);
}
-#ifdef HAVE_LIBCRYPTO
-
+#if defined(HAVE_LIBCRYPTO) || defined(HAVE_LIBMBEDCRYPTO)
static int test_sign_verify_data(ssh_key key,
enum ssh_digest_e hash_type,
const unsigned char *input,
@@ -671,7 +670,8 @@ static void torture_pki_sign_data_ecdsa(void **state)
/* Cleanup */
SSH_KEY_FREE(key);
}
-
+#endif
+#ifdef HAVE_LIBCRYPTO
static void torture_pki_ecdsa_write_privkey(void **state)
{
ssh_key origkey = NULL;
@@ -899,8 +899,10 @@ int torture_run_tests(void) {
cmocka_unit_test_setup_teardown(torture_pki_ecdsa_write_privkey,
setup_ecdsa_key_521,
teardown),
- cmocka_unit_test(torture_pki_sign_data_ecdsa),
#endif /* HAVE_LIBCRYPTO */
+#if defined(HAVE_LIBCRYPTO) || defined(HAVE_LIBMBEDCRYPTO)
+ cmocka_unit_test(torture_pki_sign_data_ecdsa),
+#endif
cmocka_unit_test_setup_teardown(torture_pki_ecdsa_name256,
setup_ecdsa_key_256,
teardown),