Opened 4 years ago

Last modified 2 years ago

#17253 new defect

Revise tests in test_tortls.c to not act intrusively on openssl internals

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: testing, SponsorS, tor-tests-coverage, tor-tests-unit
Cc: cb@… Actual Points:
Parent ID: Points: 4.5
Reviewer: Sponsor: SponsorS-can

Description

With openssl 1.1, most openssl structures will become opaque. But the new unit tests in test_tortls.c assume that they have full access to openssl internals.

I've wrapped the tests that make this assumption inside #ifndef OPENSSL_OPAQUE, so that Tor will build with openssl 1.1 again. But it would be great to see if we can port some of these tests to work with openssl 1.1, or at least disable the problematic parts on a more fine-grained basis.

Child Tickets

Attachments (1)

tortlstest.patch (451 bytes) - added by rubiate 4 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 4 years ago by rubiate

Severity: Normal

I could not get it to build with LibreSSL as test_tortls_client_is_using_v2_ciphers() calls get_cipher_by_name() which has its definition ifndef'd out. I am guessing this is because LibreSSL does not have SSL_get_client_ciphers() so it follows the #else block whereas OpenSSL doesn't.

The attached patch makes it build successfully by also indef'ing out test_tortls_client_is_using_v2_ciphers()

comment:2 Changed 4 years ago by rubiate

Cc: cb@… added

Changed 4 years ago by rubiate

Attachment: tortlstest.patch added

comment:3 Changed 4 years ago by rubiate

And now a better patch which builds the tests if LibreSSL is used. Works on the latest LibreSSL (in OpenBSD-current).

comment:4 Changed 4 years ago by nickm

Status: newneeds_review

comment:5 Changed 4 years ago by nickm

Status: needs_reviewnew

Merged that. Thanks!

comment:6 Changed 3 years ago by nickm

Milestone: Tor: 0.2.8.x-finalTor: 0.2.9.x-final

It is impossible that we will fix all 226 currently open 028 tickets before 028 releases. Time to move some out. This is my second pass through the "new" and tickets, looking for things to move to 0.2.9.

comment:7 Changed 3 years ago by isabela

Sponsor: SponsorS-can

comment:8 Changed 3 years ago by nickm

Points: medium/large

comment:9 Changed 3 years ago by nickm

Keywords: tor-tests-coverage tor-tests-unit added

comment:10 Changed 3 years ago by isabela

Points: medium/large4.5

comment:11 Changed 3 years ago by isabela

Keywords: isaremoved added
Milestone: Tor: 0.2.9.x-finalTor: 0.2.???

comment:12 Changed 3 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:13 Changed 3 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:14 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:15 Changed 2 years ago by nickm

Keywords: isaremoved removed
Note: See TracTickets for help on using tickets.