directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [1/4] directory-kerby git commit: DIRKRB-474 Moved KrbFlags to asn1 module as Asn1Flags since it's also desired by X509 and CMS
Date Wed, 25 Nov 2015 02:49:59 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/pkinit-support 8ba54fcf4 -> bdca83946


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/57d63f2d/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 a5e18df..4438ec6 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
@@ -199,7 +199,7 @@ public class EncryptionHandler {
     public static EncryptedData encrypt(byte[] plainText, EncryptionKey key,
                                         KeyUsage usage) throws KrbException {
         EncTypeHandler handler = getEncHandler(key.getKeyType());
-        byte[] cipher = handler.encrypt(plainText, key.getKeyData(), usage.getValue());
+        byte[] cipher = handler.encrypt(plainText, key.getKeyData(), usage.getIntValue());
 
         EncryptedData ed = new EncryptedData();
         ed.setCipher(cipher);
@@ -224,7 +224,7 @@ public class EncryptionHandler {
                                  KeyUsage usage) throws KrbException {
         EncTypeHandler handler = getEncHandler(key.getKeyType());
 
-        byte[] plainData = handler.decrypt(data, key.getKeyData(), usage.getValue());
+        byte[] plainData = handler.decrypt(data, key.getKeyData(), usage.getIntValue());
         return plainData;
     }
 
@@ -242,7 +242,7 @@ public class EncryptionHandler {
         EncTypeHandler handler = getEncHandler(key.getKeyType());
 
         byte[] plainData = handler.decrypt(data.getCipher(),
-                key.getKeyData(), usage.getValue());
+                key.getKeyData(), usage.getIntValue());
         return plainData;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/57d63f2d/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
b/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
index ccb738c..6384860 100644
--- a/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
+++ b/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTest.java
@@ -48,9 +48,9 @@ public abstract class BackendTest {
         assertThat(identity.isDisabled()).isEqualTo(kid.isDisabled());
         assertThat(identity.getKeyVersion()).isEqualTo(kid.getKeyVersion());
         for (EncryptionKey expectedKey : kid.getKeys().values()) {
-            EncryptionType actualType = EncryptionType.fromValue(expectedKey.getKeyType().getValue());
+            EncryptionType actualType = EncryptionType.fromValue(expectedKey.getKeyType().getIntValue());
             EncryptionKey actualKey = identity.getKey(actualType);
-            assertThat(actualKey.getKeyType().getValue()).isEqualTo(expectedKey.getKeyType().getValue());
+            assertThat(actualKey.getKeyType().getIntValue()).isEqualTo(expectedKey.getKeyType().getIntValue());
             assertThat(actualKey.getKeyData()).isEqualTo(expectedKey.getKeyData());
             assertThat(actualKey.getKvno()).isEqualTo(expectedKey.getKvno());
         }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/57d63f2d/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheOutputStream.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheOutputStream.java
b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheOutputStream.java
index 75e720d..1b30fe9 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheOutputStream.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/CredCacheOutputStream.java
@@ -44,7 +44,7 @@ public class CredCacheOutputStream extends KrbOutputStream {
         List<String> nameComponents = principal.getNameStrings();
 
         if (version != CredentialCache.FCC_FVNO_1) {
-            writeInt(principal.getNameType().getValue());
+            writeInt(principal.getNameType().getIntValue());
         }
 
         int numComponents = nameComponents.size();
@@ -62,9 +62,9 @@ public class CredCacheOutputStream extends KrbOutputStream {
 
     @Override
     public void writeKey(EncryptionKey key, int version) throws IOException {
-        writeShort(key.getKeyType().getValue());
+        writeShort(key.getKeyType().getIntValue());
         if (version == CredentialCache.FCC_FVNO_3) {
-            writeShort(key.getKeyType().getValue());
+            writeShort(key.getKeyType().getIntValue());
         }
 
         writeCountedOctets(key.getKeyData());
@@ -89,7 +89,7 @@ public class CredCacheOutputStream extends KrbOutputStream {
     }
 
     public void writeAddress(HostAddress address) throws IOException {
-        write(address.getAddrType().getValue());
+        write(address.getAddrType().getIntValue());
         write(address.getAddress().length);
         write(address.getAddress(), 0,
               address.getAddress().length);
@@ -100,7 +100,7 @@ public class CredCacheOutputStream extends KrbOutputStream {
             writeInt(0);
         } else {
             for (AuthorizationDataEntry entry : authData.getElements()) {
-                write(entry.getAuthzType().getValue());
+                write(entry.getAuthzType().getIntValue());
                 write(entry.getAuthzData().length);
                 write(entry.getAuthzData());
             }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/57d63f2d/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/Credential.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/Credential.java
b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/Credential.java
index a391089..9f27a77 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/Credential.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/ccache/Credential.java
@@ -108,7 +108,7 @@ public class Credential {
     }
 
     public int getEType() {
-        return key.getKeyType().getValue();
+        return key.getKeyType().getIntValue();
     }
 
     public PrincipalName getClientName() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/57d63f2d/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabOutputStream.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabOutputStream.java
b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabOutputStream.java
index 3fe2280..4438417 100644
--- a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabOutputStream.java
+++ b/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/KeytabOutputStream.java
@@ -45,12 +45,12 @@ public class KeytabOutputStream extends KrbOutputStream {
             writeCountedString(nameCom);
         }
 
-        writeInt(principal.getNameType().getValue()); // todo: consider the version
+        writeInt(principal.getNameType().getIntValue()); // todo: consider the version
     }
 
     @Override
     public void writeKey(EncryptionKey key, int version) throws IOException {
-        writeShort(key.getKeyType().getValue());
+        writeShort(key.getKeyType().getIntValue());
         writeCountedOctets(key.getKeyData());
     }
 


Mime
View raw message