directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r533939 - /directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java
Date Tue, 01 May 2007 04:48:43 GMT
Author: erodriguez
Date: Mon Apr 30 21:48:42 2007
New Revision: 533939

URL: http://svn.apache.org/viewvc?view=rev&rev=533939
Log:
Updated NULL encryption type to match enhanced base class.

Modified:
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java?view=diff&rev=533939&r1=533938&r2=533939
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java
(original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NullEncryption.java
Mon Apr 30 21:48:42 2007
@@ -20,10 +20,9 @@
 package org.apache.directory.server.kerberos.shared.crypto.encryption;
 
 
-import javax.crypto.Cipher;
-
-import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumEngine;
-import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumType;
+import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
+import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
+import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 
 
 /**
@@ -32,74 +31,56 @@
  */
 public class NullEncryption extends EncryptionEngine
 {
-    public Cipher getCipher() 
-    {
-        return null;
-    }
-
-
-    public ChecksumEngine getChecksumEngine()
-    {
-        return null;
-    }
-
-
-    public EncryptionType encryptionType()
+    public EncryptionType getEncryptionType()
     {
         return EncryptionType.NULL;
     }
 
 
-    public CipherType keyType()
+    public int getChecksumLength()
     {
-        return CipherType.NULL;
+        return 0;
     }
 
 
-    public ChecksumType checksumType()
+    public int getConfounderLength()
     {
-        return ChecksumType.NULL;
+        return 0;
     }
 
 
-    public int blockSize()
+    public byte[] getDecryptedData( EncryptionKey key, EncryptedData data ) throws KerberosException
     {
-        return 1;
+        return data.getCipherText();
     }
 
 
-    public int keySize()
+    public EncryptedData getEncryptedData( EncryptionKey key, byte[] plainText )
     {
-        return 0;
+        return new EncryptedData( getEncryptionType(), key.getKeyVersion(), plainText );
     }
 
 
-    public int checksumSize()
+    public byte[] encrypt( byte[] plainText, byte[] keyBytes )
     {
-        return 0;
+        return processCipher( true, plainText, keyBytes );
     }
 
 
-    public int confounderSize()
+    public byte[] decrypt( byte[] cipherText, byte[] keyBytes )
     {
-        return 0;
+        return processCipher( false, cipherText, keyBytes );
     }
 
 
-    public int minimumPadSize()
+    public byte[] calculateChecksum( byte[] plainText, byte[] key )
     {
-        return 0;
+        return null;
     }
 
 
-    protected byte[] processCipher( boolean encrypt, byte[] data, byte[] key, byte[] ivec
)
+    private byte[] processCipher( boolean encrypt, byte[] data, byte[] key )
     {
         return data;
-    }
-
-
-    public byte[] calculateChecksum( byte[] plainText )
-    {
-        return null;
     }
 }



Mime
View raw message