diff options
author | 2018-03-29 19:02:24 -0500 | |
---|---|---|
committer | 2018-03-29 19:02:44 -0500 | |
commit | d86dd644e1543743cfcbc83b230bd4f2cb2e5d4e (patch) | |
tree | 698e12f7c0142441cd494cd68da03437e510d0b0 /auth/auth-certman/src | |
parent | 17ca744723bd652f15d59d6c8555824f6e49018d (diff) |
Clean up Sonar results 1
Issue-ID: AAF-206
Change-Id: If1fced5b528490a52691508fb1e30962dbe28856
Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-certman/src')
3 files changed, 6 insertions, 4 deletions
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java index 521c5016..00b0b378 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java @@ -115,8 +115,10 @@ public abstract class CA { bytes = new byte[(int)crt.length()]; FileInputStream fis = new FileInputStream(crt); try { - fis.read(bytes); - addTrustedCA(new String(bytes)); + int read = fis.read(bytes); + if(read>0) { + addTrustedCA(new String(bytes)); + } } finally { fis.close(); } diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java index ae4e21aa..0d494acd 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java @@ -61,7 +61,7 @@ public class JscepCA extends CA { private final static String MS_PROFILE="1"; private final static int MAX_RETRY=3; - public static final long INVALIDATE_TIME = 1000*60*10; // 10 mins + public static final long INVALIDATE_TIME = 1000*60*10L; // 10 mins // package on purpose private Map<String,X509ChainWithIssuer> mxcwi_s; diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java index f6407d90..4ef5472a 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java @@ -643,7 +643,7 @@ public class CMService { || trans.user().equals(sponsor)) { return artiDAO.delete(trans, add, false); } - return null; + return Result.err(Result.ERR_Denied, "%1 is not allowed to delete this item",trans.user()); } public Result<Void> deleteArtifact(AuthzTrans trans, List<ArtiDAO.Data> list) { |