< prev index next >

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

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2003, 2022, 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
--- 1,7 ---
  /*
!  * 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 ***
      static boolean isAvailable() {
          return INSTANCE != null;
      }
  
      // constructor, called by the JCA framework
!     public NativePRNG() {
-         super();
          if (INSTANCE == null) {
              throw new AssertionError("NativePRNG not available");
          }
      }
  
      // set the seed
      @Override
      protected void engineSetSeed(byte[] seed) {
--- 201,17 ---
      static boolean isAvailable() {
          return INSTANCE != null;
      }
  
      // constructor, called by the JCA framework
!     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 ***
          static boolean isAvailable() {
              return INSTANCE != null;
          }
  
          // constructor, called by the JCA framework
!         public Blocking() {
-             super();
              if (INSTANCE == null) {
                  throw new AssertionError("NativePRNG$Blocking not available");
              }
          }
  
          // set the seed
          @Override
          protected void engineSetSeed(byte[] seed) {
--- 251,17 ---
          static boolean isAvailable() {
              return INSTANCE != null;
          }
  
          // constructor, called by the JCA framework
!         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 ***
          static boolean isAvailable() {
              return INSTANCE != null;
          }
  
          // constructor, called by the JCA framework
!         public NonBlocking() {
-             super();
              if (INSTANCE == null) {
                  throw new AssertionError(
                      "NativePRNG$NonBlocking not available");
              }
          }
  
          // set the seed
          @Override
          protected void engineSetSeed(byte[] seed) {
--- 302,18 ---
          static boolean isAvailable() {
              return INSTANCE != null;
          }
  
          // constructor, called by the JCA framework
!         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 >