Skip to content

usercertinmem: use the correct cert BIO - #20800

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/usercertinmem
Closed

bagder wants to merge 1 commit into
masterfrom
bagder/usercertinmem

Conversation

@bagder

@bagder bagder commented Mar 3, 2026

Copy link
Copy Markdown
Member

PEM_read_bio_PrivateKey() is called with the wrong BIO, so the private key is not loaded.

Follow-up to 8494012

Pointed out by Codex Security

PEM_read_bio_PrivateKey() is called with the wrong BIO, so the private
key is not loaded.

Follow-up to 8494012

Pointed out by Codex Security

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the in-memory user certificate example so OpenSSL reads the private key from the correct BIO, ensuring the key actually loads.

Changes:

  • Pass kbio (private-key BIO) to PEM_read_bio_PrivateKey() instead of bio (certificate BIO).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/examples/usercertinmem.c
@bagder bagder closed this in 7079f1d Mar 3, 2026
@bagder
bagder deleted the bagder/usercertinmem branch March 3, 2026 22:16
bagder added a commit that referenced this pull request Mar 3, 2026
PEM_read_bio_PrivateKey() is called with the wrong BIO, so the private
key is not loaded.

Follow-up to 8494012

Pointed out by Codex Security
Closes #20800
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
PEM_read_bio_PrivateKey() is called with the wrong BIO, so the private
key is not loaded.

Follow-up to 8494012

Pointed out by Codex Security
Closes curl#20800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants