Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssl: update to 3.4.0 #2009

Closed

Conversation

benoit-pierre
Copy link
Contributor

@benoit-pierre benoit-pierre commented Dec 15, 2024

@benoit-pierre
Copy link
Contributor Author

Size as really ballooned, example for the kindlepw2 release build:

1.1.1 3.4.0
crypto 1.6 MB 2.5 MB
ssl 326 KB 575 KB

@NiLuJe
Copy link
Member

NiLuJe commented Dec 15, 2024

Assuming luasec is happy with it, I'm all for it, thanks ;).

(IIRC, OpenSSL 1.1 is very very EoL ;p)

@Frenzie
Copy link
Member

Frenzie commented Dec 16, 2024

Should be: lunarmodules/luasec@c297c52

@Frenzie
Copy link
Member

Frenzie commented Dec 16, 2024

Size has really ballooned, example for the kindlepw2 release build:

There are some obvious ones like no-ui-console no-whirlpool if we don't already use those.

@benoit-pierre
Copy link
Contributor Author

Updated results, again with a kindlepw2 release build:

1.1.1 3.4.0
crypto 1.6 MB 2.4 MB ( +884.5 KB)
ssl 326 KB 420.2 KB ( +98.2 KB)
TOTAL 1.9 MB 2.8 MB ( +982.7 KB)

@Frenzie
Copy link
Member

Frenzie commented Dec 16, 2024

That differs less than I'd hoped, but hey, it's something.

@benoit-pierre
Copy link
Contributor Author

Yesterday, I tried to see if wolfSSL was an alternative, but could not get luasec to work. LibreSSL, however, looks to be viable. I tested the Android ARM build: calibre plugin, NEWS downloader.

Code size comparison for the kindlepw2 release build:

OpenSSL 1.1.1 OpenSSL 3.4.0 LibreSSL 4.0.0
crypto 1.6 MB 2.4 MB ( +884.5 KB) 1.0 MB ( -538.2 KB)
ssl 326 KB 420.2 KB ( +98.2 KB) 213.5 KB ( -108.5 KB)
TOTAL 1.9 MB 2.8 MB ( +982.7 KB) 1.2 MB ( -646.7 KB)

Comment on lines 36 to 70
no-comp
no-default-thread-pool
no-hw
no-legacy
no-quic
no-thread-pool
no-ui-console
no-uplink
no-whirlpool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had commented on the commit, so replicating it here so I can actually find it again in the future.


I see, no-legacy is about the provider only but not about the algorithms. From the name I incorrectly assumed it covered all of these:

  • Moved all variations of the EVP ciphers CAST5, BF, IDEA, SEED, RC2,
    RC4, RC5, and DES to the legacy provider.
  • Moved the EVP digests MD2, MD4, MDC2, WHIRLPOOL and RIPEMD-160 to the legacy
    provider.

But presumably that does provide a (incomplete?) list of various others to disable.

@Frenzie
Copy link
Member

Frenzie commented Dec 16, 2024

LibreSSL, however, looks to be viable.

I seem to recall reading it was a fair bit slower, which would be more relevant on ereaders. But I'm fine with anything that works.

@benoit-pierre
Copy link
Contributor Author

No issue with the LibreSSL build on my Kindle either. I also did an OTA update to check zsync2 was still working.

@benoit-pierre benoit-pierre force-pushed the pr/openssl_update branch 2 times, most recently from 5d32e22 to bd68a14 Compare December 20, 2024 09:18
@benoit-pierre
Copy link
Contributor Author

OpenSSL 1.1.1 OpenSSL 3.4.0 LibreSSL 4.0.0
crypto 1.6 MB 1.9 MB ( +395.0 KB) 1.0 MB ( -538.2 KB)
ssl 326 KB 380.7 KB ( +58.7 KB) 213.5 KB ( -108.5 KB)
TOTAL 1.9 MB 2.3 MB ( +453.7 KB) 1.2 MB ( -646.7 KB)

@Frenzie
Copy link
Member

Frenzie commented Dec 20, 2024

@poire-z @pazos @NiLuJe Any preference? I don't mind either way. There's a mild worry of subtle incompatibility/misbehavior with LibreSSL, but then again this isn't some kind of networking app.

@benoit-pierre
Copy link
Contributor Author

There are only 3 remaining users:

  • cURL: officially supports LibreSSL
  • luasec: there are a number of LibreSSL related #ifdef checks in the code, so we can assume it's supported and tested
  • turbo: no reference to LibreSSL, but API should be OpenSSL compatible, so…

I do like that the LibreSSL (default) build is 1MB lighter than OpenSSL 3.4.0, and uses CMake.

The hardware related feature detection code is different than both OpenSSL version, so maybe we should check that the ARM issue is not present. @TheBolshe: are you available to test a LibreSSL build?

@TheBolshe
Copy link

Sure ^^
Do I do a full reset of the ebook before trying?

@benoit-pierre
Copy link
Contributor Author

Sure ^^ Do I do a full reset of the ebook before trying?

No need, here's the build.

@TheBolshe
Copy link

Sure ^^ Do I do a full reset of the ebook before trying?

No need, here's the build.

Seems to be working fine, no crashes on download.

@benoit-pierre
Copy link
Contributor Author

Sure ^^ Do I do a full reset of the ebook before trying?

No need, here's the build.

Seems to be working fine, no crashes on download.

Great, thanks for testing!

@benoit-pierre benoit-pierre marked this pull request as ready for review December 25, 2024 09:45
@poire-z
Copy link
Contributor

poire-z commented Dec 26, 2024

@poire-z Any preference? I don't mind either way.

No real opinion.

@NiLuJe
Copy link
Member

NiLuJe commented Dec 28, 2024

No preferences either, FWIW; the perf differences are likely irrelevant for our usecases and/or targets ;).

(i.e., smaller sounds good, so, fine w/ libressl).

@Frenzie
Copy link
Member

Frenzie commented Dec 28, 2024

Alright, I'll merge the other one when I get to a PC. (Or anybody else feel free to do so. ;-)

@Frenzie Frenzie closed this Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants