diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-19 08:56:51 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-21 12:24:08 -0400 |
commit | 0f971d7c915e45556c582b8e02017927bf196f7e (patch) | |
tree | 65dafe1f54701d5092d4e68edeb73b177465ee69 /src/test/test_crypto.c | |
parent | 752ffa21973c67a789c34511e13d079d8bec3858 (diff) | |
download | tor-0f971d7c915e45556c582b8e02017927bf196f7e.tar.gz tor-0f971d7c915e45556c582b8e02017927bf196f7e.zip |
Rename functions that encode/decode private keys
It is not nice to expose a private key's contents without having the
function name advertise the fact. Fortunately, we weren't misusing
these yet.
Diffstat (limited to 'src/test/test_crypto.c')
-rw-r--r-- | src/test/test_crypto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index 029e98a630..81d43ff13f 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -1420,22 +1420,22 @@ test_crypto_pk_base64(void *arg) /* Test Base64 encoding a key. */ pk1 = pk_generate(0); tt_assert(pk1); - tt_int_op(0, OP_EQ, crypto_pk_base64_encode(pk1, &encoded)); + tt_int_op(0, OP_EQ, crypto_pk_base64_encode_private(pk1, &encoded)); tt_assert(encoded); /* Test decoding a valid key. */ - pk2 = crypto_pk_base64_decode(encoded, strlen(encoded)); + pk2 = crypto_pk_base64_decode_private(encoded, strlen(encoded)); tt_assert(pk2); tt_int_op(crypto_pk_cmp_keys(pk1, pk2), OP_EQ, 0); crypto_pk_free(pk2); /* Test decoding a invalid key (not Base64). */ static const char *invalid_b64 = "The key is in another castle!"; - pk2 = crypto_pk_base64_decode(invalid_b64, strlen(invalid_b64)); + pk2 = crypto_pk_base64_decode_private(invalid_b64, strlen(invalid_b64)); tt_ptr_op(pk2, OP_EQ, NULL); /* Test decoding a truncated Base64 blob. */ - pk2 = crypto_pk_base64_decode(encoded, strlen(encoded)/2); + pk2 = crypto_pk_base64_decode_private(encoded, strlen(encoded)/2); tt_ptr_op(pk2, OP_EQ, NULL); done: |