ruby / ruby/openssl

Add a method OpenSSL::PKey#size

Open
#988 1 comment 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

I was trying to migrate an old Perl script to Ruby, which receives a string consisting of a signature and the contents concatenated. The core of the script is like this:

my $sign_key = Crypt::OpenSSL::RSA->new_public_key($key_string);
my $signature = substr($data, 0, $sign_key->size, ''); # Cut off signature of $data
die "data wasn't signed correctly!\n" unless $sign_key->verify($data, $signature);

There does not appear a way to get the size of the signature from Ruby. It should just be a call to EVP_PKEY_get_size

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 at the implementation of the OpenSSL::PKey API and trace how EVP_PKEY-backed methods are exposed to Ruby; the issue identifies EVP_PKEY_get_size as the underlying entry point. Done means OpenSSL::PKey#size reports the key or signature size needed by the concatenated-data use case, with behavior checked against the OpenSSL documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ruby
Domain
cryptography
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.