directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: More PMD work
Date Thu, 23 Apr 2015 09:28:32 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master d696cd1a5 -> bcd790909


More PMD work


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/bcd79090
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/bcd79090
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/bcd79090

Branch: refs/heads/master
Commit: bcd790909337d5ab193f886ad96dc1088924e248
Parents: d696cd1
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Apr 23 10:26:12 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Apr 23 10:26:25 2015 +0100

----------------------------------------------------------------------
 .../kerb/crypto/CheckSumTypeHandler.java        | 28 +++++++++---------
 .../kerberos/kerb/crypto/CryptoTypeHandler.java |  8 ++---
 .../kerberos/kerb/crypto/EncTypeHandler.java    | 31 ++++++++++----------
 .../kerberos/kerb/crypto/EncryptionHandler.java |  2 +-
 .../crypto/cksum/ConfounderedDesCheckSum.java   |  2 +-
 .../kerb/crypto/cksum/HashProvider.java         | 10 +++----
 .../kerb/crypto/enc/Aes128CtsHmacSha1Enc.java   |  4 ---
 .../kerb/crypto/enc/Aes256CtsHmacSha1Enc.java   |  3 --
 .../kerb/crypto/enc/Camellia128CtsCmacEnc.java  |  5 ----
 .../kerb/crypto/enc/Camellia256CtsCmacEnc.java  |  5 ----
 .../kerb/crypto/enc/Des3CbcSha1Enc.java         |  4 ---
 .../kerb/crypto/enc/EncryptProvider.java        | 18 ++++++------
 .../kerberos/kerb/crypto/enc/KeKiCmacEnc.java   |  7 ++---
 .../kerb/crypto/enc/KeKiHmacSha1Enc.java        |  2 --
 .../kerb/crypto/enc/provider/DesProvider.java   |  2 +-
 .../kerberos/kerb/crypto/key/DesKeyMaker.java   |  1 +
 .../kerberos/kerb/crypto/key/KeyMaker.java      |  4 +--
 .../kerb/crypto/random/RandomProvider.java      |  8 ++---
 .../kerberos/kerb/crypto/util/BytesUtil.java    |  1 +
 .../kerberos/kerb/crypto/util/Camellia.java     |  2 +-
 .../kerberos/kerb/crypto/util/CamelliaKey.java  |  1 +
 .../kerby/kerberos/kerb/crypto/util/Cmac.java   |  1 +
 .../kerby/kerberos/kerb/crypto/util/Md4.java    |  1 +
 .../kerby/kerberos/kerb/crypto/util/Nfold.java  |  1 +
 24 files changed, 65 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumTypeHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumTypeHandler.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumTypeHandler.java
