From 7079f1d39c162747f60c3818f5a80c8edf35fa9d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Mar 2026 18:21:16 +0100 Subject: [PATCH] usercertinmem: use the correct cert BIO PEM_read_bio_PrivateKey() is called with the wrong BIO, so the private key is not loaded. Follow-up to 8494012196474ee0541 Pointed out by Codex Security Closes #20800 --- docs/examples/usercertinmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index 03dd148276..29cc754c14 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -108,7 +108,7 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) printf("BIO_new_mem_buf failed\n"); } - pkey = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL); + pkey = PEM_read_bio_PrivateKey(kbio, NULL, NULL, NULL); if(!pkey) { printf("Failed EVP_PKEY_new()\n"); }