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: add support for OCB mode for AEAD by tniessen · Pull Request #21447 · nodejs/node

Conversation

@tniessen

@tniessen tniessen commented Jun 21, 2018

Copy link
Copy Markdown
Member

This change adds support for OCB, the newest and fastest AEAD mode offered by OpenSSL. There are relatively few changes required within the native code, the OCB implementation behaves somewhat like CCM, except that some limitations of CCM don't apply.

As OCB is patented, we will need to check whether this change has any legal implications. The holder of the patents, Phillip Rogaway, has summarized the situation here and I am pretty sure there won't be any problems, but I wouldn't want to be the one to make the decision.

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 commented Jun 21, 2018

Copy link
Copy Markdown
Collaborator

@tniessen build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/113/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. labels Jun 21, 2018
@tniessen

tniessen commented Jun 21, 2018

Copy link
Copy Markdown
Member Author

CC @nodejs/crypto. Not sure who to ping for the legal stuff.

All reactions

Sorry, something went wrong.

Uh oh!

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

@jasnell

jasnell commented Jun 22, 2018

Copy link
Copy Markdown
Member

As OCB is patented, we will need to check whether this change has any legal implications.

We should marked this blocked until we can get a legal review.

@MylesBorins ... this may be one to bring up to the legal committee.

All reactions

Sorry, something went wrong.

Uh oh!

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

@jasnell jasnell added the blocked PRs that are blocked by other issues or PRs. label Jun 22, 2018
bnoordhuis
bnoordhuis approved these changes Jun 25, 2018
View reviewed changes

@bnoordhuis bnoordhuis left a comment

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.

LGTM modulo comment.

Apropos the legal ramifications, note that we're already shipping OCB:

$ node
> var c = crypto.createCipheriv('aes-128-ocb', 'x'.repeat(16), 'x'.repeat(12)); c.update('boom'); c.final()
<Buffer 4e 83 df 21>

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/node_crypto.cc Outdated

@bnoordhuis bnoordhuis Jun 22, 2018

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.

Why not make this a function?

Sorry, something went wrong.

Uh oh!

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

All reactions

@tniessen tniessen Jun 25, 2018

Copy link
Copy Markdown
Member Author

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.

Mhhh I think in my head it still looks like "less overhead". Would you like me to change it?

Sorry, something went wrong.

Uh oh!

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

All reactions

@bnoordhuis bnoordhuis Jun 25, 2018

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.

Yes, please.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/node_crypto.cc Outdated

@bnoordhuis bnoordhuis Jun 25, 2018

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.

This will conflict with #21462 when it lands (but no doubt you knew that since you reviewed it. :-))

Sorry, something went wrong.

Uh oh!

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

All reactions

@tniessen tniessen Jun 25, 2018

Copy link
Copy Markdown
Member Author

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.

Yes, but thanks for pointing it out 😃

Sorry, something went wrong.

Uh oh!

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

All reactions
@tniessen

tniessen commented Jun 25, 2018

Copy link
Copy Markdown
Member Author

Thanks for reviewing, @bnoordhuis!

Apropos the legal ramifications, note that we're already shipping OCB:

And we are already shipping OpenSSL which supports OCB, that's why I assume hope there won't be any problems.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tniessen
tniessen force-pushed the crypto-add-ocb-support branch from 4617818 to 64efc01 Compare June 26, 2018 15:28
@tniessen

tniessen commented Jun 26, 2018

Copy link
Copy Markdown
Member Author

Comment addressed and rebased (old HEAD was 46178187be645f7451279382467c6799b0e3b8cc).

All reactions

Sorry, something went wrong.

Uh oh!

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

@jasnell

jasnell commented Jun 29, 2018

Copy link
Copy Markdown
Member

I doubt there will be any issues here and it's likely safe to proceed, but it would still be good to get a legal committee review (assuming that doesn't take forever lol). Let's not block on it tho

All reactions

Sorry, something went wrong.

Uh oh!

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

jasnell
jasnell approved these changes Jun 29, 2018
View reviewed changes
@tniessen

tniessen commented Jun 29, 2018

Copy link
Copy Markdown
Member Author

Thanks @jasnell. Sadly, I literally know nothing about our legal committee, I can't even find a list of members or documented processes involving them.

Full CI: https://ci.nodejs.org/job/node-test-pull-request/15662/

All reactions

Sorry, something went wrong.

Uh oh!

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

@jasnell

jasnell commented Jun 29, 2018

Copy link
Copy Markdown
Member

That's something @MylesBorins needs to do

All reactions

Sorry, something went wrong.

Uh oh!

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

@tniessen tniessen added author ready PRs with CI started, the required approvals, and no outstanding review comments. and removed blocked PRs that are blocked by other issues or PRs. labels Jul 1, 2018
@tniessen
tniessen force-pushed the crypto-add-ocb-support branch from 64efc01 to dce91f9 Compare July 13, 2018 00:02
@tniessen

tniessen commented Jul 13, 2018

Copy link
Copy Markdown
Member Author

Rebased, old HEAD was 64efc012ccb9fcdf2f619f1f9cbcf0691fae5009.
New CI: https://ci.nodejs.org/job/node-test-pull-request/15839/

I am pinging @nodejs/tsc to make sure that they know of this change, I would like to land it next week.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Trott

Trott commented Jul 13, 2018

Copy link
Copy Markdown
Member

Since adding stuff to crypto has been A Thing lately, I'm going to cc @nodejs/security-wg...

tniessen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@BridgeAR

BridgeAR commented Jul 17, 2018

Copy link
Copy Markdown
Member

This needs a rebase.

All reactions

Sorry, something went wrong.

Uh oh!

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

tniessen added 3 commits July 17, 2018 19:51
@tniessen
crypto: add support for OCB mode for AEAD
bbc8da2
@tniessen
doc: adapt crypto docs to explain OCB mode
501017a
@tniessen
fixup! crypto: add support for OCB mode for AEAD
3322a3f
@tniessen
tniessen force-pushed the crypto-add-ocb-support branch from dce91f9 to 3322a3f Compare July 17, 2018 17:53
@tniessen

tniessen commented Jul 17, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Thank you, @BridgeAR! Rebased, old HEAD was dce91f94f146bbf73b8a059ba30be4f9defa84bc.
CI: https://ci.nodejs.org/job/node-test-pull-request/15912/
Only failure seems to be unrelated, resuming: https://ci.nodejs.org/job/node-test-pull-request/15914/

I will land this tomorrow unless someone objects.

All reactions

Sorry, something went wrong.

Uh oh!

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

tniessen added a commit to tniessen/node that referenced this pull request Jul 18, 2018
@tniessen
crypto: add support for OCB mode for AEAD
b3f459e
PR-URL: nodejs#21447
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@tniessen

tniessen commented Jul 18, 2018

Copy link
Copy Markdown
Member Author

Landed in b3f459e.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tniessen tniessen closed this Jul 18, 2018
@targos targos removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jul 19, 2018
@targos

targos commented Jul 19, 2018

Copy link
Copy Markdown
Member

Depends on #21782 to land on v10.x-staging

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos targos added the backport-requested-v10.x label Jul 19, 2018
@targos targos mentioned this pull request Jul 24, 2018
test: move AEAD test vectors out of script #21873
Closed
3 tasks done
@targos

targos commented Aug 7, 2018

Copy link
Copy Markdown
Member

#21782 landed but there are still conflicts in the C++ code.

Should this be backported to v10.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

/cc @tniessen

All reactions

Sorry, something went wrong.

Uh oh!

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

@rvagg

rvagg commented Aug 13, 2018

Copy link
Copy Markdown
Member

Yes, it should be backported to v10.x-staging. I started working on it but decided to cut my losses. @tniessen the conflicts are around semver-major changes you've introduced in master so you'll probably have a much easier time putting a PR against v10.x-staging to backport this.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tniessen

tniessen commented Aug 13, 2018

Copy link
Copy Markdown
Member Author

I'll be home in a couple of days and will give it a try.

All reactions

Sorry, something went wrong.

Uh oh!

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

@targos

targos commented Aug 19, 2018

Copy link
Copy Markdown
Member

@tniessen I see that you pushed a backport branch to your fork. Is it ready for a PR?

All reactions

Sorry, something went wrong.

Uh oh!

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

@tniessen

tniessen commented Aug 19, 2018

Copy link
Copy Markdown
Member Author

@targos The code itself should work, but I am afraid that it might have unintended side effects for CCM. I'll try to verify that within the next few days.

targos reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

tniessen added a commit to tniessen/node that referenced this pull request Aug 23, 2018
@tniessen
crypto: add support for OCB mode for AEAD
7ae8ab4
PR-URL: nodejs#21447
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@tniessen tniessen mentioned this pull request Aug 23, 2018
(v10.x backport) crypto: add support for OCB mode for AEAD #22473
Closed
@targos targos added backported-to-v10.x and removed backport-requested-v10.x labels Aug 29, 2018
targos pushed a commit that referenced this pull request Aug 29, 2018
@tniessen @targos
crypto: add support for OCB mode for AEAD
bc7dbc1
Backport-PR-URL: #22473
PR-URL: #21447
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Sep 3, 2018
@tniessen @targos
crypto: add support for OCB mode for AEAD
59a6c60
Backport-PR-URL: #22473
PR-URL: #21447
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Sep 5, 2018
Release proposal: v10.10.0 #22716
Merged
targos pushed a commit that referenced this pull request Sep 6, 2018
@tniessen @targos
crypto: add support for OCB mode for AEAD
6465623
Backport-PR-URL: #22473
PR-URL: #21447
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
This was referenced Sep 6, 2018
2018-09-06 Version 10.10.0 (Current) @targos beevelop/docker-android-nodejs#236
Closed
2018-09-06 Version 10.10.0 (Current) @targos beevelop/docker-nodejs#221
Closed
@panva panva mentioned this pull request Apr 8, 2022
fix(node): add ocb modes to crypto, fix ccm and gcm iv DefinitelyTyped/DefinitelyTyped#59761
Merged
7 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

Uh oh!

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

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem.

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

@tniessen @nodejs-github-bot @jasnell @Trott @BridgeAR @targos @rvagg @bnoordhuis
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.