aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-12-21 16:22:20 -0500
committerRob Austein <sra@hactrn.net>2015-12-21 16:22:20 -0500
commit36f9b6627d41f72af38be1d819f37c20a11f43c5 (patch)
tree15287c76d9da007c0488ab3a68ea831a4f11739b /tests
parent905db64f075752de96c80eb4e3bd431342bb9700 (diff)
Fix names of private key DER functions.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-ecdsa.c8
-rw-r--r--tests/test-rsa.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/test-ecdsa.c b/tests/test-ecdsa.c
index 98b3d70..d88aeb2 100644
--- a/tests/test-ecdsa.c
+++ b/tests/test-ecdsa.c
@@ -133,14 +133,14 @@ static int test_against_static_vectors(const ecdsa_tc_t * const tc)
uint8_t keyder[tc->key_len];
size_t keyder_len;
- if ((err = hal_ecdsa_key_to_der(key1, keyder, &keyder_len, sizeof(keyder))) != HAL_OK)
- return printf("hal_ecdsa_key_to_der() failed: %s\n", hal_error_string(err)), 0;
+ if ((err = hal_ecdsa_private_key_to_der(key1, keyder, &keyder_len, sizeof(keyder))) != HAL_OK)
+ return printf("hal_ecdsa_private_key_to_der() failed: %s\n", hal_error_string(err)), 0;
uint8_t keybuf2[hal_ecdsa_key_t_size];
hal_ecdsa_key_t *key2 = NULL;
- if ((err = hal_ecdsa_key_from_der(&key2, keybuf2, sizeof(keybuf2), keyder, keyder_len)) != HAL_OK)
- return printf("hal_ecdsa_key_from_der() failed: %s\n", hal_error_string(err)), 0;
+ if ((err = hal_ecdsa_private_key_from_der(&key2, keybuf2, sizeof(keybuf2), keyder, keyder_len)) != HAL_OK)
+ return printf("hal_ecdsa_private_key_from_der() failed: %s\n", hal_error_string(err)), 0;
if (memcmp(key1, key2, hal_ecdsa_key_t_size) != 0)
return printf("Private key mismatch after read/write cycle\n"), 0;
diff --git a/tests/test-rsa.c b/tests/test-rsa.c
index e7e831e..2872250 100644
--- a/tests/test-rsa.c
+++ b/tests/test-rsa.c
@@ -148,19 +148,19 @@ static int test_gen(const hal_core_t *core,
size_t der_len = 0;
- if ((err = hal_rsa_key_to_der(key1, NULL, &der_len, 0)) != HAL_OK) {
+ if ((err = hal_rsa_private_key_to_der(key1, NULL, &der_len, 0)) != HAL_OK) {
printf("Getting DER length of RSA key failed: %s\n", hal_error_string(err));
return 0;
}
uint8_t der[der_len];
- if ((err = hal_rsa_key_to_der(key1, der, &der_len, sizeof(der))) != HAL_OK) {
+ if ((err = hal_rsa_private_key_to_der(key1, der, &der_len, sizeof(der))) != HAL_OK) {
printf("Converting RSA key to DER failed: %s\n", hal_error_string(err));
return 0;
}
- if ((err = hal_rsa_key_from_der(&key2, keybuf2, sizeof(keybuf2), der, sizeof(der))) != HAL_OK) {
+ if ((err = hal_rsa_private_key_from_der(&key2, keybuf2, sizeof(keybuf2), der, sizeof(der))) != HAL_OK) {
printf("Converting RSA key back from DER failed: %s\n", hal_error_string(err));
return 0;
}