summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-19 09:00:12 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-21 12:24:08 -0400
commit38212d2e40a1eae9f65c1a695e478854177c0783 (patch)
tree265cc80f8444ca03a087a4cd8a0771ac6d4460ee
parent0f971d7c915e45556c582b8e02017927bf196f7e (diff)
downloadtor-38212d2e40a1eae9f65c1a695e478854177c0783.tar.gz
tor-38212d2e40a1eae9f65c1a695e478854177c0783.zip
Remove a redundant function.
-rw-r--r--src/lib/crypt_ops/crypto_rsa_openssl.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/lib/crypt_ops/crypto_rsa_openssl.c b/src/lib/crypt_ops/crypto_rsa_openssl.c
index a342c1e7dd..cd9fb52667 100644
--- a/src/lib/crypt_ops/crypto_rsa_openssl.c
+++ b/src/lib/crypt_ops/crypto_rsa_openssl.c
@@ -41,11 +41,10 @@ struct crypto_pk_t
RSA *key; /**< The key itself */
};
-/** used internally: quicly validate a crypto_pk_t object as a private key.
- * Return 1 iff the public key is valid, 0 if obviously invalid.
- */
-static int
-crypto_pk_private_ok(const crypto_pk_t *k)
+/** Return true iff <b>key</b> contains the private-key portion of the RSA
+ * key. */
+int
+crypto_pk_key_is_private(const crypto_pk_t *k)
{
#ifdef OPENSSL_1_1_API
if (!k || !k->key)
@@ -371,7 +370,7 @@ crypto_pk_write_private_key_to_filename(crypto_pk_t *env,
char *s;
int r;
- tor_assert(crypto_pk_private_ok(env));
+ tor_assert(crypto_pk_key_is_private(env));
if (!(bio = BIO_new(BIO_s_mem())))
return -1;
@@ -407,15 +406,6 @@ crypto_pk_check_key(crypto_pk_t *env)
return r;
}
-/** Return true iff <b>key</b> contains the private-key portion of the RSA
- * key. */
-int
-crypto_pk_key_is_private(const crypto_pk_t *key)
-{
- tor_assert(key);
- return crypto_pk_private_ok(key);
-}
-
/** Return true iff <b>env</b> contains a public key whose public exponent
* equals 65537.
*/
@@ -545,7 +535,7 @@ crypto_pk_copy_full(crypto_pk_t *env)
tor_assert(env);
tor_assert(env->key);
- if (crypto_pk_private_ok(env)) {
+ if (crypto_pk_key_is_private(env)) {
new_key = RSAPrivateKey_dup(env->key);
privatekey = 1;
} else {