ruby / ruby/openssl

OpenSSL 3 support for loading engine keys

Open
#723 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
276
Forks
200
Avg merge
1d 19h
Merged PRs (30d)
7

Description

Openssl 3 still supports loading engines and some engines still haven't migrated to using providers.
In such cases it is possible to continue using engines. They can be loaded using openssl's config file.

Previously I could load a private key(provided by custom engine) like so

  OpenSSL::PKey.read("some private key")

But now even though engine is loaded the same command returns Could not parse PKey (OpenSSL::PKey::PKeyError).

Using OpenSSL::PKey.new_raw_private_key also did not help.
Locally installing ruby/openssl and reverting ossl_pkey_read_generic in ossl_pkey.c to the previous version(before openssl 3 support) did help, but this method is not viable for production.

Is it possible to provide some way to load such keys?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ossl_pkey.c, especially ossl_pkey_read_generic, and review how OpenSSL 3 engine-loaded keys are handled through the APIs mentioned in the report. Reproduce the OpenSSL::PKey.read failure with a configured custom engine, then determine what supported loading behavior is needed so those private keys can be loaded without the reported PKeyError.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ruby
Domain
cryptography, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.