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

KeyGenerator.init() methods do not throw IllegalArgumentException for keysize == 0

    XMLWordPrintable

Details

    • b09
    • x86
    • linux
    • Verified

    Description

      KeyGenerators for HMACMD5 and HMACSHA1 will accept a keylength of 0
      without throwing an IllegalArgumentException. See the attached example
      to reproduce.

      % uname -a
      Linux dickdale 2.6.5-7.108-default #1 Wed Aug 25 13:34:40 UTC 2004 i686 i686 i386 GNU/Linux
      % env PATH=/java/re/jdk/1.5.0/promoted/latest/binaries/linux-i586/bin:$PATH java KGInit
      trying KeyGenerator.init( int )
      FAILED - KeyGenerator.init( 0 ) doesn't throw InvalidParameterException
      trying KeyGenerator.init( int, SecureRandom )
      FAILED - KeyGenerator.init( 0, new SecureRandom() ) doesn't throw InvalidParameterException
      [Exit 1 ]
      %

      ###@###.### 2005-2-09 23:33:52 GMT

      Attachments

        Issue Links

          Activity

            People

              kdriver Kevin Driver
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: