pki_gcrypt: 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:13:50 +02:00
committed by Andreas Schneider
parent 7bc53f3957
commit 88a8b1f57c
4 changed files with 210 additions and 12 deletions

View File

@@ -168,7 +168,6 @@ static void torture_pki_dsa_import_privkey_base64(void **state)
SSH_KEY_FREE(key);
}
#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 +227,7 @@ 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)
{
@@ -770,9 +769,7 @@ int torture_run_tests(void)
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),
cmocka_unit_test(torture_pki_dsa_import_openssh_privkey_base64_passphrase),

View File

@@ -610,7 +610,6 @@ static void torture_pki_ecdsa_cert_verify(void **state)
ssh_free(session);
}
#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,
@@ -670,7 +669,7 @@ 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)
{
@@ -900,9 +899,7 @@ int torture_run_tests(void) {
setup_ecdsa_key_521,
teardown),
#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),

View File

@@ -563,7 +563,6 @@ static void torture_pki_rsa_sha2(void **state)
ssh_free(session);
}
#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,
@@ -623,7 +622,7 @@ static void torture_pki_sign_data_rsa(void **state)
/* Cleanup */
SSH_KEY_FREE(key);
}
#endif
#ifdef HAVE_LIBCRYPTO
static void torture_pki_rsa_write_privkey(void **state)
{
@@ -843,9 +842,7 @@ int torture_run_tests(void) {
setup_rsa_key,
teardown),
#endif /* HAVE_LIBCRYPTO */
#if defined(HAVE_LIBCRYPTO) || defined(HAVE_LIBMBEDCRYPTO)
cmocka_unit_test(torture_pki_sign_data_rsa),
#endif
cmocka_unit_test_setup_teardown(torture_pki_rsa_sha2,
setup_rsa_key,
teardown),