fix(libSceLibreSsl): report why RSA_sign fails #16865
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16865"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-07T19:18:12Z.
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.37c6f9b6d9, with no compiler warnings in the changed files;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