diff options
author | asaha <none@none> | 2014-10-14 10:22:21 -0700 |
---|---|---|
committer | asaha <none@none> | 2014-10-14 10:22:21 -0700 |
commit | 029db103b143b686c36a67a8b8ea26b11003f7e2 (patch) | |
tree | a707b566edd7ba426529517aeea6731f30a99c3f /src/share/classes/javax | |
parent | f3c973fe7e671640bce9d67dec8793c6d1469525 (diff) | |
parent | 27f6a441fde4396f09f0afba9b352ae042e26b46 (diff) |
Mergejdk8u40-b10
Diffstat (limited to 'src/share/classes/javax')
-rw-r--r-- | src/share/classes/javax/crypto/Cipher.java | 46 | ||||
-rw-r--r-- | src/share/classes/javax/crypto/KeyAgreement.java | 17 | ||||
-rw-r--r-- | src/share/classes/javax/crypto/KeyGenerator.java | 18 | ||||
-rw-r--r-- | src/share/classes/javax/crypto/Mac.java | 17 |
4 files changed, 94 insertions, 4 deletions
diff --git a/src/share/classes/javax/crypto/Cipher.java b/src/share/classes/javax/crypto/Cipher.java index ffcc7cf32..959354024 100644 --- a/src/share/classes/javax/crypto/Cipher.java +++ b/src/share/classes/javax/crypto/Cipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -167,6 +167,11 @@ public class Cipher { private static final Debug debug = Debug.getInstance("jca", "Cipher"); + private static final Debug pdebug = + Debug.getInstance("provider", "Provider"); + private static final boolean skipDebug = + Debug.isOn("engine=") && !Debug.isOn("cipher"); + /** * Constant used to initialize cipher to encryption mode. */ @@ -1110,6 +1115,21 @@ public class Cipher { } } + private static String getOpmodeString(int opmode) { + switch (opmode) { + case ENCRYPT_MODE: + return "encryption"; + case DECRYPT_MODE: + return "decryption"; + case WRAP_MODE: + return "key wrapping"; + case UNWRAP_MODE: + return "key unwrapping"; + default: + return ""; + } + } + /** * Initializes this cipher with a key. * @@ -1235,6 +1255,12 @@ public class Cipher { initialized = true; this.opmode = opmode; + + if (!skipDebug && pdebug != null) { + pdebug.println("Cipher." + transformation + " " + + getOpmodeString(opmode) + " algorithm from: " + + this.provider.getName()); + } } /** @@ -1372,6 +1398,12 @@ public class Cipher { initialized = true; this.opmode = opmode; + + if (!skipDebug && pdebug != null) { + pdebug.println("Cipher." + transformation + " " + + getOpmodeString(opmode) + " algorithm from: " + + this.provider.getName()); + } } /** @@ -1509,6 +1541,12 @@ public class Cipher { initialized = true; this.opmode = opmode; + + if (!skipDebug && pdebug != null) { + pdebug.println("Cipher." + transformation + " " + + getOpmodeString(opmode) + " algorithm from: " + + this.provider.getName()); + } } /** @@ -1693,6 +1731,12 @@ public class Cipher { initialized = true; this.opmode = opmode; + + if (!skipDebug && pdebug != null) { + pdebug.println("Cipher." + transformation + " " + + getOpmodeString(opmode) + " algorithm from: " + + this.provider.getName()); + } } /** diff --git a/src/share/classes/javax/crypto/KeyAgreement.java b/src/share/classes/javax/crypto/KeyAgreement.java index 70221aa0c..2c2447030 100644 --- a/src/share/classes/javax/crypto/KeyAgreement.java +++ b/src/share/classes/javax/crypto/KeyAgreement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,6 +78,11 @@ public class KeyAgreement { private static final Debug debug = Debug.getInstance("jca", "KeyAgreement"); + private static final Debug pdebug = + Debug.getInstance("provider", "Provider"); + private static final boolean skipDebug = + Debug.isOn("engine=") && !Debug.isOn("keyagreement"); + // The provider private Provider provider; @@ -468,6 +473,11 @@ public class KeyAgreement { throw new InvalidKeyException(e); } } + + if (!skipDebug && pdebug != null) { + pdebug.println("KeyAgreement." + algorithm + " algorithm from: " + + this.provider.getName()); + } } /** @@ -524,6 +534,11 @@ public class KeyAgreement { } else { chooseProvider(I_PARAMS, key, params, random); } + + if (!skipDebug && pdebug != null) { + pdebug.println("KeyAgreement." + algorithm + " algorithm from: " + + this.provider.getName()); + } } /** diff --git a/src/share/classes/javax/crypto/KeyGenerator.java b/src/share/classes/javax/crypto/KeyGenerator.java index 030207eab..9da64e967 100644 --- a/src/share/classes/javax/crypto/KeyGenerator.java +++ b/src/share/classes/javax/crypto/KeyGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import java.security.spec.*; import sun.security.jca.*; import sun.security.jca.GetInstance.Instance; +import sun.security.util.Debug; /** * This class provides the functionality of a secret (symmetric) key generator. @@ -108,6 +109,11 @@ import sun.security.jca.GetInstance.Instance; public class KeyGenerator { + private static final Debug pdebug = + Debug.getInstance("provider", "Provider"); + private static final boolean skipDebug = + Debug.isOn("engine=") && !Debug.isOn("keygenerator"); + // see java.security.KeyPairGenerator for failover notes private final static int I_NONE = 1; @@ -145,6 +151,11 @@ public class KeyGenerator { this.spi = keyGenSpi; this.provider = provider; this.algorithm = algorithm; + + if (!skipDebug && pdebug != null) { + pdebug.println("KeyGenerator." + algorithm + " algorithm from: " + + this.provider.getName()); + } } private KeyGenerator(String algorithm) throws NoSuchAlgorithmException { @@ -158,6 +169,11 @@ public class KeyGenerator { throw new NoSuchAlgorithmException (algorithm + " KeyGenerator not available"); } + + if (!skipDebug && pdebug != null) { + pdebug.println("KeyGenerator." + algorithm + " algorithm from: " + + this.provider.getName()); + } } /** diff --git a/src/share/classes/javax/crypto/Mac.java b/src/share/classes/javax/crypto/Mac.java index d0e241dc8..8a497daa8 100644 --- a/src/share/classes/javax/crypto/Mac.java +++ b/src/share/classes/javax/crypto/Mac.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,6 +77,11 @@ public class Mac implements Cloneable { private static final Debug debug = Debug.getInstance("jca", "Mac"); + private static final Debug pdebug = + Debug.getInstance("provider", "Provider"); + private static final boolean skipDebug = + Debug.isOn("engine=") && !Debug.isOn("mac"); + // The provider private Provider provider; @@ -413,6 +418,11 @@ public class Mac implements Cloneable { throw new InvalidKeyException("init() failed", e); } initialized = true; + + if (!skipDebug && pdebug != null) { + pdebug.println("Mac." + algorithm + " algorithm from: " + + this.provider.getName()); + } } /** @@ -435,6 +445,11 @@ public class Mac implements Cloneable { chooseProvider(key, params); } initialized = true; + + if (!skipDebug && pdebug != null) { + pdebug.println("Mac." + algorithm + " algorithm from: " + + this.provider.getName()); + } } /** |