Opened 4 years ago

Closed 4 years ago

#17549 closed defect (fixed)

tortls.c compile error w/Tor v0.2.8.0-alpha-dev and OpenSSL 1.1.0-dev (git-19e10f95c105a698) against SSL_Dev

Reported by: yancm Owned by:
Priority: Medium Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Normal Keywords: tor-core, openssl, 027-backport
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi again...
with Tor v0.2.8.0-alpha-dev (builds after git-19e10f95c105a698) running on NetBSD (6/i386) with Libevent 2.1.5-beta, OpenSSL 1.1.0-dev and Zlib 1.2.3

For 5 or 6 days I receive the following compile errors:
gmake[1]: Entering directory '/usr/local/src/tor'

CC src/common/tortls.o

src/common/tortls.c: In function 'tor_tls_server_info_callback':
src/common/tortls.c:1536:3: warning: implicit declaration of function 'SSL_state'
src/common/tortls.c:1537:21: error: 'SSL3_ST_SW_SRVR_HELLO_A' undeclared (first use in this function)
src/common/tortls.c:1537:21: note: each undeclared identifier is reported only once for each function it appears in
src/common/tortls.c:1538:21: error: 'SSL3_ST_SW_SRVR_HELLO_B' undeclared (first use in this function)
Makefile:3240: recipe for target 'src/common/tortls.o' failed
gmake[1]: * [src/common/tortls.o] Error 1
gmake[1]: Leaving directory '/usr/local/src/tor'
Makefile:1864: recipe for target 'all' failed
gmake:
* [all] Error 2

regards,
gene

Child Tickets

Change History (8)

comment:1 Changed 4 years ago by nickm

Summary: tortls.c compile error w/Tor v0.2.8.0-alpha-dev (git-19e10f95c105a698) against SSL_Devtortls.c compile error w/Tor v0.2.8.0-alpha-dev and OpenSSL 1.1.0-dev (git-19e10f95c105a698) against SSL_Dev

comment:2 Changed 4 years ago by yawning

Keywords: tor-core openssl 027-backport added
Status: newneeds_review

https://github.com/openssl/openssl/commit/5998e2903589e7b19e102ebff06521f2dcb60409
https://github.com/openssl/openssl/commit/b0700d2c8de79252ba605748a075cf2e5d670da1

I'm getting tempted to start saying that chasing OpenSSL 1.1.0-dev is at people's own risk, and they should be prepared to patch trivial issues like this. That said, here's a branch that fixes everything.

https://github.com/Yawning/tor/compare/bug17549

Version 0, edited 4 years ago by yawning (next)

comment:3 Changed 4 years ago by yawning

Note: Even with my patch applied, make test will fail because all the state descriptions are different.

test_tortls_get_state_description(void *ignored) and test_tortls_log_one_error(void *ignored) need to be updated to handle the new descriptions.

comment:4 Changed 4 years ago by yawning

Ok, I fixed the unit tests as well, because it was easy. My branch should be merge ready.

comment:5 Changed 4 years ago by nickm

Status: needs_reviewneeds_revision

Looks good, but I bet this will break with libressl. That's not _too_ horrible to do in an alpha, but we should avoid it if we can.

Also, hmm. I generally think it's better to make #ifdefs not be small pieces of functions, but rather independent functions. So what if instead we do something like

#if (it's an old version)
#define OpenSSL_version_num() SSLeay()
#define OpenSSL_version(v) SSLeay_version(v)
#define OPENSSL_VERSION SSLEAY_VERSION
...
#endif

and then our functions can stay nice and pretty?

I'm getting tempted to start saying that chasing OpenSSL 1.1.0-dev is at people's own risk, and they should be prepared to patch trivial issues like this.

Well, I'll be a bit more moderate, but basically agree: It's cool if somebody wants to run openssl-1.1.0-dev, but they should expect it to break Tor pretty frequently, and they should expect that we'll fix this kind of issue as we get around to it and no sooner. Otherwise we couldn't try to keep up with this as all.

comment:6 Changed 4 years ago by nickm

I made some changes on a branch 'bug17549'. Works for me! Shall I merge?

comment:7 in reply to:  6 Changed 4 years ago by yawning

Replying to nickm:

I made some changes on a branch 'bug17549'. Works for me! Shall I merge?

It builds with the openssl-dev snapshot I last tested it with. Nitpick: compat_openssl.h doesn't pass check-spaces.

comment:8 Changed 4 years ago by nickm

Resolution: fixed
Status: needs_revisionclosed

fixed and merged!

Note: See TracTickets for help on using tickets.