[openssl/openssl] 0a7d45: encode_key2any: free key params on error in key_to...

0 views
Skip to first unread message

Naveed Khan

unread,
Sep 10, 2026, 5:28:39 PMSep 10
to openssl...@openssl.org
Branch: refs/heads/master
Home: https://github.com/openssl/openssl
Commit: 0a7d45b6ac7bf487145234aa7ef251aeb8e8af94
https://github.com/openssl/openssl/commit/0a7d45b6ac7bf487145234aa7ef251aeb8e8af94
Author: Naveed Khan <dxbna...@gmail.com>
Date: 2026-09-10 (Thu, 10 Sep 2026)

Changed paths:
M .clang-format
M providers/implementations/encode_decode/encode_key2any.c

Log Message:
-----------
encode_key2any: free key params on error in key_to_p8info and key_to_pubkey

key_to_spki_der_pub_bio leaked the str params blob when key_to_pubkey
failed, since X509_ALGOR_set0 only consumes it on success. Roll the
error-path free into key_to_pubkey and key_to_p8info (also called via
key_to_encp8), so all callers are covered.

Fixes: 8ae40cf57d21 "ENCODER: Refactor provider implementations, and some cleanup"
Complements: 576892d78f80 "Fix d2i_AutoPrivateKey_ex so that is uses the new decoder (and produces non legacy keys)."

Reviewed-by: Viktor Dukhovni <vik...@openssl.org>
Reviewed-by: Mounir Idrassi <mounir....@idrix.fr>
Reviewed-by: Tomas Mraz <to...@openssl.foundation>
Reviewed-by: Neil Horman <nho...@openssl.org>
MergeDate: Thu Sep 10 21:24:08 2026
(Merged from https://github.com/openssl/openssl/pull/31841)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications
Reply all
Reply to author
Forward
0 new messages