directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 56111 - incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages
Date Sun, 31 Oct 2004 02:21:08 GMT
Author: erodriguez
Date: Sat Oct 30 19:21:07 2004
New Revision: 56111

Modified:
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/ApplicationRequest.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/AuthenticationReply.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/KdcRequest.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/TicketGrantReply.java
Log:
Update of messages to use KerberosPrincipals.

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 19:21:07 2004
@@ -24,8 +24,8 @@
 
 	private ApOptions     _apOptions;
 	private Ticket        _ticket;
-	private EncryptedData _encPart       = new EncryptedData();
-	private Authenticator _authenticator = new Authenticator();
+	private EncryptedData _encPart;
+	private Authenticator _authenticator;
 	
 	/**
 	 * Class constructors
@@ -37,9 +37,9 @@
 	
 	public ApplicationRequest(ApOptions apOptions, Ticket ticket, EncryptedData encPart) {
 		super(LocalConfig.PVNO, MessageType.KRB_AP_REQ);
-		_apOptions             = apOptions;
-		_ticket                = ticket;
-		_encPart               = encPart;
+		_apOptions = apOptions;
+		_ticket    = ticket;
+		_encPart   = encPart;
 	}
 	
 	public ApOptions getApOptions() {

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/AuthenticationReply.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/AuthenticationReply.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/AuthenticationReply.java
Sat Oct 30 19:21:07 2004
@@ -19,6 +19,8 @@
 import org.apache.kerberos.messages.components.*;
 import org.apache.kerberos.messages.value.*;
 
+import javax.security.auth.kerberos.*;
+
 public class AuthenticationReply extends KdcReply {
 	
 	/**
@@ -28,9 +30,9 @@
 		super(MessageType.KRB_AS_REP);
 	}
 	
-	public AuthenticationReply(PreAuthenticationData[] paData, Realm crealm,
-			PrincipalName cname, Ticket ticket, EncryptedData encPart) {
-		super(paData, crealm, cname, ticket, encPart, MessageType.KRB_AS_REP);
+	public AuthenticationReply(PreAuthenticationData[] paData, KerberosPrincipal clientPrincipal,
+			Ticket ticket, EncryptedData encPart) {
+		super(paData, clientPrincipal, ticket, encPart, MessageType.KRB_AS_REP);
 	}
 }
 

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 19:21:07 2004
@@ -19,49 +19,44 @@
 import org.apache.kerberos.kdc.*;
 import org.apache.kerberos.messages.value.*;
 
+import javax.security.auth.kerberos.*;
+
 public class ErrorMessage {
 
-	private int           _pvno;
-	private MessageType   _msgType;
-	private KerberosTime  _ctime;  //optional
-	private Integer       _cusec;  //optional
-	private KerberosTime  _stime;
-	private int           _susec;
-	private int           _errorCode;
-	private Realm         _crealm; //optional
-	private PrincipalName _cname;  //optional
-	private Realm         _realm;
-	private PrincipalName _sname;
-	private String        _eText;  //optional
-	private byte[]        _eData;  //optional
+	private int               _pvno;
+	private MessageType       _messageType;
+	private KerberosTime      _clientTime;      //optional
+	private Integer           _cusec;           //optional
+	private KerberosTime      _serverTime;
+	private int               _susec;
+	private int               _errorCode;
+	private KerberosPrincipal _clientPrincipal; //optional
+	private KerberosPrincipal _serverPrincipal;
+	private String            _eText;           //optional
+	private byte[]            _eData;           //optional
 
-	public ErrorMessage(KerberosTime ctime, Integer cusec, KerberosTime stime, int susec,
-			int errorCode, Realm crealm, PrincipalName cname, Realm realm, PrincipalName sname,
+	public ErrorMessage(KerberosTime clientTime, Integer cusec, KerberosTime serverTime, int
susec,
+			int errorCode, KerberosPrincipal clientPrincipal, KerberosPrincipal serverPrincipal,
 			String eText, byte[] eData) {
 		
-		_pvno      = LocalConfig.PVNO;
-		_msgType   = MessageType.KRB_ERROR;
-		_ctime     = ctime;
-		_cusec     = cusec;
-		_stime     = stime;
-		_susec     = susec;
-		_errorCode = errorCode;
-		_crealm    = crealm;
-		_cname     = cname;
-		_realm     = realm;
-		_sname     = sname;
-		_eText     = eText;
-		_eData     = eData;
+		_pvno            = LocalConfig.PVNO;
+		_messageType     = MessageType.KRB_ERROR;
+		_clientTime      = clientTime;
+		_cusec           = cusec;
+		_serverTime      = serverTime;
+		_susec           = susec;
+		_errorCode       = errorCode;
+		_clientPrincipal = clientPrincipal;
+		_serverPrincipal = serverPrincipal;
+		_eText           = eText;
+		_eData           = eData;
 	}
 
-	public PrincipalName getCname() {
-		return _cname;
-	}
-	public Realm getCrealm() {
-		return _crealm;
+	public KerberosPrincipal getClientPrincipal() {
+		return _clientPrincipal;
 	}
-	public KerberosTime getCtime() {
-		return _ctime;
+	public KerberosTime getClientTime() {
+		return _clientTime;
 	}
 	public Integer getCusec() {
 		return _cusec;
@@ -76,19 +71,16 @@
 		return _eText;
 	}
 	public MessageType getMsgType() {
-		return _msgType;
+		return _messageType;
 	}
 	public int getPvno() {
 		return _pvno;
 	}
-	public Realm getRealm() {
-		return _realm;
-	}
-	public PrincipalName getSname() {
-		return _sname;
+	public KerberosPrincipal getServerPrincipal() {
+		return _serverPrincipal;
 	}
-	public KerberosTime getStime() {
-		return _stime;
+	public KerberosTime getServerTime() {
+		return _serverTime;
 	}
 	public int getSusec() {
 		return _susec;

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 19:21:07 2004
@@ -20,11 +20,12 @@
 import org.apache.kerberos.messages.components.*;
 import org.apache.kerberos.messages.value.*;
 
+import javax.security.auth.kerberos.*;
+
 public class KdcReply extends KerberosMessage {
 
 	private PreAuthenticationData[] _paData;  //optional
-	private Realm                   _crealm;
-	private PrincipalName           _cname;
+	private KerberosPrincipal       _clientPrincipal;
 	private Ticket                  _ticket;
 	
 	private EncKdcRepPart _encKDCRepPart = new EncKdcRepPart();
@@ -34,23 +35,22 @@
 		super(LocalConfig.PVNO, msgType);
 	}
 	
-	public KdcReply(PreAuthenticationData[] paData, Realm crealm, PrincipalName cname,
+	public KdcReply(PreAuthenticationData[] paData, KerberosPrincipal clientPrincipal,
 			Ticket ticket, EncryptedData encPart, MessageType msgType) {
 		
 		this(msgType);
-		_paData  = paData;
-		_crealm  = crealm;
-		_cname   = cname;
-		_ticket  = ticket;
-		_encPart = encPart;
+		_paData          = paData;
+		_clientPrincipal = clientPrincipal;
+		_ticket          = ticket;
+		_encPart         = encPart;
 	}
 	
 	// getters
-	public PrincipalName getCname() {
-		return _cname;
+	public KerberosPrincipal getClientPrincipal() {
+		return _clientPrincipal;
 	}
-	public Realm getCrealm() {
-		return _crealm;
+	public String getClientRealm() {
+		return _clientPrincipal.getRealm();
 	}
 	public EncryptedData getEncPart() {
 		return _encPart;
@@ -63,11 +63,8 @@
 	}
 	
 	// setters
-	public void setCname(PrincipalName cname) {
-		_cname = cname;
-	}
-	public void setCrealm(Realm crealm) {
-		_crealm = crealm;
+	public void setClientPrincipal(KerberosPrincipal clientPrincipal) {
+		_clientPrincipal = clientPrincipal;
 	}
 	public void setEncKDCRepPart(EncKdcRepPart repPart) {
 		_encKDCRepPart = repPart;
@@ -110,10 +107,10 @@
 	public KerberosTime getRenewTill() {
 		return _encKDCRepPart.getRenewTill();
 	}
-	public PrincipalName getServerName() {
-		return _encKDCRepPart.getServerName();
+	public KerberosPrincipal getServerPrincipal() {
+		return _encKDCRepPart.getServerPrincipal();
 	}
-	public Realm getServerRealm() {
+	public String getServerRealm() {
 		return _encKDCRepPart.getServerRealm();
 	}
 	public KerberosTime getStartTime() {
@@ -148,11 +145,8 @@
 	public void setRenewTill(KerberosTime till) {
 		_encKDCRepPart.setRenewTill(till);
 	}
-	public void setServerName(PrincipalName name) {
-		_encKDCRepPart.setServerName(name);
-	}
-	public void setServerRealm(Realm realm) {
-		_encKDCRepPart.setServerRealm(realm);
+	public void setServerPrincipal(KerberosPrincipal principal) {
+		_encKDCRepPart.setServerPrincipal(principal);
 	}
 	public void setStartTime(KerberosTime time) {
 		_encKDCRepPart.setStartTime(time);

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KdcRequest.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KdcRequest.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/KdcRequest.java
Sat Oct 30 19:21:07 2004
@@ -20,14 +20,13 @@
 import org.apache.kerberos.messages.components.*;
 import org.apache.kerberos.messages.value.*;
 
+import javax.security.auth.kerberos.*;
+
 public class KdcRequest extends KerberosMessage {
 
 	private PreAuthenticationData[] _preAuthData; //optional
 	private RequestBody             _requestBody;
 	
-	// TODO - this is protocol workflow and a violation of the immutable request
-	private KerberosTime            _requestedRenewalTime;
-
 	/**
 	 * Class constructor
 	 */
@@ -51,11 +50,11 @@
 	public HostAddresses getAddresses() {
 		return _requestBody.getAddresses();
 	}
-	public PrincipalName getCname() {
-		return _requestBody.getCname();
+	public KerberosPrincipal getClientPrincipal() {
+		return _requestBody.getClientPrincipal();
 	}
-	public Realm getRealm() {
-		return _requestBody.getRealm();
+	public String getRealm() {
+		return _requestBody.getServerPrincipal().getRealm();
 	}
 	public EncryptedData getEncAuthorizationData() {
 		return _requestBody.getEncAuthorizationData();
@@ -73,20 +72,13 @@
 		return _requestBody.getNonce();
 	}
 	public KerberosTime getRtime() {
-		if (_requestedRenewalTime == null) {
-			return _requestBody.getRtime();
-		}
-		return _requestedRenewalTime;
+		return _requestBody.getRtime();
 	}
-	public PrincipalName getSname() {
-		return _requestBody.getSname();
+	public KerberosPrincipal getServerPrincipal() {
+		return _requestBody.getServerPrincipal();
 	}
 	public KerberosTime getTill() {
 		return _requestBody.getTill();
-	}
-	
-	public void setRtime(KerberosTime rtime) {
-		_requestedRenewalTime = rtime;
 	}
 	
 	// RequestBody KdcOptions delegate accesors

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/TicketGrantReply.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/TicketGrantReply.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/TicketGrantReply.java
Sat Oct 30 19:21:07 2004
@@ -19,6 +19,8 @@
 import org.apache.kerberos.messages.components.*;
 import org.apache.kerberos.messages.value.*;
 
+import javax.security.auth.kerberos.*;
+
 public class TicketGrantReply extends KdcReply {
 
 	/**
@@ -28,9 +30,9 @@
 		super(MessageType.KRB_TGS_REP);
 	}
 	
-	public TicketGrantReply(PreAuthenticationData[] pAData, Realm crealm,
-			PrincipalName cname, Ticket ticket, EncryptedData encPart) {
-		super(pAData, crealm, cname, ticket, encPart, MessageType.KRB_TGS_REP);
+	public TicketGrantReply(PreAuthenticationData[] pAData, KerberosPrincipal clientPrincipal,
+			Ticket ticket, EncryptedData encPart) {
+		super(pAData, clientPrincipal, ticket, encPart, MessageType.KRB_TGS_REP);
 	}
 }
 

Mime
View raw message