Page MenuHomeFreeBSD

security/tor: Unbreaking on systems without timingsafe_memcmp(3)
ClosedPublic

Authored by yuri on Dec 15 2017, 7:04 PM.

Details

Summary

The user has reported that tor breaks when timingsafe_memcmp(3) is missing, because it has only been added in 12.0 and backported to 11.1

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

yuri created this revision.Dec 15 2017, 7:04 PM

This should probably also go to the quarterly ports tree?

security/tor/files/patch-orconfig.h.in
7 ↗(On Diff #36637)

how about using __FreeBSD_version and only undefine it for too old ones?

yuri updated this revision to Diff 36638.Dec 15 2017, 7:22 PM

Used __FreeBSD_version

yuri marked an inline comment as done.Dec 15 2017, 7:27 PM
In D13502#282311, @yuri wrote:

Used __FreeBSD_version

didn't you mention that it was backported to 11.1 too?

yuri added a comment.Dec 15 2017, 7:34 PM
In D13502#282311, @yuri wrote:

Used __FreeBSD_version

didn't you mention that it was backported to 11.1 too?

But manpage doesn't say this. It works on my 11.1, so I assumed that it has been backported, but this isn't documented.

yuri added a comment.Dec 15 2017, 7:46 PM
In D13502#282322, @yuri wrote:
In D13502#282311, @yuri wrote:

Used __FreeBSD_version

didn't you mention that it was backported to 11.1 too?

But manpage doesn't say this. It works on my 11.1, so I assumed that it has been backported, but this isn't documented.

This is also a very minor matter, so it isn't worth it to put more efforts into enabling it on 11 even if possible, IMHO. :)

adamw accepted this revision.Dec 18 2017, 9:40 PM
This revision is now accepted and ready to land.Dec 18 2017, 9:40 PM
This revision was automatically updated to reflect the committed changes.

Come on

with the patch multiple warnings generated, like:

./orconfig.h:521:5: warning: 'FreeBSD_version' is not defined, evaluates to 0 [-Wundef]
#if
FreeBSD_version >= 1200000 // disabled: timingsafe_memcmp(3) has been added only in 12.0, and isn't yet available on older systems

^

3 warnings generated.

$ make -V PKGNAME
tor-0.3.1.9_1
$ uname -r
11.1-RELEASE-p1