directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [13/26] directory-kerby git commit: Fixing warnings
Date Tue, 05 Jul 2016 07:17:01 GMT
Fixing warnings


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

Branch: refs/heads/kadmin-remote
Commit: f39f0058f7f9a8b3c4c10279d4ac1abb3af9800a
Parents: c4865eb
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Jun 17 11:42:51 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Jun 17 11:42:51 2016 +0100

----------------------------------------------------------------------
 .../kerb/server/preauth/pkinit/PkinitPreauth.java         | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f39f0058/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
index fa93780..f0080c9 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
@@ -252,7 +252,7 @@ public class PkinitPreauth extends AbstractPreauthPlugin {
 
                 String identity = pkinitContext.identityOpts.identity;
 
-                PaPkAsRep paPkAsRep = makePaPkAsRep(pkinitContext.cryptoctx, serverPubKey,
identity);
+                PaPkAsRep paPkAsRep = makePaPkAsRep(serverPubKey, identity);
                 PaDataEntry paDataEntry = makeEntry(paPkAsRep);
 
                 kdcRequest.getPreauthContext().getOutputPaData().add(paDataEntry);
@@ -300,16 +300,14 @@ public class PkinitPreauth extends AbstractPreauthPlugin {
         return paDataEntry;
     }
 
-    private PaPkAsRep makePaPkAsRep(PkinitPlgCryptoContext cryptoContext,
-                                    DHPublicKey severPubKey, String identityString) throws
KrbException {
+    private PaPkAsRep makePaPkAsRep(DHPublicKey severPubKey, String identityString) throws
KrbException {
 
         List<String> identityList = Arrays.asList(identityString.split(","));
 
         List<X509Certificate> certificates = new ArrayList<>();
         for (String identity : identityList) {
             File file = new File(identity);
-            try {
-                Scanner scanner = new Scanner(file, "UTF-8");
+            try (Scanner scanner = new Scanner(file, "UTF-8")) {
                 String found = scanner.findInLine("CERTIFICATE");
 
                 if (found != null) {
@@ -353,7 +351,7 @@ public class PkinitPreauth extends AbstractPreauthPlugin {
             certificateSet.addElement(certificateChoices);
         }
 
-        String oid = cryptoContext.getIdPkinitDHKeyDataOID();
+        String oid = PkinitPlgCryptoContext.getIdPkinitDHKeyDataOID();
         signedDataBytes = PkinitCrypto.cmsSignedDataCreate(KrbCodec.encode(kdcDhKeyInfo),
oid, 3, null,
                 null, null, null);
 


Mime
View raw message