summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/java-tools/src/com/netscape/cmstools/AuditVerify.java3
-rw-r--r--base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java4
-rwxr-xr-xbase/util/src/netscape/security/x509/CRLExtensions.java13
-rw-r--r--base/util/src/netscape/security/x509/EDIPartyName.java5
4 files changed, 14 insertions, 11 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/AuditVerify.java b/base/java-tools/src/com/netscape/cmstools/AuditVerify.java
index fb92cf12c..82323ab09 100644
--- a/base/java-tools/src/com/netscape/cmstools/AuditVerify.java
+++ b/base/java-tools/src/com/netscape/cmstools/AuditVerify.java
@@ -164,6 +164,7 @@ public class AuditVerify {
logFiles.addElement(((String) tok.nextElement()).trim());
}
}
+ r.close();
if (logFiles.size() == 0) {
System.out.println("Error: no log files listed in " + logListFile);
System.exit(1);
@@ -297,7 +298,7 @@ public class AuditVerify {
sigStopLine = linenum;
sigStopFile = curfileName;
}
-
+ br.close();
}
// Make sure there were no unsigned log entries at the end.
diff --git a/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java b/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java
index c5f0611a2..7bcab25d3 100644
--- a/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java
+++ b/base/server/cms/src/com/netscape/cms/authentication/UserPwdDirAuthentication.java
@@ -257,8 +257,8 @@ public class UserPwdDirAuthentication extends DirBasedAuthentication
/**
* Retrieves a list of names of the value parameter.
*/
- public Enumeration getValueNames() {
- Vector v = new Vector();
+ public Enumeration<String> getValueNames() {
+ Vector<String> v = new Vector<String>();
v.addElement(mAttr);
v.addElement(CRED_PWD);
diff --git a/base/util/src/netscape/security/x509/CRLExtensions.java b/base/util/src/netscape/security/x509/CRLExtensions.java
index 9c844cd3d..d9eaffd89 100755
--- a/base/util/src/netscape/security/x509/CRLExtensions.java
+++ b/base/util/src/netscape/security/x509/CRLExtensions.java
@@ -150,7 +150,7 @@ public class CRLExtensions extends Vector<Extension> {
*/
public void encode(OutputStream out, boolean isExplicit)
throws CRLException {
- try {
+ try (DerOutputStream tmp = new DerOutputStream()) {
// #381559
if (size() == 0)
return;
@@ -168,14 +168,13 @@ public class CRLExtensions extends Vector<Extension> {
DerOutputStream seq = new DerOutputStream();
seq.write(DerValue.tag_Sequence, extOut);
- DerOutputStream tmp = new DerOutputStream();
- if (isExplicit)
+ if (isExplicit) {
tmp.write(DerValue.createTag(DerValue.TAG_CONTEXT,
true, (byte) 0), seq);
- else
- tmp = seq;
-
- out.write(tmp.toByteArray());
+ out.write(tmp.toByteArray());
+ } else {
+ out.write(seq.toByteArray());
+ }
} catch (IOException e) {
throw new CRLException("Encoding error: " + e.toString());
} catch (CertificateException e) {
diff --git a/base/util/src/netscape/security/x509/EDIPartyName.java b/base/util/src/netscape/security/x509/EDIPartyName.java
index def86ffa5..0efb1c59c 100644
--- a/base/util/src/netscape/security/x509/EDIPartyName.java
+++ b/base/util/src/netscape/security/x509/EDIPartyName.java
@@ -131,8 +131,11 @@ public class EDIPartyName implements GeneralNameInterface {
tagged.write(DerValue.createTag(DerValue.TAG_CONTEXT,
false, TAG_ASSIGNER), tmp2);
}
- if (party == null)
+ if (party == null) {
+ tagged.close();
+ tmp.close();
throw new IOException("Cannot have null partyName");
+ }
// XXX - shd check is chars fit into PrintableString
tmp.putPrintableString(party);