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

Unspecified behavior in IvParameterSpec constructors

XMLWordPrintable

    • b44
    • generic
    • generic



      Name: bkR10012 Date: 03/02/2004


      The description of the constructor
      javax.crypto.spec.IvParameterSpec.IvParameterSpec(byte[] iv,
                                                        int offset,
                                                        int len)
      says:
      "The bytes that constitute the IV are those between iv[offset] and
      iv[offset+len-1] inclusive.
      ...
      Throws:
      IllegalArgumentException - if iv is null or (iv.length - offset < len)"

      But the spec. does not describe constructor behavior if (offset + len <= 0).

      Also, the spec. describes the different behavior for
      IvParameterSpec(byte[] iv) and IvParameterSpec(byte[] iv,int offset,int len)
      if iv is null:
      NullPointerException for IvParameterSpec(byte[] iv)
      and IllegalArgumentException for IvParameterSpec(byte[] iv,int offset,int len).

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

            valeriep Valerie Peng
            kuzsunw Kuz Kuz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: