Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8158534

DrbgParameters strength parameter is underspecified if < -1

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: security-libs
    • Labels:

      Description

      From looking at the code, it looks like the implementation treats any value for the strength parameter that is < 0 as a default strength.

      In that case, I think the API should be updated to specify that. In fact, it is currently underspecified since it does not say how values < -1 are handled. However, it may be more reasonable to throw IllegalArgumentException if the strength parameter is < -1.

      This affects the instantiation and nextBytes methods which both take a strength parameter.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                weijun Weijun Wang
                Reporter:
                mullan Sean Mullan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: