Repository navigation
fix(libSceLibreSsl): report why RSA_sign fails - #16865
oneandonlydean merged 1 commit into
Conversation
Match LibreSSL 2.5.4 rsa_sign.c error publication for implemented early failures, preserving callback dispatch and unsupported paths. Source: https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libcrypto/rsa/rsa_sign.c Add a separate ctest for reason codes, queue ordering, output preservation, DigestInfo parameters, callback results and success without added errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
|
Ran The test target is registered by this PR, so I couldn't run the new test against AI-assisted: yes. |
|
Thanks for the run. The control against main is in the Tested section: keeping this branch and running |
What
libSceLibreSsl
RSA_sign(NIDHohNCzDzBW0) returned 0 on its early failures without queueing an error, so a caller'sERR_get_errorsaw nothing or an older, unrelated error. This PR makes each implemented failure branch queue what LibreSSL 2.5.4'srsa_sign.cqueues throughRSAerror(library RSA, function0xfff). It follows my #16649 (EVP_DecryptFinal_ex) and #16741 (BN_mod_inverse).NID_md5_sha1with a digest length other than 36RSA_R_INVALID_MESSAGE_LENGTHOBJ_nid2objreturns NULL)RSA_R_UNKNOWN_ALGORITHM_TYPENID_undef, whose OID has length 0RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MDRSA_size - RSA_PKCS1_PADDING_SIZERSA_R_DIGEST_TOO_BIG_FOR_RSA_KEYOBJ_nid2objqueues first, when the added-object table exists, is kept ahead of the RSA error.rsa_signmethods andRSA_private_encryptcallbacks keep their own result, output and errors, with no extraRSA_signerror, as upstream;RSA_verifyisn't touched.ERR_R_MALLOC_FAILURE. The new debt entry records this.Tested
guest_libressl_rsa_sign_errors(core/libs/tests/GuestLibreSslRsaSignErrors.cpp) queues a sentinel error before each call.*siglenare left untouched.NID_undef, and negative types with and without an added-object table (made withOBJ_create).RSA_private_encryptcallbacks and customrsa_signmethods queue no extra error.main, every failure branch fails its assertion withRSA_sign error 0x0 expected RSA/fff/<reason>;guest_libressl_rsa_sign_errors,guest_libressl_rsa,guest_libressl_rsa_privateandguest_libressl_rsa_psspass 4/4.main'sRsa.cpp,guest_libressl_rsa_sign_errorsfails withRSA_sign error 0x0 expected RSA/fff/131.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py --branch fix/libscelibressl-rsa-sign-errors: no confirmed overlap. The tool couldn't compare these PRs because they conflict withmain, so I read their diffs by hand:None changes
RSA_sign.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code