Latest Oscam with emu.. | Page 2 | MultiCS.TR MuLTiCS & OSCam EXCHANGE FORUMS

Latest Oscam with emu..

oscam-git11953-802

net: remove obsolete gethostbyname resolver and use getaddrinfo exclusively
gethostbyname() is not thread-safe and has been marked obsolescent by
POSIX. Newer glibc versions could emit a linker warning for any binary
referencing this symbol, even if the code path is gated behind a
runtime config option.

The modern replacement getaddrinfo() was already fully implemented as
the default resolver (resolvegethostbyname=0). This removes the legacy
gethostbyname() fallback path along with:

- the resolvegethostbyname config option (oscam.conf [global])
- the Resolver dropdown from the webinterface
- the gethostbyname_lock mutex (no longer needed since getaddrinfo
is thread-safe)

cmake: switch library detection from auto-detect to opt-in
* cmake: declare STATIC_* and LIBCRYPTO_LIB/SSL_LIB as cache variables

When a user passes -DSTATIC_PCSC=0 while HAVE_PCSC is also 0 (or
vice-versa for libcrypto/libssl/libusb/libdvbcsa), cmake prints:

CMake Warning:
Manually-specified variables were not used by the project:
STATIC_PCSC

The warning is harmless but confusing: the STATIC_* flag is only
read inside if (HAVE_*) blocks, so when the feature is disabled
the -D value is indeed unreferenced.

Declare the flags via option() (and LIBCRYPTO_LIB/SSL_LIB via
set(... CACHE STRING ...)) at the top of the file so cmake
considers them known even when the feature guard is inactive.
Placed before system detection so they don't override the
macOS-specific set(STATIC_LIBUSB True).

* cmake: add LIBCRYPTO_LIB and SSL_LIB overrides for Makefile parity

The Makefile allows passing a full library path to override the
default detection:

make USE_LIBCRYPTO=1 LIBCRYPTO_LIB=/usr/lib/libcrypto.a
make USE_SSL=1 SSL_LIB=/usr/lib/libssl.a

Mirror this in cmake by honouring LIBCRYPTO_LIB and SSL_LIB when
set. The supplied path is used as-is for OPENSSL_CRYPTO_LIBRARIES
and OPENSSL_SSL_LIBRARIES, bypassing the static auto-detection.

Both static and dynamic archives work. Existing flags
(STATIC_LIBCRYPTO, STATIC_SSL, OPENSSL_*_LIBRARY) keep working.

* cmake: simplify libusb and libdvbcsa status summary

Apply the same pattern used for PCSC to libusb and libdvbcsa:
report the final resolved link mode instead of mixing request
flags with result flags.

LIBUSBDIR/LIBDVBCSADIR -> custom location selected
STATICLIBUSB/STATICLIBDVBCSA -> static linking was selected

Removes the redundant "You selected to enable static" messages
(the result message already covers that case) and the duplicate
LIBUSBDIR branches.

* cmake: simplify PCSC status summary

Restructure the PCSC summary block to describe the final resolved
link mode instead of mixing request flags with result flags:

PCSCDIR -> user selected a custom PCSC location
STATICPCSC -> static linking was actually selected

STATIC_PCSC (user request) and STATICPCSC (actual result) are not
always the same, e.g. when libpcsclite.a cannot be found despite
STATIC_PCSC=1. Using only STATICPCSC in the summary keeps the
status message aligned with the real build result.

* cmake: add static libcrypto and libssl support

Add STATIC_LIBCRYPTO and STATIC_SSL flags to independently control
static linking of libcrypto and libssl, matching the Makefile where
LIBCRYPTO_LIB and SSL_LIB can be set to .a paths separately.

When either flag is set, OPENSSL_USE_STATIC_LIBS is enabled for
find_package(OpenSSL), then find_library locates the static archives
relative to the OpenSSL include directory. The native CMake variables
OPENSSL_CRYPTO_LIBRARY and OPENSSL_SSL_LIBRARY can also be used to
pass explicit paths directly.

Usage:
cmake -DHAVE_LIBCRYPTO=1 -DSTATIC_LIBCRYPTO=1 ..
cmake -DHAVE_LIBCRYPTO=1 -DSTATIC_SSL=1 ..
cmake -DHAVE_LIBCRYPTO=1 -DSTATIC_LIBCRYPTO=1 -DSTATIC_SSL=1 ..
cmake -DHAVE_LIBCRYPTO=1 -DOPENSSL_CRYPTO_LIBRARY=/pfad/libcrypto.a ..

* cmake: add static PCSC and custom PCSCDIR support

Add PCSCDIR and STATIC_PCSC support for PCSC linking, bringing it
on par with libusb (LIBUSBDIR/STATIC_LIBUSB) and libdvbcsa
(LIBDVBCSADIR). Previously cmake could only link PCSC dynamically
with the bare -lpcsclite flag.

PCSCDIR uses find_library with IMPORTED targets for both static
and dynamic linking. Without PCSCDIR, -DSTATIC_PCSC=1 searches
the system for libpcsclite.a and falls back to dynamic if not found.

