Commit Graph
3 Commits
Author SHA1 Message Date
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Claude 687e7d637e fix(libSceLibreSsl): return null from CRYPTO_malloc for sizes of zero or less
CRYPTO_malloc threw for a size of zero or less. LibreSSL 2.5.4, 3.4.1
and 3.4.3 all take an int size and return null there, so it now does
the same, and the test checks for null instead of a throw.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-23 13:15:04 +00:00
HQasperandClaude Opus 5.5 eb9491b194 feat(libSceLibreSsl): implement RAND and the CRYPTO allocator functions
RAND_add, RAND_bytes, RAND_status, RAND_load_file, RAND_file_name,
CRYPTO_malloc, CRYPTO_free and CRYPTO_set_mem_functions threw. They now
behave as in LibreSSL 2.6.5 through 3.4.3, where these functions did not
change: RAND_bytes fills the buffer from host entropy and returns 1,
RAND_add ignores its input, RAND_status returns 1, RAND_load_file returns
123456 for -1 and the requested count otherwise, RAND_file_name copies
"/dev/urandom" with strlcpy semantics, CRYPTO_malloc and CRYPTO_free use
the guest heap, and CRYPTO_set_mem_functions refuses with 0.

CRYPTO_malloc of zero or a negative size throws because later LibreSSL
versions take a size_t and call malloc instead of returning null.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-23 12:49:06 +00:00