GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: KeyObject.asymmetricKeySize API by paroga · Pull Request #26387 · nodejs/node

Conversation

@paroga

@paroga paroga commented Mar 2, 2019 •
edited by BridgeAR
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Expose the size of asymetric keys of crypto key object from the
crypto module added in v11.6.0 (#24234)

Refs: #24234

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. labels Mar 2, 2019
@paroga
paroga force-pushed the aks branch from d327b89 to c49107f Compare March 2, 2019 00:53
mscdex
mscdex reviewed Mar 2, 2019
View reviewed changes
Comment thread doc/api/crypto.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@paroga
paroga force-pushed the aks branch from c49107f to 9cb0d25 Compare March 2, 2019 01:49
bnoordhuis
bnoordhuis reviewed Mar 2, 2019
View reviewed changes
Comment thread doc/api/crypto.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@paroga
crypto: keyObject.asymmetricKeySize API
294c890
Expose the size of asymetric keys of crypto key object from the
crypto module added in v11.6.0 (nodejs#24234)
@paroga
paroga force-pushed the aks branch from 9cb0d25 to 294c890 Compare March 2, 2019 15:05
bnoordhuis
bnoordhuis approved these changes Mar 2, 2019
View reviewed changes

@bnoordhuis bnoordhuis left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks, LGTM. CI: https://ci.nodejs.org/job/node-test-pull-request/21140/

Maybe a minor suggestion vis-a-vis the commit log summary: crypto: add KeyObject.asymmetricKeySize?

The link to the issue should be Fixes: https://github.com/nodejs/node/pull/24234 on its own line.

edit: make that Refs: https://github.com/nodejs/node/pull/24234

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jasnell
jasnell approved these changes Mar 2, 2019
View reviewed changes
BridgeAR
BridgeAR approved these changes Mar 6, 2019
View reviewed changes
@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Mar 6, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 6, 2019
@paroga @BridgeAR
crypto: add KeyObject.asymmetricKeySize
4895927
Expose the size of asymetric keys of crypto key object from the
crypto module added in v11.6.0.

PR-URL: nodejs#26387
Refs: nodejs#24234
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@BridgeAR

BridgeAR commented Mar 6, 2019

Copy link
Copy Markdown
Member

Landed in 4895927 🎉

I updated the commit message while landing as suggested.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR closed this Mar 6, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 12, 2019
@paroga @BridgeAR
crypto: add KeyObject.asymmetricKeySize
09c83d8
Expose the size of asymetric keys of crypto key object from the
crypto module added in v11.6.0.

PR-URL: nodejs#26387
Refs: nodejs#24234
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@panva

panva commented Mar 13, 2019

Copy link
Copy Markdown
Member

👋 Maybe i'm missing something but EVP_PKEY_size returns the maximum signature size in bytes, not the actual key size.

This is apparent with Ed25519 and Ed448 and possibly EC keys as well.

pem =`-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEXRYV3v5ucrHVR3mKqyPXxXqU34lASwc7Y7MoOvaqcs=\n-----END PUBLIC KEY-----`
k=crypto.createPublicKey(pem)
// PublicKeyObject { [Symbol(kKeyType)]: 'public' }
k.asymmetricKeyType
// 'ed25519'
k.asymmetricKeySize
// 114

114 bytes is the length of a signature, key is in fact 57 bytes

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

mscdex commented Mar 13, 2019

Copy link
Copy Markdown
Contributor

@panva That's probably worth posting a new issue for.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@panva

panva commented Mar 13, 2019

Copy link
Copy Markdown
Member

Will do, wanted to check first if i missed something

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@panva panva mentioned this pull request Mar 13, 2019
keyObject.asymmetricKeySize returns incorrect values for EC and Ed keys #26631
Closed
@panva

panva commented Mar 13, 2019

Copy link
Copy Markdown
Member

created #26631

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@paroga
paroga deleted the aks branch March 13, 2019 13:19
@paroga

paroga commented Mar 13, 2019

Copy link
Copy Markdown
Contributor Author

i only checked it with RSA, since there are only RSA tests for the KeyObject in the repository. Maybe we should just rename the property and/or change the documentation, to match the returned value

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tniessen tniessen added the semver-minor PRs that contain new features and should be released in the next minor version. label Mar 13, 2019
@tniessen

tniessen commented Mar 13, 2019

Copy link
Copy Markdown
Member

I'm assuming this should have been marked as semver-minor.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tniessen tniessen mentioned this pull request Mar 13, 2019
Revert "crypto: add KeyObject.asymmetricKeySize" #26636
Closed
4 tasks
@BridgeAR BridgeAR mentioned this pull request Mar 13, 2019
2019-03-14, Version 11.12.0 (Current) #26644
Merged
BridgeAR added a commit that referenced this pull request Mar 13, 2019
@BridgeAR
2019-03-14, Version 11.12.0 (Current)
589c1b6
Notable Changes

* build:
  * Enable v8's siphash for hash seed creation (Rod Vagg)
    #26367
* crypto:
  * Add `KeyObject.asymmetricKeySize` (Patrick Gansterer)
    #26387
* deps:
  * Upgrade openssl to 1.1.1b (Sam Roberts)
    #26327
* process:
  * Make `process[Symbol.toStringTag]` writable again
    (Ruben Bridgewater) #26488
* repl:
  * Add `util.inspect.replDefaults` to customize the writer
    (Ruben Bridgewater) #26375
* report:
  * Rename `triggerReport()` to `writeReport()` (Colin Ihrig)
    #26527
@BridgeAR

BridgeAR commented Mar 13, 2019

Copy link
Copy Markdown
Member

I'll back out this PR from v11.12.0 due to the concerns by @tniessen. If this should indeed land in a PR, please update the labels accordingly.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR added the dont-land-on-v6.x label Mar 13, 2019
@BridgeAR BridgeAR added dont-land-on-v8.x labels Mar 13, 2019
This was referenced Apr 23, 2019
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-android-nodejs#302
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-nodejs#275
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-nodejs#276
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-android-nodejs#303
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-nodejs#277
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-android-nodejs#304
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-nodejs#278
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-android-nodejs#305
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-nodejs#279
Closed
2019-04-23 Version 12.0.0 (Current) @BethGriggs beevelop/docker-android-nodejs#306
Closed
@Flarna Flarna mentioned this pull request Apr 24, 2019
feat(node): v12 DefinitelyTyped/DefinitelyTyped#34952
Merged
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
@jasnell jasnell jasnell approved these changes
@BridgeAR BridgeAR BridgeAR approved these changes
+1 more reviewer
@mscdex mscdex mscdex left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@paroga @BridgeAR @panva @mscdex @tniessen @bnoordhuis @jasnell @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.