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

Unexpected IAE from RC5ParameterSpec(int,int,int,byte[])

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: security-libs
    • Labels:

      Description



      Name: mtR10145 Date: 11/28/2003

      Constructor RC5ParameterSpec(int,int,int,byte[]) throws
      unexpected IAE like test code below illustrates. This exception is
      unspecified since the spec states only "Throws: IllegalArgumentException - if iv is null."
      =================== Test20.java ======================
      import javax.crypto.spec.*;

      public class Test20 {

          public static void main(String args[]) {

              String testString = new String("testStringToBeConvertedIntoBytes");

              RC5ParameterSpec rs = null;

              try {
                  rs = new RC5ParameterSpec(1, 1, 32, testString.substring(0, 6).getBytes());
                  System.out.println("No exceptions thrown");
              } catch(IllegalArgumentException ex) {
                  System.out.println("IAE: " + ex);
              }
          }
      }
      ============== Test output with J2SE 1.5.0-beta-b29 ====
      IAE: java.lang.IllegalArgumentException: IV too short
      ======================================================================

      Name: mtR10145 Date: 12/01/2003

      Constructor RC5ParameterSpec(int, int, int, byte[],int)
      is affected by this bug too. To reproduce simply use the following string:

          rs = new RC5ParameterSpec(1, 1, 32, testString.substring(0, 6).getBytes(), 0);

      in test code below instead of existent one.


      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cmssunw Cms Cms (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: