Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add convenience constants #625

Closed
wants to merge 1 commit into from

Conversation

rchekaluk
Copy link

Gem net-ssh defines two convenience constants:

  • OpenSSL::PKey::EC::CurveNameAlias
  • OpenSSL::PKey::EC::CurveNameAliasInv

Because I have needed to duplicate these constants in other gems that depend on ruby/openssl, migrate them upstream to ruby/openssl for convenience.

@ioquatix
Copy link
Member

I had a quick look, but what's the point of the Inv suffix list? Would it make sense to just define a canonical name and stick with it? Is there actually a need to map back to the aliases? (assuming it's 1:1 and not 1:N).

@rchekaluk
Copy link
Author

I may not understand the question fully, but the reason for both hashes is that there are use cases for both. Specifically, for examples see:

Moreover, note that in order to support JRuby, gem sshkey has a use case where there are duplicated values in the analogue of CurveNameAliasInv (which precludes the use of CurveNameAlias.invert). You may want to consider including that additional case in this pull request.

@ioquatix
Copy link
Member

Okay, let me clarify.

When I think of an alias, I think of "There is a person Bob", and I can also refer to "Bob" as Rob, Hob, Dob. Those are aliases.

Because of that, the mapping is not 1:1 but 1:N.

What I want to understand is, is this a table of aliases (1:N) or something else (1:1). I think the mental model and how we organise it will be slightly different.

In principle I understand the use case and agree with adding these, I just want to make sure we do it correctly.

cc @headius maybe you have some thoughts.

@rhenium
Copy link
Member

rhenium commented Jun 6, 2023

It looks like the /nistp.*/ are the curve names used in the SSH protocol (https://www.rfc-editor.org/rfc/rfc5656.html). I think the gems implementing it are the right places for this mapping table to be defined in.

@rhenium rhenium closed this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants