Hello,
Nazarenko Mykyta <[email protected]> wrote:
> Index:
> patches/patch-Telegram_SourceFiles_storage_details_storage_file_utilities_cpp
> ===================================================================
> RCS file:
> patches/patch-Telegram_SourceFiles_storage_details_storage_file_utilities_cpp
>
> diff -N
> patches/patch-Telegram_SourceFiles_storage_details_storage_file_utilities_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++
> patches/patch-Telegram_SourceFiles_storage_details_storage_file_utilities_cpp
> 17 \
> Nov 2026 21:35:31 -0000 @@ -0,0 +1,44 @@
> +--- Telegram/SourceFiles/storage/details/storage_file_utilities.cpp.orig
> Sat Nov 14 \
> 16:21:20 2026 ++++
> Telegram/SourceFiles/storage/details/storage_file_utilities.cpp Sat \
> Nov 14 16:38:03 2026 +`<openssl/core_names.h>` and `<openssl/params.h>` are
> missing \
> in LibreSSL. +Also, we don't have built-in scrypt, make a stub for this
> code-path.
> +
> +@@ -14,10 +14,8 @@
> + #include "base/random.h"
> +
> + #include <crl/crl_object_on_thread.h>
> +-#include <openssl/core_names.h>
> + #include <openssl/kdf.h>
> + #include <openssl/opensslv.h>
> +-#include <openssl/params.h>
> + #include <QtCore/QtEndian>
> + #include <QtCore/QSaveFile>
> +
> +@@ -64,6 +62,8 @@
> + constexpr auto kPasscodeScryptP = quint32(1);
> + constexpr auto kPasscodeScryptMaxMem = quint64(192) * 1024 * 1024;
> + #if OPENSSL_VERSION_NUMBER >= 0x30200000L
> ++#include <openssl/core_names.h>
> ++#include <openssl/params.h>
> + constexpr auto kPasscodeArgon2Name = "ARGON2ID";
> + #endif // OPENSSL_VERSION_NUMBER >= 0x30200000L
> +
> +@@ -596,6 +596,10 @@
> + LOG(("App Error: Argon2id is not available."));
> + return nullptr;
> + #endif // OPENSSL_VERSION_NUMBER < 0x30200000L
> ++#ifdef OPENSSL_NO_SCRYPT
> ++ LOG(("App Error: Scrypt is not available"));
> ++ return nullptr;
> ++#else
> + } else if (kdf.kind == kPasscodeKdfScrypt) {
> + if (!EVP_PBE_scrypt(
> + passcode.constData(),
> +@@ -612,6 +616,7 @@
> + return nullptr;
> + }
> + } else {
> ++#endif
I believe that endif should be one line upper; because otherwise
brackets are not balanced and following lines might placed right after
return statement which effectively makes them unreachable.
> + LOG(("App Error: Unknown passcode KDF family."));
> + return nullptr;
> + }