Usage:
cmake -DHAVE_PCSC=1 ..
cmake -DHAVE_PCSC=1 -DSTATIC_PCSC=1 ..
cmake -DHAVE_PCSC=1 -DPCSCDIR=/opt/pcsc ..
cmake -DHAVE_PCSC=1 -DPCSCDIR=/opt/pcsc -DSTATIC_PCSC=1 ..

* cmake: switch library detection from auto-detect to opt-in

Libraries like pcsclite, libusb and OpenSSL were auto-detected via
check_include_file, causing unwanted dynamic linking when the toolchain
sysroot contained these libraries. This changes cmake to match the
Makefile behavior where libraries must be explicitly requested.

Use -DHAVE_PCSC=1, -DHAVE_LIBUSB=1 or -DHAVE_LIBCRYPTO=1 to enable.
OpenSSL/libcrypto is auto-enabled when WITH_SSL is active in config.

Wrap the static library link step in --start-group/--end-group
(GNU ld) to resolve circular dependencies between csoscam, csmodules
and csreaders. Since 28f2598b (cleanup reader macros) the
READER_VIACCESS ifdef in oscam-aes.c caused oscam-aes.o to not be
pulled from libcsoscam.a when READER_VIACCESS was disabled, leaving
aes_encrypt_idx/aes_decrypt/aes_set_key_alloc unresolved for modules
like camd35 and camd33. Simple reordering is not possible since
csoscam and csmodules have mutual dependencies. macOS is excluded
as Apple ld rescans archives automatically.

build: isolate test build artifacts into a separate directory
 

Attachments

oscam-git11958-802

build: remove obsolete WITH_SSL config entry
WITH_SSL was added to config.sh in 2010 (commit 6c2b2c49) when there was no separation between make and cmake. Today the convention is:
- make uses USE_SSL=1
- cmake uses -DWITH_SSL=1

WITH_SSL in config.sh's addons list violated this and only acted as a config-file fallback that translated to USE_SSL in the Makefile. Both build systems work fine without it.

Removed:
- WITH_SSL from addons list and defconfig in config.sh
- WITH_SIGNING -> WITH_SSL auto-dependency (Makefile and CMakeLists
already handle this on their own)
- WITH_SSL menuconfig entry and help examples
- config.sh --enabled WITH_SSL fallback in Makefile
- CONFIG_WITH_SSL fallback logic in CMakeLists.txt

The GitLab CI pipeline previously passed the make-style flag -DUSE_SSL to cmake, which cmake silently ignored — the dropped config.sh fallback used to paper over this. Switch the cmake invocations to -DWITH_SSL=1
(the variable cmake actually reads) and drop the obsolete
DISABLE_OPT WITH_SSL entries since WITH_SSL is no longer a config.sh option.

cscrypt: fix DES symbol collision in mdc2 header when WITH_SSL is on
Including <openssl/des.h> from cscrypt/mdc2.h pulled OpenSSL's DES backward-compatibility macros (e.g. des_ecb_encrypt -> DES_ecb_encrypt with different argument counts) into every translation unit that uses
mdc2.h. tests.c includes both mdc2.h and cscrypt/des.h, which made the test build fail with 'macro requires N arguments, but only M given' errors on toolchains shipping OpenSSL 1.0.x.

The header only needed DES_cblock for two MDC2_CTX struct fields, both of which are simply 8-byte buffers. Replace them with unsigned char[8] and move the OpenSSL include (and the local DES typedef fallback) into
mdc2.c, where the DES API is actually used.

webif: include WITH_SSL in is_defined.txt when USE_SSL flag is set
The webif template generator filters template blocks based on webif/is_defined.txt, which config.sh's write_enabled() builds.
With WITH_SSL no longer in the addons list, it was never written to that file even when USE_SSL=1 is passed to make (or -DWITH_SSL=1 to cmake, which propagates as USE_SSL via --use-flags).

Effect: the SSL Settings block on the WebIf config page disappeared.

Mirror the existing USE_PCSC -> CARDREADER_PCSC handling and emit
WITH_SSL when USE_SSL is in USE_FLAGS.
 

Attachments

oscam-git11959-802

oscam-chk: remove unused loop counter nr in CS_CACHEEX_AIO sid-check functions GCC 16.1 warns about nr being set but never read (-Wunused-but-set-variable).
The counter was only incremented in the for-clause but its value was never consumed, so it is dropped entirely.
 

Attachments

oscam-git11960-802

webif: drop unused loop counter in pages_gen.c
GCC >= 9 -Wunused-but-set-variable flags the 'i' counter in the strtok_r dependency loop — only incremented, never read.
The two strtok_r() calls already drive the iteration via the ptr return, so the counter is dead weight.
 

Attachments

oscam-git11960-802

webif: drop unused loop counter in pages_gen.c
GCC >= 9 -Wunused-but-set-variable flags the 'i' counter in the strtok_r dependency loop — only incremented, never read.
The two strtok_r() calls already drive the iteration via the ptr return, so the counter is dead weight.
Thank you admin..
 
oscam-git11965-802
 

Attachments

Back
Top