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 8494012196

Pointed out by Codex Security
Closes #20800
This commit is contained in:
Daniel Stenberg 2026-03-03 18:21:16 +01:00
parent ad58e07b54
commit 7079f1d39c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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");
}