SunJCE DES/DESede SecretKeyFactory.generateSecret throws InvalidKeySpecExc if passed SecretKeySpec

XMLWordPrintable

    • b100
    • sparc
    • solaris_10
    • Verified

      If a SecretKeySpec with a byte array and the algorithm string "TripleDES" (or "DESede")
      is passed to SecretKeyFactory.getInstance("TripleDES").generateSecret(), it throws
      InvalidKeySpecException("Inappropriate key specification").

      This problem also occurs for the DES algorithm. It is only a problem with the SunJCE
      provider. The SunPKCS11 provider works fine.

      The problem appears to be that the DES/DESede implementation of
      the SecretKeyFactorySpi.engineGenerateSecret(KeySpec) method
      is only looking for an instanceof DESKeySpec or DESedeKeySpec. It should also allow
      SecretKeySpec with an appropriate algorithm and key size.

            Assignee:
            Anthony Scarpino
            Reporter:
            Sean Mullan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: