summaryrefslogtreecommitdiffstats
path: root/cadi/core
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-03-29 19:02:24 -0500
committerInstrumental <jcgmisc@stl.gathman.org>2018-03-29 19:02:44 -0500
commitd86dd644e1543743cfcbc83b230bd4f2cb2e5d4e (patch)
tree698e12f7c0142441cd494cd68da03437e510d0b0 /cadi/core
parent17ca744723bd652f15d59d6c8555824f6e49018d (diff)
Clean up Sonar results 1
Issue-ID: AAF-206 Change-Id: If1fced5b528490a52691508fb1e30962dbe28856 Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'cadi/core')
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java
index 095f6e97..65cb81a5 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java
@@ -71,6 +71,7 @@ import org.onap.aaf.cadi.config.Config;
public class Symm {
private static final byte[] DOUBLE_EQ = new byte[] {'=','='};
public static final String ENC = "enc:";
+ private static final Object LOCK = new Object();
private static final SecureRandom random = new SecureRandom();
public final char[] codeset;
@@ -207,7 +208,7 @@ public class Symm {
}
public <T> T exec(SyncExec<T> exec) throws Exception {
- synchronized(ENC) {
+ synchronized(LOCK) {
if(keyBytes == null) {
keyBytes = new byte[AES.AES_KEY_SIZE/8];
int offset = (Math.abs(codeset[0])+47)%(codeset.length-keyBytes.length);
@@ -388,7 +389,9 @@ public class Symm {
}
public void decode(InputStream is, OutputStream os, int skip) throws IOException {
- is.skip(skip);
+ if(is.skip(skip)!=skip) {
+ throw new IOException("Error skipping on IOStream in Symm");
+ }
decode(is,os);
}