]> git.ipfire.org Git - thirdparty/systemd.git/commit
crypto-util: simplify openssl_extract_public_key()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 30 Jun 2026 15:33:27 +0000 (00:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jul 2026 18:02:56 +0000 (03:02 +0900)
commitfc54be2f666ef09a8b85edc41c094ff23adf8558
tree39d4c1052e34ce710d91dfaea4c28f7e95b3046b
parent94e8d7209ef86892e6b6d045e25d875528ea1d0d
crypto-util: simplify openssl_extract_public_key()

Drop memstream and i2d_PUBKEY_fp(). We can simply use i2d_PUBKEY()
which automatically allocates the necessary buffer for us.

Note that dropping the secure erase (erase_and_freep()) in favor of
OPENSSL_free() is intentional and safe, as the buffer only holds
public key material which does not need to be securely wiped.
src/shared/crypto-util.c