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

8320192: SHAKE256 does not work correctly if n >= 137 #16698

Closed
wants to merge 5 commits into from

Conversation

wangweij
Copy link
Contributor

@wangweij wangweij commented Nov 16, 2023

When blocksize is less than digest output length, call keccak more.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8320192: SHAKE256 does not work correctly if n >= 137 (Bug - P3)

Reviewers

Contributors

  • Ferenc Rakoczi <ferenc.r.rakoczi@oracle.com>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16698/head:pull/16698
$ git checkout pull/16698

Update a local copy of the PR:
$ git checkout pull/16698
$ git pull https://git.openjdk.org/jdk.git pull/16698/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16698

View PR using the GUI difftool:
$ git pr show -t 16698

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16698.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 16, 2023

👋 Welcome back weijun! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 16, 2023
@openjdk
Copy link

openjdk bot commented Nov 16, 2023

@wangweij The following label will be automatically applied to this pull request:

  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the security security-dev@openjdk.org label Nov 16, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 16, 2023

Webrevs

@wangweij
Copy link
Contributor Author

/contributor add @ferakocz

@openjdk
Copy link

openjdk bot commented Nov 16, 2023

@wangweij @ferakocz was not found in the census.

Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@wangweij
Copy link
Contributor Author

/contributor add Ferenc Rakoczi ferenc.r.rakoczi@oracle.com

@openjdk
Copy link

openjdk bot commented Nov 16, 2023

@wangweij
Contributor Ferenc Rakoczi <ferenc.r.rakoczi@oracle.com> successfully added.

Copy link
Contributor

@mcpowers mcpowers 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. I only found trivial things. A comment describing squeezeOffset would help.

@wangweij
Copy link
Contributor Author

New commit pushed. I've minimized the code changes for this bug fix. XOF functions are removed.

@mcpowers
Copy link
Contributor

Nice!

@valeriepeng
Copy link

Changes look fine. The synopsis should be updated as this is about SHAKE128? In addition, now that the digest output can be variable-length, it'd be good to update the comment for the private void keccak() method since the capacity c is not twice of digest length as in the case of SHA-3.

@wangweij
Copy link
Contributor Author

OK, I will remove the = (digest length x 2) words from keccak(). As for the synopsis, this bug was about the bug in SHAKE256, and I don’t know how to add SHAKE128 there. One solution is to remove SHAKE128.java at all from this code change, and I can add it into my other PR at RFE 4936767: Parameters for MessageDigest. How do you think of this?

Copy link

@valeriepeng valeriepeng 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. Thanks~

@openjdk
Copy link

openjdk bot commented Nov 20, 2023

@wangweij This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8320192: SHAKE256 does not work correctly if n >= 137

Co-authored-by: Ferenc Rakoczi <ferenc.r.rakoczi@oracle.com>
Reviewed-by: mpowers, valeriep

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 39 new commits pushed to the master branch:

  • 2b4e991: 8320208: Update Public Suffix List to b5bf572
  • 6b96bb6: 8319777: Zero: Support 8-byte cmpxchg
  • 020c900: 8320052: Zero: Use __atomic built-ins for atomic RMW operations
  • 30d8953: 8275889: Search dialog has redundant scrollbars
  • cee54de: 8319988: Wrong heading for inherited nested classes
  • 32098ce: 8320348: test/jdk/java/io/File/GetAbsolutePath.windowsDriveRelative fails if working directory is not on drive C
  • a2c0fa6: 8320372: test/jdk/sun/security/x509/DNSName/LeadingPeriod.java validity check failed
  • 3aefd1c: 8320234: Merge doclint.Env.AccessKind with tool.AccessKind
  • d6d7bdc: 8319817: Charset constructor should make defensive copy of aliases
  • 0712b22: 8320147: Remove DumpSharedSpaces
  • ... and 29 more: https://git.openjdk.org/jdk/compare/b05e69f789fa8c9a5320be5a841317abd3b3a235...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 20, 2023
@wangweij
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 20, 2023

Going to push as commit fcb4df2.
Since your change was applied there have been 39 commits pushed to the master branch:

  • 2b4e991: 8320208: Update Public Suffix List to b5bf572
  • 6b96bb6: 8319777: Zero: Support 8-byte cmpxchg
  • 020c900: 8320052: Zero: Use __atomic built-ins for atomic RMW operations
  • 30d8953: 8275889: Search dialog has redundant scrollbars
  • cee54de: 8319988: Wrong heading for inherited nested classes
  • 32098ce: 8320348: test/jdk/java/io/File/GetAbsolutePath.windowsDriveRelative fails if working directory is not on drive C
  • a2c0fa6: 8320372: test/jdk/sun/security/x509/DNSName/LeadingPeriod.java validity check failed
  • 3aefd1c: 8320234: Merge doclint.Env.AccessKind with tool.AccessKind
  • d6d7bdc: 8319817: Charset constructor should make defensive copy of aliases
  • 0712b22: 8320147: Remove DumpSharedSpaces
  • ... and 29 more: https://git.openjdk.org/jdk/compare/b05e69f789fa8c9a5320be5a841317abd3b3a235...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 20, 2023
@openjdk openjdk bot closed this Nov 20, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 20, 2023
@openjdk
Copy link

openjdk bot commented Nov 20, 2023

@wangweij Pushed as commit fcb4df2.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@wangweij wangweij deleted the 8320192 branch November 20, 2023 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated security security-dev@openjdk.org
3 participants