aboutsummaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-18 05:28:27 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-18 05:28:27 +0000
commitcebdf93949c4dc203aca700705dc4032917db96c (patch)
treecf2c2e635728fe1d69cd9d8868542820f5f0de40 /src/or/test.c
parent7b5be147ee8ddbbddf866cb94600fde65f12f621 (diff)
downloadtor-cebdf93949c4dc203aca700705dc4032917db96c.tar.gz
tor-cebdf93949c4dc203aca700705dc4032917db96c.zip
Fix bug 889: share deep-copied keys between threads to avoid races in reference counts. Bugfix on 0.1.0.1-rc.
svn:r17672
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 050217c3a7..bac59b7834 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -740,6 +740,14 @@ test_crypto_pk(void)
test_memeq(data1,data3,j);
}
}
+
+ /* Try copy_full */
+ crypto_free_pk_env(pk2);
+ pk2 = crypto_pk_copy_full(pk1);
+ test_assert(pk2 != NULL);
+ test_neq_ptr(pk1, pk2);
+ test_assert(crypto_pk_cmp_keys(pk1,pk2) == 0);
+
done:
if (pk1)
crypto_free_pk_env(pk1);