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

8170762: Document that ISO10126Padding pads with random bytes #9350

Closed
wants to merge 1 commit into from

Conversation

driverkt
Copy link
Member

@driverkt driverkt commented Jul 1, 2022

JDK-8170762 - update Javadoc to indicate ISO10126Padding pads with random bytes, though the spec does not require random bytes


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-8170762: Document that ISO10126Padding pads with random bytes

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9350

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 1, 2022

👋 Welcome back driverkt! 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 Jul 1, 2022
@openjdk
Copy link

openjdk bot commented Jul 1, 2022

@driverkt 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 Jul 1, 2022
@driverkt
Copy link
Member Author

driverkt commented Jul 1, 2022

/issue add 8170762

@openjdk openjdk bot changed the title JDK-8170762 - update Javadoc to indicate ISO10126Padding pads with random bytes 8170762: Remove randomness from ISO10126Padding Jul 1, 2022
@openjdk
Copy link

openjdk bot commented Jul 1, 2022

@driverkt This issue is referenced in the PR title - it will now be updated.

@mlbridge
Copy link

mlbridge bot commented Jul 1, 2022

Webrevs

@wangweij
Copy link
Contributor

wangweij commented Jul 1, 2022

Bug reporter says "document it in the SunJCE documentation". I am not sure what "SunJCE documentation" is, but the file updated here is an internal class and not a part of any documentation. The best suggestion I can make is adding a footnote to the padding name in Table 4-16 in https://docs.oracle.com/en/java/javase/18/security/oracle-providers.html.

@wangweij
Copy link
Contributor

wangweij commented Jul 1, 2022

Also, the bug title does not match code change. Randomness is not removed, it's documented.

@driverkt
Copy link
Member Author

driverkt commented Jul 1, 2022

@wangweij - thanks for clarifying! I was wondering about both of these items.

Maybe you can point me in the right direction for updating the documentation link you provided? Is it available in the open?

WRT the bug, should I just change the title of the bug, or what do you suggest?

@driverkt
Copy link
Member Author

driverkt commented Jul 1, 2022

/issue add 8170762

@openjdk openjdk bot changed the title 8170762: Remove randomness from ISO10126Padding 8170762: Document that ISO10126Padding pads with random bytes Jul 1, 2022
@openjdk
Copy link

openjdk bot commented Jul 1, 2022

@driverkt This issue is referenced in the PR title - it will now be updated.

Copy link
Contributor

@wangweij wangweij left a comment

Choose a reason for hiding this comment

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

Approved. File another docs bug to update the doc.

@openjdk
Copy link

openjdk bot commented Jul 1, 2022

@driverkt 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:

8170762: Document that ISO10126Padding pads with random bytes

Reviewed-by: weijun

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 1 new commit pushed to the master branch:

  • e291a67: 8289584: (fs) Print size values in java/nio/file/FileStore/Basic.java when they differ by > 1GiB

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@wangweij) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 1, 2022
@driverkt
Copy link
Member Author

driverkt commented Jul 1, 2022

Filed: https://bugs.openjdk.org/browse/JDK-8289602

Approved. File another docs bug to update the doc.

@driverkt
Copy link
Member Author

driverkt commented Jul 1, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 1, 2022
@openjdk
Copy link

openjdk bot commented Jul 1, 2022

@driverkt
Your change (at version be4f321) is now ready to be sponsored by a Committer.

@wangweij
Copy link
Contributor

wangweij commented Jul 1, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 1, 2022

Going to push as commit 2dd00f5.
Since your change was applied there has been 1 commit pushed to the master branch:

  • e291a67: 8289584: (fs) Print size values in java/nio/file/FileStore/Basic.java when they differ by > 1GiB

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 1, 2022
@openjdk openjdk bot closed this Jul 1, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Jul 1, 2022
@openjdk
Copy link

openjdk bot commented Jul 1, 2022

@wangweij @driverkt Pushed as commit 2dd00f5.

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

@driverkt driverkt deleted the JDK-8170762 branch July 1, 2022 21:34
@bradfordwetmore
Copy link
Contributor

bradfordwetmore commented Jul 1, 2022

Just a comment, I believe both approaches are ok. The ISO 10126 spec says:

When padding with octets...the first subfield (pad fill) shall consist
of 0 to 7 octets with arbitrary contents.

Adam's original comment was that because the spec says "arbitrary data," we could potentially just optimize the code a small bit by not having to fill with random data, and rather just leave as an uninitialized field. But using random data to get some arbitrary data it is possibly a little safer since it will perturb the output a little vs. using an all zero padding.

So, fine to leave has been fixed. However, I do have further comments on the doc bug.

@driverkt
Copy link
Member Author

driverkt commented Jul 5, 2022

Yes, @bradfordwetmore. Agreed. Both approaches are valid; hence just taking the "document the choice" approach.

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