aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/testcode/streamtcp.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--external/unbound/testcode/streamtcp.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/external/unbound/testcode/streamtcp.c b/external/unbound/testcode/streamtcp.c
index c5919428a..34b5c0281 100644
--- a/external/unbound/testcode/streamtcp.c
+++ b/external/unbound/testcode/streamtcp.c
@@ -128,6 +128,9 @@ write_q(int fd, int udp, SSL* ssl, sldns_buffer* buf, uint16_t id,
qinfo.qtype = sldns_get_rr_type_by_name(strtype);
qinfo.qclass = sldns_get_rr_class_by_name(strclass);
+ /* clear local alias */
+ qinfo.local_alias = NULL;
+
/* make query */
qinfo_query_encode(buf, &qinfo);
sldns_buffer_write_u16_at(buf, 0, id);
@@ -265,7 +268,7 @@ static int get_random(void)
if (RAND_bytes((unsigned char*)&r, (int)sizeof(r)) == 1) {
return r;
}
- return (int)random();
+ return arc4random();
}
/** send the TCP queries and print answers */
@@ -406,8 +409,18 @@ int main(int argc, char** argv)
}
if(usessl) {
ERR_load_SSL_strings();
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO)
OpenSSL_add_all_algorithms();
- SSL_library_init();
+#else
+ OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
+ | OPENSSL_INIT_ADD_ALL_DIGESTS
+ | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL)
+ (void)SSL_library_init();
+#else
+ (void)OPENSSL_init_ssl(0, NULL);
+#endif
}
send_em(svr, udp, usessl, noanswer, argc, argv);
checklock_stop();