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

CRYPTO_MECHANISM_PARAM_INVALID occurs if GCM mode parameter which is used as an IV is set to all zeros

    Details

      Description

      Test case:
      com/oracle/security/ucrypto/TestCICOWithGCMAndAAD.java
      com/oracle/security/ucrypto/TestGCMKeyAndIvCheck.java

      Exception:
      com.oracle.security.ucrypto.UcryptoException: CRYPTO_MECHANISM_PARAM_INVALID
      at com.oracle.security.ucrypto.NativeCipher.nativeInit(Native Method)
      at com.oracle.security.ucrypto.NativeGCMCipher.init(NativeGCMCipher.java:139)
      at com.oracle.security.ucrypto.NativeGCMCipher.engineInit(NativeGCMCipher.java:214)
      at javax.crypto.Cipher.init(Cipher.java:1394)
      at javax.crypto.Cipher.init(Cipher.java:1327)
      at TestCICOWithGCMAndAAD.doTest(TestCICOWithGCMAndAAD.java:50)

      Description:
      Solaris disallows the all-zero IV for GCM mode, when the GCM mode parameter which is used as the initialization vector ("IV") is set to all zeros.

      Code Sample:
              GCMParameterSpec spec = new GCMParameterSpec(128, new byte[16]);
              Cipher encCipher = Cipher.getInstance("AES/GCM/NoPadding", p);
              encCipher.init(Cipher.ENCRYPT_MODE, key, spec);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bgopularam Bhanu Prakash Gopularam (Inactive)
                Reporter:
                ssahoo Sibabrata Sahoo
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: