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>
This commit is contained in:
Anderson Toshiyuki Sasaki
2019-05-02 18:07:47 +02:00
committed by Andreas Schneider
parent fd9446553b
commit 7bc53f3957
4 changed files with 172 additions and 10 deletions

View File

@@ -168,7 +168,7 @@ static void torture_pki_dsa_import_privkey_base64(void **state)
SSH_KEY_FREE(key);
}
#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,
@@ -228,7 +228,8 @@ static void torture_pki_sign_data_dsa(void **state)
/* Cleanup */
SSH_KEY_FREE(key);
}
#endif
#ifdef HAVE_LIBCRYPTO
static void torture_pki_dsa_write_privkey(void **state)
{
ssh_key origkey = NULL;
@@ -768,6 +769,8 @@ int torture_run_tests(void)
cmocka_unit_test_setup_teardown(torture_pki_dsa_write_privkey,
setup_dsa_key,
teardown),
#endif
#if defined(HAVE_LIBCRYPTO) || defined(HAVE_LIBMBEDCRYPTO)
cmocka_unit_test(torture_pki_sign_data_dsa),
#endif
cmocka_unit_test(torture_pki_dsa_import_privkey_base64_passphrase),