aboutsummaryrefslogtreecommitdiff
path: root/src/common/tortls.c
diff options
context:
space:
mode:
authorMarek Majkowski <marek@popcount.org>2013-06-10 16:21:39 +0100
committerMarek Majkowski <marek@popcount.org>2013-06-10 16:21:39 +0100
commitd769cd82b5b9517971bdefabfcc1c68b0a901751 (patch)
treef47cff5dff640df813f4d937a9bcf21282f2ee51 /src/common/tortls.c
parente4f51682bc6d15e5ba78dfe6dfe69e95c298954e (diff)
downloadtor-d769cd82b5b9517971bdefabfcc1c68b0a901751.tar
tor-d769cd82b5b9517971bdefabfcc1c68b0a901751.tar.gz
Bug #5170 - make pkey_eq testable, introduce test_tortls.c
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r--src/common/tortls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index fd0a4107d..c0e36034d 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -980,8 +980,8 @@ tor_tls_cert_get_key(tor_cert_t *cert)
}
/** Return true iff <b>a</b> and <b>b</b> represent the same public key. */
-static int
-pkey_eq(EVP_PKEY *a, EVP_PKEY *b)
+int
+tor_tls_evp_pkey_eq(EVP_PKEY *a, EVP_PKEY *b)
{
/* We'd like to do this, but openssl 0.9.7 doesn't have it:
return EVP_PKEY_cmp(a,b) == 1;
@@ -1017,7 +1017,7 @@ tor_tls_cert_matches_key(const tor_tls_t *tls, const tor_cert_t *cert)
link_key = X509_get_pubkey(peercert);
cert_key = X509_get_pubkey(cert->cert);
- result = link_key && cert_key && pkey_eq(cert_key, link_key);
+ result = link_key && cert_key && tor_tls_evp_pkey_eq(cert_key, link_key);
X509_free(peercert);
if (link_key)