mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Fix unit tests with --disable-curve25519
This commit is contained in:
parent
c7113e702b
commit
a0a855d586
@ -53,6 +53,7 @@ double fabs(double x);
|
|||||||
#include "mempool.h"
|
#include "mempool.h"
|
||||||
#include "memarea.h"
|
#include "memarea.h"
|
||||||
#include "onion.h"
|
#include "onion.h"
|
||||||
|
#include "onion_ntor.h"
|
||||||
#include "onion_tap.h"
|
#include "onion_tap.h"
|
||||||
#include "policies.h"
|
#include "policies.h"
|
||||||
#include "rephist.h"
|
#include "rephist.h"
|
||||||
|
@ -214,8 +214,10 @@ test_dir_formats(void)
|
|||||||
strlcat(buf2, "signing-key\n", sizeof(buf2));
|
strlcat(buf2, "signing-key\n", sizeof(buf2));
|
||||||
strlcat(buf2, pk1_str, sizeof(buf2));
|
strlcat(buf2, pk1_str, sizeof(buf2));
|
||||||
strlcat(buf2, "hidden-service-dir\n", sizeof(buf2));
|
strlcat(buf2, "hidden-service-dir\n", sizeof(buf2));
|
||||||
|
#ifdef CURVE25519_ENABLED
|
||||||
strlcat(buf2, "ntor-onion-key "
|
strlcat(buf2, "ntor-onion-key "
|
||||||
"skyinAnvardNostarsNomoonNowindormistsorsnow=\n", sizeof(buf2));
|
"skyinAnvardNostarsNomoonNowindormistsorsnow=\n", sizeof(buf2));
|
||||||
|
#endif
|
||||||
strlcat(buf2, "accept *:80\nreject 18.0.0.0/8:24\n", sizeof(buf2));
|
strlcat(buf2, "accept *:80\nreject 18.0.0.0/8:24\n", sizeof(buf2));
|
||||||
strlcat(buf2, "router-signature\n", sizeof(buf2));
|
strlcat(buf2, "router-signature\n", sizeof(buf2));
|
||||||
|
|
||||||
@ -235,9 +237,11 @@ test_dir_formats(void)
|
|||||||
test_eq(rp2->bandwidthrate, r2->bandwidthrate);
|
test_eq(rp2->bandwidthrate, r2->bandwidthrate);
|
||||||
test_eq(rp2->bandwidthburst, r2->bandwidthburst);
|
test_eq(rp2->bandwidthburst, r2->bandwidthburst);
|
||||||
test_eq(rp2->bandwidthcapacity, r2->bandwidthcapacity);
|
test_eq(rp2->bandwidthcapacity, r2->bandwidthcapacity);
|
||||||
|
#ifdef CURVE25519_ENABLED
|
||||||
test_memeq(rp2->onion_curve25519_pkey->public_key,
|
test_memeq(rp2->onion_curve25519_pkey->public_key,
|
||||||
r2->onion_curve25519_pkey->public_key,
|
r2->onion_curve25519_pkey->public_key,
|
||||||
CURVE25519_PUBKEY_LEN);
|
CURVE25519_PUBKEY_LEN);
|
||||||
|
#endif
|
||||||
test_assert(crypto_pk_cmp_keys(rp2->onion_pkey, pk2) == 0);
|
test_assert(crypto_pk_cmp_keys(rp2->onion_pkey, pk2) == 0);
|
||||||
test_assert(crypto_pk_cmp_keys(rp2->identity_pkey, pk1) == 0);
|
test_assert(crypto_pk_cmp_keys(rp2->identity_pkey, pk1) == 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user