Bug 253846 - net/bsdec2-image-upload: patch to make it build with libressl >= 2.9
Summary: net/bsdec2-image-upload: patch to make it build with libressl >= 2.9
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Colin Percival
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-25 13:05 UTC by Tassilo Philipp
Modified: 2021-02-26 18:50 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cperciva)


Attachments
patch for build with libressl >= 2.9 (1.04 KB, patch)
2021-02-25 13:05 UTC, Tassilo Philipp
no flags Details | Diff
update to net/bsdec2-image-upload port (2.11 KB, patch)
2021-02-26 04:34 UTC, Colin Percival
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tassilo Philipp 2021-02-25 13:05:04 UTC
Created attachment 222823 [details]
patch for build with libressl >= 2.9

Hello,

thanks for writing bsdec2-image-upload! Attached is a patch that should make the build work with libressl >= 2.9, which introduced SSL_set1_host(), so it's not necessary for bsdec2-image-upload to provide its own implementation, in this case.
I'm afraid my patch is a bit "pragmatic"; I tried to follow the style of matching it to a specific openssl API version as was done in sslreq.c, but 2.9 introduced the mentioned function above, but not SSL_set_hostflags(), both being within the same #if block, so I pragmatically added a libressl specific check :-/

Also, INT_MAX wasn't declared, so I added the needed #include. I'm not sure from which libressl version on this is necessary, though.

Since Colin seems to be maintainer and author, I guess this patch could be merged upstream instead of adding it to the ports' patches..? Sorry, I wasn't sure what to do, there might also be a less hacky way of addressing this, I guess.
Comment 1 Colin Percival freebsd_committer freebsd_triage 2021-02-25 19:54:52 UTC
Thanks for pointing this out!  Can you tell me something about the system you're running where this is needed?  I'd like to be able to test the changes I make (which as you note will be in the upstream git repository) before updating the ports tree.

(Also, not entirely relevant here, but I'd love to hear more about how you're using this / what you're doing in EC2 if you're able to share any details.  I often find that I'm working more or less blindly, on the basis of "well, this seems like it might be useful to someone, some day" and hearing from actual users can be incredibly helpful!)
Comment 2 Tassilo Philipp 2021-02-25 23:12:20 UTC
Oops, I forgot to share some details on the machine I'm running this on. It's a 12.1/amd64, poudriere build, ports tree from yesterday, with "DEFAULT_VERSIONS+=ssl=libressl" in make.conf. (w/ clang 8.0.1)

When I then created the patch I ran it without poudriere, on a 12.1/amd64 also, same for make.conf. I did look at different libressl versions to poinpoint what I described to v2.9.

(About the off-topic question: no problem! In essence, I migrate a CentOS setup at the dayjob, that builds AMIs locally for servers for a game, uploads them, etc.. And CentOS is officially dead, so there you go. Time has to be spent to migrate anyways, and I'm more of a BSD guy and thus more familiar with it, I migrate it slowly to FreeBSD. Thanks to poudriere-image(8), and tools like yours, I'll replace automatically half of the previous system, etc.. overall less future maintenance. And yeah, the feeling of working more or less blindly, believe me I know what you mean. But hey, tools like this one are useful for others for sure, I certainly appreciate it!)
Comment 3 Colin Percival freebsd_committer freebsd_triage 2021-02-26 04:34:57 UTC
Created attachment 222835 [details]
update to net/bsdec2-image-upload port

I've made changes to the bsdec2-image-upload upstream, and I've patched the port to use this new version.
Comment 4 Colin Percival freebsd_committer freebsd_triage 2021-02-26 04:35:42 UTC
Tassilo: Can you verify that the patch (applied to the /usr/ports/net/bsdec2-image-upload directory) works?
Comment 5 Tassilo Philipp 2021-02-26 11:16:05 UTC
Patch seems to apply fine and it builds now with version 1.4 and libressl 3.1.4. Thanks for the quick feedback!
Comment 6 Colin Percival freebsd_committer freebsd_triage 2021-02-26 18:50:53 UTC
Thanks, committed as ports r566627.