directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 56114 - in incubator/directory/kerberos/trunk/source/main/org/apache/kerberos: kdc messages messages/application
Date Sun, 31 Oct 2004 03:10:55 GMT
Author: erodriguez
Date: Sat Oct 30 20:10:55 2004
New Revision: 56114

Modified:
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/DefaultConfig.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ApplicationRequest.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ErrorMessage.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KdcReply.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KerberosMessage.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/ApplicationReply.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/CredentialMessage.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/PrivateMessage.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/SafeMessage.java
Log:
Message base class clean-up.

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/DefaultConfig.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/DefaultConfig.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/kdc/DefaultConfig.java
Sat Oct 30 20:10:55 2004
@@ -19,7 +19,6 @@
 import org.apache.kerberos.crypto.encryption.*;
 import org.apache.kerberos.kdc.replay.*;
 import org.apache.kerberos.messages.value.*;
-import org.apache.kerberos.util.keytab.*;
 
 public class DefaultConfig {
 	
@@ -91,11 +90,5 @@
     // Whether to allow renewable credentials
 	public static final boolean KDC_RENEWABLE_ALLOWED       = DEFAULT_RENEWABLE_ALLOWED;
 	
-	// Protocol constants and associated values
-    // Kerberos protocol version number
-	public static final int PVNO              = 5;
-    // Default keytab version number
-	public static final int KT_VNO            = Keytab.VNO_2;
-
 }
 

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ApplicationRequest.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ApplicationRequest.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ApplicationRequest.java
Sat Oct 30 20:10:55 2004
@@ -16,7 +16,6 @@
  */
 package org.apache.kerberos.messages;
 
-import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.components.*;
 import org.apache.kerberos.messages.value.*;
 
