Skip to content

feat(libSceLibreSsl): implement EVP_PKEY_id - #10418

Draft
MarcZX10 wants to merge 3 commits into
boykopovar:mainfrom
MarcZX10:codex/libressl-evp-pkey-id
Draft

MarcZX10 wants to merge 3 commits into
boykopovar:mainfrom
MarcZX10:codex/libressl-evp-pkey-id

Conversation

@MarcZX10

@MarcZX10 MarcZX10 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement the missing EVP_PKEY_id export in libSceLibreSsl. The function returns the stored key type unchanged. The implementation follows LibreSSL 2.5.4: EVP_PKEY begins with an int type, and EVP_PKEY_id returns that field (implementation, structure). The cited firmware discussion identifies LibreSSL 2.5.4, but this layout has not been independently verified on a PS5.

The regression test covers unchanged return values across representative identifiers and the null-input throw required by this repository's unimplemented-path convention. Null is dereferenced in the reference implementation.

Tested

Linux host, GCC, C++20: manually compiled the implementation and focused test source with -Wall -Wextra -Werror, using a small local shim for the repository's throw helper; the test passed. python3 tools/check_conventions.py --base upstream/main and git diff upstream/main...HEAD --check pass. The full CMake target, Windows, a title, and console behavior were not tested.

The exact symbol was searched in the open PR queue and no PR implementing EVP_PKEY_id was found. The full-queue overlap scan could not finish, so I ran the repository overlap comparison against the active LibreSSL PR refs affecting these files. It found line conflicts at CMakeLists.txt:1 and debt/libSceLibreSsl.md:5 with #10398, #10395, #10373, #10376, and #9529; and at the debt count with #10071. It found no duplicate export. #10005 shares the relevant files but could not be compared because that branch conflicts with current main. I proposed that #10398, #10395, and #10005 land first, with this branch rebased afterward, and asked those authors to confirm. This draft remains pending their sequencing responses.

Checklist

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9571 core/libs/prx/libSceLibreSsl/CMakeLists.txt L1
PR 12844 core/libs/prx/libSceLibreSsl/CMakeLists.txt L1

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 9446 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
docs/dev/debt/libSceLibreSsl.md
PR 9448 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10508 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10878 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 10915 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11128 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11146 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11151 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11174 core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11175 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11466 core/libs/prx/libSceLibreSsl/CMakeLists.txt
core/libs/prx/libSceLibreSsl/Export.cpp
core/libs/prx/libSceLibreSsl/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
PR 11553 docs/dev/debt/libSceLibreSsl.md

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 24, 2026
@MarcZX10
MarcZX10 force-pushed the codex/libressl-evp-pkey-id branch from d5b6d9b to 1f77c2f Compare October 24, 2026 17:06
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 24, 2026
@MarcZX10
MarcZX10 force-pushed the codex/libressl-evp-pkey-id branch from 1f77c2f to 15ea8e9 Compare October 26, 2026 22:23
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 26, 2026

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Linux run of the full build, since the description reports a standalone compile with a shim.

Machine: Linux x86_64, i7-8700 (6 cores / 12 threads, AVX2), Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON. Head 15ea8e9e2 merged onto main e2d457be3 (clean).

  • Build ok. All 19 libressl tests pass, guest_libressl_pkey_id among them (20 of 20 repeated runs), plus patched_libraries.
  • Restoring the throwing stub and keeping the test aborts guest_libressl_pkey_id with EVP_PKEY_id_nid_postfix not implemented.
  • Moving the export to src/PkeyId.cpp keeps it patched. In the patched libSceLibreSsl.prx, it is exported as yPuxTL2GJO0, at the same address as EVP_PKEY_id_nid_postfix in the unpatched build.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@MarcZX10
MarcZX10 force-pushed the codex/libressl-evp-pkey-id branch from 15ea8e9 to 88f938d Compare October 27, 2026 01:51
@MarcZX10

Copy link
Copy Markdown
Contributor Author

Head moved to 88f938d531 (rebased onto current main, plus a new commit): the public header audit (test_public_headers.py --audit-only, run in CI as public_headers) fails on the merge of this PR with main, because the exports of this PR are not declared exactly once in their library header. The new commit declares them in the library's include/Api.hpp with the signatures of their definitions, and the tests and sources that kept their own extern "C" copies include the header instead (a placeholder with no parameters in main's header takes the definition's signature). Behaviour is unchanged. tools/check_conventions.py --base upstream/main and the header audit pass and the changed sources pass a syntax check; the guest tests were not rerun for this change unless a comment below says so.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 27, 2026
@MarcZX10
MarcZX10 force-pushed the codex/libressl-evp-pkey-id branch from 88f938d to 20a2172 Compare October 27, 2026 08:58
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 27, 2026
@MarcZX10
MarcZX10 force-pushed the codex/libressl-evp-pkey-id branch from 20a2172 to dcc5eb1 Compare October 28, 2026 12:07
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 28, 2026
MarcZX10 and others added 3 commits October 28, 2026 15:33
…ary header

The public header audit wants exactly one declaration per export, in the library header: the exports the PR adds are declared in Api.hpp with their definitions' signatures, a placeholder with no parameters takes the definition's signature, and the copies in tests and other sources are replaced by an include of the header.
@MarcZX10
MarcZX10 force-pushed the codex/libressl-evp-pkey-id branch from dcc5eb1 to 39568ac Compare October 28, 2026 15:35
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants