< prev index next >

src/java.base/unix/classes/sun/security/provider/NativePRNG.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

@@ -201,15 +201,17 @@
      static boolean isAvailable() {
          return INSTANCE != null;
      }
  
      // constructor, called by the JCA framework
-     public NativePRNG() {
-         super();
+     public NativePRNG(SecureRandomParameters params) {
          if (INSTANCE == null) {
              throw new AssertionError("NativePRNG not available");
          }
+         if (params != null) {
+             throw new IllegalArgumentException("Unsupported params: " + params.getClass());
+         }
      }
  
      // set the seed
      @Override
      protected void engineSetSeed(byte[] seed) {

@@ -249,15 +251,17 @@
          static boolean isAvailable() {
              return INSTANCE != null;
          }
  
          // constructor, called by the JCA framework
-         public Blocking() {
-             super();
+         public Blocking(SecureRandomParameters params) {
              if (INSTANCE == null) {
                  throw new AssertionError("NativePRNG$Blocking not available");
              }
+             if (params != null) {
+                 throw new IllegalArgumentException("Unsupported params: " + params.getClass());
+             }
          }
  
          // set the seed
          @Override
          protected void engineSetSeed(byte[] seed) {

@@ -298,16 +302,18 @@
          static boolean isAvailable() {
              return INSTANCE != null;
          }
  
          // constructor, called by the JCA framework
-         public NonBlocking() {
-             super();
+         public NonBlocking(SecureRandomParameters params) {
              if (INSTANCE == null) {
                  throw new AssertionError(
                      "NativePRNG$NonBlocking not available");
              }
+             if (params != null) {
+                 throw new IllegalArgumentException("Unsupported params: " + params.getClass());
+             }
          }
  
          // set the seed
          @Override
          protected void engineSetSeed(byte[] seed) {
< prev index next >