@@ -31,12 +30,12 @@
 	 * Class constructors
 	 */
 	public ApplicationRequest() {
-		super(LocalConfig.PVNO, MessageType.KRB_AP_REQ);
+		super(MessageType.KRB_AP_REQ);
 		// used by ASN1 decoder
 	}
 	
 	public ApplicationRequest(ApOptions apOptions, Ticket ticket, EncryptedData encPart) {
-		super(LocalConfig.PVNO, MessageType.KRB_AP_REQ);
+		super(MessageType.KRB_AP_REQ);
 		_apOptions = apOptions;
 		_ticket    = ticket;
 		_encPart   = encPart;

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ErrorMessage.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ErrorMessage.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ErrorMessage.java
Sat Oct 30 20:10:55 2004
@@ -16,15 +16,12 @@
  */
 package org.apache.kerberos.messages;
 
-import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.value.*;
 
 import javax.security.auth.kerberos.*;
 
-public class ErrorMessage {
+public class ErrorMessage extends KerberosMessage {
 
-	private int               _pvno;
-	private MessageType       _messageType;
 	private KerberosTime      _clientTime;      //optional
 	private Integer           _cusec;           //optional
 	private KerberosTime      _serverTime;
@@ -39,8 +36,7 @@
 			int errorCode, KerberosPrincipal clientPrincipal, KerberosPrincipal serverPrincipal,
 			String eText, byte[] eData) {
 		
-		_pvno            = LocalConfig.PVNO;
-		_messageType     = MessageType.KRB_ERROR;
+		super(MessageType.KRB_ERROR);
 		_clientTime      = clientTime;
 		_cusec           = cusec;
 		_serverTime      = serverTime;
@@ -69,12 +65,6 @@
 	}
 	public String getEText() {
 		return _eText;
-	}
-	public MessageType getMsgType() {
-		return _messageType;
-	}
-	public int getPvno() {
-		return _pvno;
 	}
 	public KerberosPrincipal getServerPrincipal() {
 		return _serverPrincipal;

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KdcReply.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KdcReply.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KdcReply.java
Sat Oct 30 20:10:55 2004
@@ -16,7 +16,6 @@
  */
 package org.apache.kerberos.messages;
 
-import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.components.*;
 import org.apache.kerberos.messages.value.*;
 
@@ -32,7 +31,7 @@
 	private EncryptedData _encPart       = new EncryptedData();
 
 	public KdcReply(MessageType msgType) {
-		super(LocalConfig.PVNO, msgType);
+		super(msgType);
 	}
 	
 	public KdcReply(PreAuthenticationData[] paData, KerberosPrincipal clientPrincipal,

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KerberosMessage.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KerberosMessage.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KerberosMessage.java
Sat Oct 30 20:10:55 2004
@@ -18,8 +18,15 @@
 
 public class KerberosMessage {
 	
+    // Kerberos protocol version number
+	public static final int PVNO = 5;
+	
 	private int         _protocolVersionNumber;
 	private MessageType _messageType;
+	
+	public KerberosMessage(MessageType type) {
+		this(PVNO, type);
+	}
 	
 	public KerberosMessage(int versionNumber, MessageType type) {
 		_protocolVersionNumber = versionNumber;

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/ApplicationReply.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/ApplicationReply.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/ApplicationReply.java
Sat Oct 30 20:10:55 2004
@@ -16,7 +16,6 @@
  */
 package org.apache.kerberos.messages.application;
 
-import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.*;
 import org.apache.kerberos.messages.value.*;
 
@@ -24,11 +23,8 @@
 
 	private EncryptedData _encryptedPart;
 
-	/**
-	 * Class constructor
-	 */
 	public ApplicationReply(EncryptedData encPart) {
-		super(LocalConfig.PVNO, MessageType.KRB_AP_REP);
+		super(MessageType.KRB_AP_REP);
 		_encryptedPart = encPart;
 	}
 	

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/CredentialMessage.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/CredentialMessage.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/CredentialMessage.java
Sat Oct 30 20:10:55 2004
@@ -16,7 +16,6 @@
  */
 package org.apache.kerberos.messages.application;
 
-import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.*;
 import org.apache.kerberos.messages.components.*;
 import org.apache.kerberos.messages.value.*;
@@ -26,11 +25,8 @@
 	private EncryptedData _encPart;
 	private Ticket[]      _tickets;
 
-	/**
-	 * Class constructor
-	 */
 	public CredentialMessage(EncryptedData encPart, Ticket[] tickets) {
-		super(LocalConfig.PVNO, MessageType.KRB_CRED);
+		super(MessageType.KRB_CRED);
 		_encPart = encPart;
 		_tickets = tickets;
 	}

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/PrivateMessage.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/PrivateMessage.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/PrivateMessage.java
Sat Oct 30 20:10:55 2004
@@ -16,7 +16,6 @@
  */
 package org.apache.kerberos.messages.application;
 
-import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.*;
 import org.apache.kerberos.messages.value.*;
 
@@ -24,11 +23,8 @@
 
 	private EncryptedData _encPart;
 
-	/**
-	 * Class constructor
-	 */
 	public PrivateMessage(EncryptedData encPart) {
-		super(LocalConfig.PVNO, MessageType.KRB_PRIV);
+		super(MessageType.KRB_PRIV);
 		_encPart = encPart;
 	}
 	

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/SafeMessage.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/SafeMessage.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/application/SafeMessage.java
Sat Oct 30 20:10:55 2004
@@ -16,7 +16,6 @@
  */
 package org.apache.kerberos.messages.application;
 
-import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.*;
 import org.apache.kerberos.messages.value.*;
 
@@ -25,11 +24,8 @@
 	private SafeBody _safeBody;
 	private Checksum _cksum;
 
-	/**
-	 * Class constructor
-	 */
 	public SafeMessage(SafeBody safeBody, Checksum cksum) {
-		super(LocalConfig.PVNO, MessageType.KRB_SAFE);
+		super(MessageType.KRB_SAFE);
 		_safeBody = safeBody;
 		_cksum    = cksum;
 	}

Mime
View raw message