directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r280963 - /directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java
Date Wed, 14 Sep 2005 22:59:31 GMT
Author: erodriguez
Date: Wed Sep 14 15:59:28 2005
New Revision: 280963

URL: http://svn.apache.org/viewcvs?rev=280963&view=rev
Log:
Changed exception handling to better return errors related to common errors.

Modified:
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java?rev=280963&r1=280962&r2=280963&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java
Wed Sep 14 15:59:28 2005
@@ -110,7 +110,7 @@
         }
         catch ( IOException ioe )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP );
+            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY );
         }
         catch ( ClassCastException cce )
         {
@@ -126,7 +126,7 @@
         }
         catch ( IOException ioe )
         {
-            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP );
+            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY );
         }
         catch ( ClassCastException cce )
         {
@@ -134,14 +134,14 @@
         }
     }
 
-    private EncryptedData encrypt( EncryptionKey key, byte[] plainText ) throws IOException
+    private EncryptedData encrypt( EncryptionKey key, byte[] plainText ) throws KerberosException
     {
         EncryptionEngine engine = getEngine( key );
 
         return engine.getEncryptedData( key, plainText );
     }
 
-    private byte[] decrypt( EncryptionKey key, EncryptedData data ) throws IOException
+    private byte[] decrypt( EncryptionKey key, EncryptedData data ) throws KerberosException
     {
         EncryptionEngine engine = getEngine( key );
 
@@ -208,7 +208,7 @@
         return decoder.decode( plainText );
     }
 
-    private EncryptionEngine getEngine( EncryptionKey key ) throws IOException
+    private EncryptionEngine getEngine( EncryptionKey key ) throws KerberosException
     {
         EncryptionType encryptionType = key.getKeyType();
 
@@ -216,7 +216,7 @@
 
         if ( clazz == null )
         {
-            throw new IOException( "Unsupported encryption type " + encryptionType );
+            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP );
         }
 
         try
@@ -225,11 +225,11 @@
         }
         catch ( IllegalAccessException iae )
         {
-            throw new IOException( "Error accessing cipher for " + encryptionType );
+            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP );
         }
         catch ( InstantiationException ie )
         {
-            throw new IOException( "Error instantiating cipher for " + encryptionType );
+            throw new KerberosException( ErrorType.KDC_ERR_ETYPE_NOSUPP );
         }
     }
 }



Mime
View raw message