Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ssh: fix ssh_file:encode typespec #10539

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

Open
u3s wants to merge 3 commits into erlang:maint
base: maint
Choose a base branch
Loading
from u3s:kuba/ssh/ssh_file_encode_doc_fix/OTP-19915

Conversation

@u3s
Copy link
Contributor

@u3s u3s commented Jan 13, 2026

@u3s u3s self-assigned this Jan 13, 2026
@u3s u3s added the team:PS Assigned to OTP team PS label Jan 13, 2026
Copy link
Contributor

github-actions bot commented Jan 13, 2026
edited
Loading

CT Test Results

2 files 29 suites 20m 7s ⏱️
482 tests 476 ✅ 6 💤 0 ❌
1 687 runs 1 661 ✅ 26 💤 0 ❌

Results for commit caadeab.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@u3s u3s requested a review from Mikaka27 January 13, 2026 15:05
@u3s u3s added the testing currently being tested, tag is used by OTP internal CI label Jan 13, 2026
- Fixes erlang#10525
- related to commit b50e148 in public_key: Add missing macros and definitions
Copy link
Contributor

@IngelaAndin IngelaAndin left a comment

Choose a reason for hiding this comment

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

Looks good to me. ssh_msg change is due to updating of public_key specs. You now get an enumeration atom with the new asn-1 specs instead of the enumeration number. The ssh file format I think you have better knowledge of than me.

- Add backward compatibility for ECPrivateKey version field
 * Support both integer 1 (OTP 26/27) and atom ecPrivkeyVer1 (OTP 28)
 * Fixes pattern match failures after public_key ASN.1 modernization
- Split experimental_openssh_key_v1 typespec into encode/decode variants
 * experimental_openssh_key_v1_encode() - for encoding input
 * experimental_openssh_key_v1_decode() - for decoding output
 * Fixes type asymmetry between encode and decode flows
- Add comprehensive compatibility test
 * Tests EdDSA curves: ed25519, ed448
 * Tests ECDSA curves: secp256r1, secp384r1
 * Verifies both version formats produce identical encoding
- Code cleanup
 * Remove outdated comments
 * Fix whitespace and formatting
 * Update KeyPairs comment to document both tuple formats
Related to commit b50e148 (public_key: Add missing macros and definitions)
Fixes erlang#10525, erlang#10526 
OID== ?'id-Ed448'->
publicKey = Pub})
when OID =:= ?'id-Ed25519' orelseOID=:= ?'id-Ed448',
Version=:=1orelseVersion=:=ecPrivkeyVer1->% currently used atom and legacy value 1
Copy link
Contributor

@IngelaAndin IngelaAndin Jan 27, 2026

Choose a reason for hiding this comment

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

Maybe reverse the test as probably ecPrivKeyVer1 will be the value in new systems and value 1 will be the backwards compatibility that should not happen that much.

-type experimental_openssh_key_v1() :: [{key(), openssh_key_v1_attributes()}].
-doc "Types for the experimental implementaition of the `openssh_key_v1` format.".
-type experimental_openssh_key_v1_encode() ::
[{[{public_key:public_key(), public_key:private_key(), binary()} |
Copy link
Contributor

@IngelaAndin IngelaAndin Jan 27, 2026

Choose a reason for hiding this comment

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

What is the binary() , maybe it should say Comment::binary() ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@IngelaAndin IngelaAndin IngelaAndin left review comments

@Mikaka27 Mikaka27 Awaiting requested review from Mikaka27

At least 1 approving review is required to merge this pull request.

Assignees

@u3s u3s

Labels

team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Milestone

No milestone

AltStyle によって変換されたページ (->オリジナル) /