From 004bd67f9b4aa84a1cd148acb501c5838e6619bb Mon Sep 17 00:00:00 2001 From: SirHumza <204067870+SirHumza@users.noreply.github.com> Date: Wed, 23 Sep 2026 21:56:49 +0200 Subject: [PATCH] Verify all targets: tests+asan green, payload+plugin link, compat dup fix, build lists complete --- orbisrpc/discord.c | 17 ++++++++++++++++- orbisrpc/ws.c | 1 + plugin/Makefile | 6 ++++-- scripts/build.sh | 2 +- scripts/build_sdk.sh | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/orbisrpc/discord.c b/orbisrpc/discord.c index 1a07f74..ab257d4 100644 --- a/orbisrpc/discord.c +++ b/orbisrpc/discord.c @@ -26,8 +26,23 @@ static void make_key(char *out){ unsigned char b[16]; + memset(b, 0, sizeof b); int fd=open("/dev/urandom",O_RDONLY); - if(fd>=0){ read(fd,b,16); close(fd); } + if(fd>=0){ + size_t got = 0; + while(got < sizeof b){ + long r = read(fd, (char *)b + got, sizeof b - got); + if(r <= 0) break; + got += (size_t)r; + } + close(fd); + if(got < sizeof b){ + /* short read: mix time in rather than leaving stack bytes */ + uint32_t t = (uint32_t)time(NULL); + for(size_t i = got; i < sizeof b; i++, t = t*1664525u + 1013904223u) + b[i] ^= (unsigned char)(t >> 24); + } + } else { for(int i=0;i<16;i++) b[i]=(unsigned char)(time(NULL)+i*7); } b64_encode(b,16,out); } diff --git a/orbisrpc/ws.c b/orbisrpc/ws.c index 3cfa29e..844d632 100644 --- a/orbisrpc/ws.c +++ b/orbisrpc/ws.c @@ -19,6 +19,7 @@ #include #include #else +#include #include #include #include diff --git a/plugin/Makefile b/plugin/Makefile index a9ea7ed..dcd6b6b 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -21,10 +21,12 @@ INTDIR := $(BUILD_DIR) # Our daemon sources (payload main.c is NOT part of the plugin; plugin.c is the entry) DAEMON_SRC := $(ORBISRPC)/log.c $(ORBISRPC)/cfg.c $(ORBISRPC)/jsonlite.c $(ORBISRPC)/b64.c \ $(ORBISRPC)/sfo.c $(ORBISRPC)/tmdb_crypto.c $(ORBISRPC)/tmdb.c \ - $(ORBISRPC)/updater.c $(ORBISRPC)/updater_util.c \ + $(ORBISRPC)/updater.c $(ORBISRPC)/updater_http.c $(ORBISRPC)/updater_util.c \ $(ORBISRPC)/tls.c $(ORBISRPC)/ws.c $(ORBISRPC)/discord.c $(ORBISRPC)/detect.c \ + $(ORBISRPC)/compat.c $(ORBISRPC)/lock.c $(ORBISRPC)/timesync.c \ + $(ORBISRPC)/art.c $(ORBISRPC)/health.c $(ORBISRPC)/manifest.c \ $(ORBISRPC)/daemon.c -PLUGIN_SRC := $(SRCDIR)/plugin.c $(SRCDIR)/compat.c +PLUGIN_SRC := $(SRCDIR)/plugin.c CFILES := $(PLUGIN_SRC) $(DAEMON_SRC) OBJS := $(patsubst %.c,$(INTDIR)/%.o,$(notdir $(CFILES))) MBED_SRC := $(shell find $(ROOT)/third_party/mbedtls/library -name '*.c' ! -name 'net_sockets.c' ! -name 'timing.c' ! -name 'entropy_poll.c' | sort) diff --git a/scripts/build.sh b/scripts/build.sh index 12bc67f..412fd69 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -47,7 +47,7 @@ LDFLAGS="-m elf_x86_64 -pie --eh-frame-hdr -L$SDK/lib $LIBS $SDK/lib/crt1.o --sc export OO_PS4_TOOLCHAIN="$SDK" OUT="$ROOT/build"; mkdir -p "$OUT" echo "=== compiling (CC=$CC LD=$LD SDK=$SDK) ===" -for f in log cfg jsonlite b64 sfo tmdb_crypto tmdb updater updater_util tls ws detect discord daemon compat main; do +for f in log cfg jsonlite b64 sfo tmdb_crypto tmdb updater updater_http updater_util tls ws detect discord daemon compat lock timesync art health manifest main; do "$CC" $CFLAGS -c -o "$OUT/$f.o" "orbisrpc/$f.c" || fail "compile $f" done echo "=== mbedtls (skip net_sockets/timing: POSIX-only) ===" diff --git a/scripts/build_sdk.sh b/scripts/build_sdk.sh index 75b60a8..6b98d30 100755 --- a/scripts/build_sdk.sh +++ b/scripts/build_sdk.sh @@ -15,7 +15,7 @@ OUT="build-sdk" mkdir -p "$OUT" CFLAGS="-O2 -Wall -DORBISRPC_SDK_PAYLOAD -Iorbisrpc -Ithird_party/mbedtls/include" echo "=== daemon sources (SDK) ===" -for f in log cfg jsonlite b64 sfo tmdb_crypto tmdb updater updater_util tls ws detect discord daemon compat clock lock timesync art health manifest main; do +for f in log cfg jsonlite b64 sfo tmdb_crypto tmdb updater updater_http updater_util tls ws detect discord daemon compat lock timesync art health manifest main; do # clock has no .c (header-only helper lives in compat.c); skip if missing [ -f "orbisrpc/$f.c" ] || continue "$CC" $CFLAGS -c -o "$OUT/$f.o" "orbisrpc/$f.c" || { echo "FAIL: $f"; exit 1; }