index b827bee..5339a21 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumTypeHandler.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumTypeHandler.java
@@ -24,34 +24,34 @@ import org.apache.kerby.kerberos.kerb.spec.base.CheckSumType;
 
 public interface CheckSumTypeHandler extends CryptoTypeHandler {
 
-    public int confounderSize();
+    int confounderSize();
 
-    public CheckSumType cksumType();
+    CheckSumType cksumType();
 
-    public int computeSize(); // allocation size for checksum computation
+    int computeSize(); // allocation size for checksum computation
 
-    public int outputSize(); // possibly truncated output size
+    int outputSize(); // possibly truncated output size
 
-    public boolean isSafe();
+    boolean isSafe();
 
-    public int cksumSize();
+    int cksumSize();
 
-    public int keySize();
+    int keySize();
 
-    public byte[] checksum(byte[] data) throws KrbException;
+    byte[] checksum(byte[] data) throws KrbException;
 
-    public byte[] checksum(byte[] data, int start, int len) throws KrbException;
+    byte[] checksum(byte[] data, int start, int len) throws KrbException;
 
-    public boolean verify(byte[] data, byte[] checksum) throws KrbException;
+    boolean verify(byte[] data, byte[] checksum) throws KrbException;
 
-    public boolean verify(byte[] data, int start, int len, byte[] checksum) throws KrbException;
+    boolean verify(byte[] data, int start, int len, byte[] checksum) throws KrbException;
 
-    public byte[] checksumWithKey(byte[] data,
+    byte[] checksumWithKey(byte[] data,
                                   byte[] key, int usage) throws KrbException;
 
-    public byte[] checksumWithKey(byte[] data, int start, int len,
+    byte[] checksumWithKey(byte[] data, int start, int len,
                                   byte[] key, int usage) throws KrbException;
 
-    public boolean verifyWithKey(byte[] data,
+    boolean verifyWithKey(byte[] data,
                                  byte[] key, int usage, byte[] checksum) throws KrbException;
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CryptoTypeHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CryptoTypeHandler.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CryptoTypeHandler.java
index 23c3097..b455b08 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CryptoTypeHandler.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/CryptoTypeHandler.java
@@ -24,11 +24,11 @@ import org.apache.kerby.kerberos.kerb.crypto.enc.EncryptProvider;
 
 public interface CryptoTypeHandler {
 
-    public String name();
+    String name();
 
-    public String displayName();
+    String displayName();
 
-    public EncryptProvider encProvider();
+    EncryptProvider encProvider();
 
-    public HashProvider hashProvider();
+    HashProvider hashProvider();
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncTypeHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncTypeHandler.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncTypeHandler.java
index ba5d8d5..f32a72f 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncTypeHandler.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncTypeHandler.java
@@ -21,43 +21,42 @@ package org.apache.kerby.kerberos.kerb.crypto;
 
 import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.spec.base.CheckSumType;
-import org.apache.kerby.kerberos.kerb.spec.base.EncryptionKey;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 
 public interface EncTypeHandler extends CryptoTypeHandler {
 
-    public EncryptionType eType();
+    EncryptionType eType();
 
-    public int keyInputSize();
+    int keyInputSize();
 
-    public int keySize();
+    int keySize();
 
-    public int confounderSize();
+    int confounderSize();
 
-    public int checksumSize();
+    int checksumSize();
 
-    public int prfSize();
+    int prfSize();
 
-    public byte[] prf(byte[] key, byte[] seed) throws KrbException;
+    byte[] prf(byte[] key, byte[] seed) throws KrbException;
 
-    public int paddingSize();
+    int paddingSize();
 
-    public byte[] str2key(String string,
+    byte[] str2key(String string,
                           String salt, byte[] param) throws KrbException;
 
-    public byte[] random2Key(byte[] randomBits) throws KrbException;
+    byte[] random2Key(byte[] randomBits) throws KrbException;
 
-    public CheckSumType checksumType();
+    CheckSumType checksumType();
 
-    public byte[] encrypt(byte[] data, byte[] key, int usage)
+    byte[] encrypt(byte[] data, byte[] key, int usage)
         throws KrbException;
 
-    public byte[] encrypt(byte[] data, byte[] key, byte[] ivec,
+    byte[] encrypt(byte[] data, byte[] key, byte[] ivec,
         int usage) throws KrbException;
 
-    public byte[] decrypt(byte[] cipher, byte[] key, int usage)
+    byte[] decrypt(byte[] cipher, byte[] key, int usage)
         throws KrbException;
 
-    public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec,
+    byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec,
         int usage) throws KrbException;
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
index 408ae0f..e6b8812 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
@@ -39,7 +39,7 @@ public class EncryptionHandler {
     static {
         try {
             isAES256Enabled = Cipher.getMaxAllowedKeyLength("AES") >= 256;
-        } catch (Exception e) {
+        } catch (Exception e) { //NOPMD
             // should not happen
         }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/ConfounderedDesCheckSum.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/ConfounderedDesCheckSum.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/ConfounderedDesCheckSum.java
index 5f6a3d6..7b61a39 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/ConfounderedDesCheckSum.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/ConfounderedDesCheckSum.java
@@ -96,7 +96,7 @@ public abstract class ConfounderedDesCheckSum extends AbstractKeyedCheckSumTypeH
     @Override
     public boolean verifyWithKey(byte[] data,byte[] key,
                                  int usage, byte[] checksum) throws KrbException {
-        int computeSize = computeSize();
+        // int computeSize = computeSize();
         int blockSize = encProvider().blockSize();
         int hashSize = hashProvider().hashSize();
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/HashProvider.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/HashProvider.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/HashProvider.java
index 1eb32db..5a5244b 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/HashProvider.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/cksum/HashProvider.java
@@ -31,10 +31,10 @@ import org.apache.kerby.kerberos.kerb.KrbException;
  */
 public interface HashProvider {
 
-    public int hashSize();
-    public int blockSize();
+    int hashSize();
+    int blockSize();
 
-    public void hash(byte[] data, int start, int size) throws KrbException;
-    public void hash(byte[] data) throws KrbException;
-    public byte[] output();
+    void hash(byte[] data, int start, int size) throws KrbException;
+    void hash(byte[] data) throws KrbException;
+    byte[] output();
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
index cc2a21f..ec6d15b 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
@@ -19,14 +19,10 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.enc;
 
-import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.crypto.cksum.provider.Sha1Provider;
 import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Aes128Provider;
 import org.apache.kerby.kerberos.kerb.crypto.enc.provider.AesProvider;
-import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Des3Provider;
 import org.apache.kerby.kerberos.kerb.crypto.key.AesKeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.key.Des3KeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.key.DkKeyMaker;
 import org.apache.kerby.kerberos.kerb.spec.base.CheckSumType;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
index 0a874ac..cc41273 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
@@ -19,13 +19,10 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.enc;
 
-import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.crypto.cksum.provider.Sha1Provider;
-import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Aes128Provider;
 import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Aes256Provider;
 import org.apache.kerby.kerberos.kerb.crypto.enc.provider.AesProvider;
 import org.apache.kerby.kerberos.kerb.crypto.key.AesKeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.key.DkKeyMaker;
 import org.apache.kerby.kerberos.kerb.spec.base.CheckSumType;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia128CtsCmacEnc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia128CtsCmacEnc.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia128CtsCmacEnc.java
index 62b326c..cf4003b 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia128CtsCmacEnc.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia128CtsCmacEnc.java
@@ -19,13 +19,8 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.enc;
 
-import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.crypto.EncryptionHandler;
 import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Camellia128Provider;
-import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Camellia256Provider;
 import org.apache.kerby.kerberos.kerb.crypto.key.CamelliaKeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.key.DkKeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.util.Cmac;
 import org.apache.kerby.kerberos.kerb.spec.base.CheckSumType;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia256CtsCmacEnc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia256CtsCmacEnc.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia256CtsCmacEnc.java
index b23d7e0..1352d6c 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia256CtsCmacEnc.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Camellia256CtsCmacEnc.java
@@ -19,13 +19,8 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.enc;
 
-import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.crypto.EncryptionHandler;
-import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Camellia128Provider;
 import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Camellia256Provider;
 import org.apache.kerby.kerberos.kerb.crypto.key.CamelliaKeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.key.DkKeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.util.Cmac;
 import org.apache.kerby.kerberos.kerb.spec.base.CheckSumType;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Des3CbcSha1Enc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Des3CbcSha1Enc.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Des3CbcSha1Enc.java
index 49ea170..371e714 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Des3CbcSha1Enc.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/Des3CbcSha1Enc.java
@@ -19,13 +19,9 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.enc;
 
-import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.crypto.cksum.provider.Sha1Provider;
-import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Aes128Provider;
 import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Des3Provider;
-import org.apache.kerby.kerberos.kerb.crypto.key.AesKeyMaker;
 import org.apache.kerby.kerberos.kerb.crypto.key.Des3KeyMaker;
-import org.apache.kerby.kerberos.kerb.crypto.key.DkKeyMaker;
 import org.apache.kerby.kerberos.kerb.spec.base.CheckSumType;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/EncryptProvider.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/EncryptProvider.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/EncryptProvider.java
index 87960f4..c6beb73 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/EncryptProvider.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/EncryptProvider.java
@@ -31,15 +31,15 @@ import org.apache.kerby.kerberos.kerb.KrbException;
  */
 public interface EncryptProvider {
 
-    public int keyInputSize(); //input size to make key
-    public int keySize(); //output key size
-    public int blockSize(); //crypto block size
+    int keyInputSize(); //input size to make key
+    int keySize(); //output key size
+    int blockSize(); //crypto block size
 
-    public void encrypt(byte[] key, byte[] cipherState, byte[] data) throws KrbException;
-    public void decrypt(byte[] key, byte[] cipherState, byte[] data) throws KrbException;
-    public void encrypt(byte[] key, byte[] data) throws KrbException;
-    public void decrypt(byte[] key, byte[] data) throws KrbException;
-    public byte[] cbcMac(byte[] key, byte[] iv, byte[] data) throws KrbException;
-    public boolean supportCbcMac();
+    void encrypt(byte[] key, byte[] cipherState, byte[] data) throws KrbException;
+    void decrypt(byte[] key, byte[] cipherState, byte[] data) throws KrbException;
+    void encrypt(byte[] key, byte[] data) throws KrbException;
+    void decrypt(byte[] key, byte[] data) throws KrbException;
+    byte[] cbcMac(byte[] key, byte[] iv, byte[] data) throws KrbException;
+    boolean supportCbcMac();
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiCmacEnc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiCmacEnc.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiCmacEnc.java
index d652831..ad0e873 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiCmacEnc.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiCmacEnc.java
@@ -19,20 +19,17 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.enc;
 
-import org.apache.kerby.kerberos.kerb.crypto.EncTypeHandler;
 import org.apache.kerby.kerberos.kerb.crypto.EncryptionHandler;
-import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Camellia128Provider;
-import org.apache.kerby.kerberos.kerb.crypto.key.CamelliaKeyMaker;
 import org.apache.kerby.kerberos.kerb.crypto.key.DkKeyMaker;
 import org.apache.kerby.kerberos.kerb.crypto.util.Cmac;
 import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.spec.base.EncryptionKey;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 
 public abstract class KeKiCmacEnc extends KeKiEnc {
 
-    private EncryptionType eType;
     private DkKeyMaker km;
+    private EncryptionType eType; //NOPMD
+    
     public KeKiCmacEnc(EncryptProvider encProvider,
                        EncryptionType eType, DkKeyMaker km) {
         super(encProvider, null);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiHmacSha1Enc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiHmacSha1Enc.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiHmacSha1Enc.java
index 3df7959..2c0f069 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiHmacSha1Enc.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/KeKiHmacSha1Enc.java
@@ -19,8 +19,6 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.enc;
 
-import org.apache.kerby.kerberos.kerb.crypto.enc.provider.Aes128Provider;
-import org.apache.kerby.kerberos.kerb.crypto.key.AesKeyMaker;
 import org.apache.kerby.kerberos.kerb.crypto.key.DkKeyMaker;
 import org.apache.kerby.kerberos.kerb.crypto.util.Hmac;
 import org.apache.kerby.kerberos.kerb.crypto.cksum.HashProvider;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/provider/DesProvider.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/provider/DesProvider.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/provider/DesProvider.java
index 75a1cde..223810d 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/provider/DesProvider.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/enc/provider/DesProvider.java
@@ -72,7 +72,7 @@ public class DesProvider extends AbstractEncryptProvider {
             cipher.init(Cipher.ENCRYPT_MODE, skSpec, params);
             for (int i = 0; i < data.length / 8; i++) {
                 output = cipher.doFinal(data, i * 8, 8);
-                cipher.init(Cipher.ENCRYPT_MODE, skSpec, (new IvParameterSpec(output)));
+                cipher.init(Cipher.ENCRYPT_MODE, skSpec, new IvParameterSpec(output));
             }
         }
         catch (GeneralSecurityException e) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/DesKeyMaker.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/DesKeyMaker.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/DesKeyMaker.java
index edc5b9c..8ae57d4 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/DesKeyMaker.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/DesKeyMaker.java
@@ -24,6 +24,7 @@ import org.apache.kerby.kerberos.kerb.crypto.util.BytesUtil;
 import org.apache.kerby.kerberos.kerb.crypto.util.Des;
 import org.apache.kerby.kerberos.kerb.crypto.enc.EncryptProvider;
 
+@SuppressWarnings("PMD")
 public class DesKeyMaker extends AbstractKeyMaker {
 
     public DesKeyMaker(EncryptProvider encProvider) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/KeyMaker.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/KeyMaker.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/KeyMaker.java
index 8538c14..a9c4369 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/KeyMaker.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/key/KeyMaker.java
@@ -23,7 +23,7 @@ import org.apache.kerby.kerberos.kerb.KrbException;
 
 public interface KeyMaker {
 
-    public byte[] str2key(String string, String salt, byte[] param) throws KrbException;
+    byte[] str2key(String string, String salt, byte[] param) throws KrbException;
 
-    public byte[] random2Key(byte[] randomBits) throws KrbException;
+    byte[] random2Key(byte[] randomBits) throws KrbException;
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/random/RandomProvider.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/random/RandomProvider.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/random/RandomProvider.java
index 08109d0..7d6b831 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/random/RandomProvider.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/random/RandomProvider.java
@@ -28,21 +28,21 @@ public interface RandomProvider {
     /**
      * To init.
      */
-    public void init();
+    void init();
     /**
      * Provide entropy seed for the provider.
      * @param seed
      */
-    public void setSeed(byte[] seed);
+    void setSeed(byte[] seed);
 
     /**
      * Generate random bytes into the specified array.
      * @param bytes
      */
-    public void nextBytes(byte[] bytes);
+    void nextBytes(byte[] bytes);
 
     /**
      * To clean up.
      */
-    public void destroy();
+    void destroy();
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/BytesUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/BytesUtil.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/BytesUtil.java
index c85d8c5..14ef9bb 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/BytesUtil.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/BytesUtil.java
@@ -19,6 +19,7 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto.util;
 
+@SuppressWarnings("PMD")
 public class BytesUtil {
 
     public static short bytes2short(byte[] bytes, int offset, boolean bigEndian) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Camellia.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Camellia.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Camellia.java
index 3e96c53..82f0677 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Camellia.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Camellia.java
@@ -24,7 +24,7 @@ package org.apache.kerby.kerberos.kerb.crypto.util;
  *
  * This is based on CamelliaEngine.java from bouncycastle library.
  */
-
+@SuppressWarnings("PMD")
 public class Camellia {
     private static final int BLOCK_SIZE = 16;
     private int[] state = new int[4]; // for encryption and decryption

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/CamelliaKey.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/CamelliaKey.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/CamelliaKey.java
index 3a640a8..a648e51 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/CamelliaKey.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/CamelliaKey.java
@@ -25,6 +25,7 @@ package org.apache.kerby.kerberos.kerb.crypto.util;
  * This is based on CamelliaEngine.java from bouncycastle library.
  */
 
+@SuppressWarnings("PMD")
 public class CamelliaKey {
     private int keySize;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Cmac.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Cmac.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Cmac.java
index 36397f1..290c63c 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Cmac.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Cmac.java
@@ -27,6 +27,7 @@ import java.util.Arrays;
 /**
  * Based on MIT krb5 cmac.c
  */
+@SuppressWarnings("PMD")
 public class Cmac {
 
     private static byte[] constRb = {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Md4.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Md4.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Md4.java
index c5a4a2a..5394697 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Md4.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Md4.java
@@ -38,6 +38,7 @@ import java.security.MessageDigest;
 /**
  * Copied from Mina project and modified a bit
  */
+@SuppressWarnings("PMD")
 public class Md4 extends MessageDigest {
 
     /**

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bcd79090/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Nfold.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Nfold.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Nfold.java
index 82c9aac..9f878bf 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Nfold.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/util/Nfold.java
@@ -33,6 +33,7 @@ import java.util.Arrays;
  * compute the 1's complement sum:
  * n-fold = s[0..n-1]+s[n..2n-1]+s[2n..3n-1]+..+s[(k-1)*n..k*n-1]
  */
+@SuppressWarnings("PMD")
 public class Nfold {
 
     /**


Mime
View raw message