From 316e524a0f0a60d4346e9f29899958b04b15f2b0 Mon Sep 17 00:00:00 2001 From: "lubomir.marinov" Date: Fri, 25 Jun 2010 06:47:47 +0000 Subject: [PATCH] Fixes warnings, javadocs, formatting. Simplifies a few instances of cloning arrays. --- src/org/ice4j/StunException.java | 6 +- .../attribute/ContentDependentAttribute.java | 2 - .../ice4j/attribute/ErrorCodeAttribute.java | 8 -- .../attribute/MessageIntegrityAttribute.java | 3 - src/org/ice4j/attribute/NonceAttribute.java | 43 ++++------ src/org/ice4j/attribute/RealmAttribute.java | 9 +-- .../ice4j/attribute/SoftwareAttribute.java | 2 - .../ice4j/attribute/UsernameAttribute.java | 7 +- .../ice4j/ice/ConnectivityCheckClient.java | 8 +- .../ice4j/ice/ConnectivityCheckServer.java | 14 ++-- src/org/ice4j/ice/HostCandidate.java | 15 ++-- src/org/ice4j/message/Message.java | 45 +++++++---- src/org/ice4j/message/MessageFactory.java | 80 +++++++++++++------ src/org/ice4j/message/Request.java | 3 - src/org/ice4j/message/Response.java | 32 ++++++-- .../ice4j/security/CredentialsAuthority.java | 2 +- .../ice4j/security/CredentialsManager.java | 1 - src/org/ice4j/stack/MessageProcessor.java | 1 - src/org/ice4j/stack/RequestListener.java | 3 - src/org/ice4j/stack/StunStack.java | 7 +- 20 files changed, 155 insertions(+), 136 deletions(-) diff --git a/src/org/ice4j/StunException.java b/src/org/ice4j/StunException.java index a7f6451..a65ff1e 100644 --- a/src/org/ice4j/StunException.java +++ b/src/org/ice4j/StunException.java @@ -96,9 +96,11 @@ public class StunException extends Exception } /** - * Creates a StunException, setting an error message an error id and a cause. - * @param message an error message. + * Creates a StunException, setting an error message an error id and a + * cause. + * * @param id an error id. + * @param message an error message. * @param cause the error that caused this exception. */ public StunException(int id, String message, Throwable cause) diff --git a/src/org/ice4j/attribute/ContentDependentAttribute.java b/src/org/ice4j/attribute/ContentDependentAttribute.java index 90950c6..ed739e8 100644 --- a/src/org/ice4j/attribute/ContentDependentAttribute.java +++ b/src/org/ice4j/attribute/ContentDependentAttribute.java @@ -6,8 +6,6 @@ */ package org.ice4j.attribute; -import org.ice4j.*; - /** * ContentDependentAttributes have a value that depend on the content * of the message. The {@link MessageIntegrityAttribute} and {@link diff --git a/src/org/ice4j/attribute/ErrorCodeAttribute.java b/src/org/ice4j/attribute/ErrorCodeAttribute.java index a8830a3..59a38d2 100644 --- a/src/org/ice4j/attribute/ErrorCodeAttribute.java +++ b/src/org/ice4j/attribute/ErrorCodeAttribute.java @@ -6,10 +6,6 @@ */ package org.ice4j.attribute; -import java.util.*; - -import org.ice4j.*; - /** * The ERROR-CODE attribute is present in the Binding Error Response and * Shared Secret Error Response. It is a numeric value in the range of @@ -142,7 +138,6 @@ public class ErrorCodeAttribute extends Attribute return (char)(getErrorClass()*100 + getErrorNumber()); } - /** * Sets this attribute's error number. * @param errorNumber the error number to assign this attribute. @@ -190,7 +185,6 @@ public class ErrorCodeAttribute extends Attribute return errorClass; } - /** * Returns a default reason phrase corresponding to the specified error * code, as described by rfc 3489. @@ -371,6 +365,4 @@ public class ErrorCodeAttribute extends Attribute setReasonPhrase(new String(reasonBytes)); } - - } diff --git a/src/org/ice4j/attribute/MessageIntegrityAttribute.java b/src/org/ice4j/attribute/MessageIntegrityAttribute.java index e0bd936..76e2823 100644 --- a/src/org/ice4j/attribute/MessageIntegrityAttribute.java +++ b/src/org/ice4j/attribute/MessageIntegrityAttribute.java @@ -6,14 +6,11 @@ */ package org.ice4j.attribute; -import java.nio.channels.*; -import java.security.*; import java.util.*; import javax.crypto.*; import javax.crypto.spec.*; -import org.ice4j.*; import org.ice4j.stack.*; /** diff --git a/src/org/ice4j/attribute/NonceAttribute.java b/src/org/ice4j/attribute/NonceAttribute.java index fd76eb7..bd6dbd3 100644 --- a/src/org/ice4j/attribute/NonceAttribute.java +++ b/src/org/ice4j/attribute/NonceAttribute.java @@ -11,7 +11,7 @@ import java.util.*; import org.ice4j.*; /** - * The NONCE attribute is used for authentification. + * The NONCE attribute is used for authentication. * * @author Sebastien Vincent */ @@ -45,7 +45,8 @@ public class NonceAttribute extends Attribute * @param length the length of the binary array. * @throws StunException if attributeValue contains invalid data. */ - void decodeAttributeBody(byte[] attributeValue, char offset, char length) throws StunException + void decodeAttributeBody(byte[] attributeValue, char offset, char length) + throws StunException { nonce = new byte[length]; System.arraycopy(attributeValue, offset, nonce, 0, length); @@ -58,7 +59,8 @@ public class NonceAttribute extends Attribute public byte[] encode() { char type = getAttributeType(); - byte binValue[] = new byte[HEADER_LENGTH + getDataLength() + (getDataLength() % 4)]; + byte binValue[] + = new byte[HEADER_LENGTH + getDataLength() + (getDataLength() % 4)]; //Type binValue[0] = (byte)(type>>8); @@ -93,18 +95,13 @@ public class NonceAttribute extends Attribute } /** - * Returns a (cloned) byte array containg the data value of the nonce + * Returns a (cloned) byte array containing the data value of the nonce * attribute. * @return the binary array containing the nonce. */ public byte[] getNonce() { - if (nonce == null) - return null; - - byte[] copy = new byte[nonce.length]; - System.arraycopy(nonce, 0, copy, 0, nonce.length); - return copy; + return (nonce == null) ? null : nonce.clone(); } /** @@ -114,14 +111,7 @@ public class NonceAttribute extends Attribute */ public void setNonce(byte[] nonce) { - if (nonce == null) - { - this.nonce = null; - return; - } - - this.nonce = new byte[nonce.length]; - System.arraycopy(nonce, 0, this.nonce, 0, nonce.length); + this.nonce = (nonce == null) ? null : nonce.clone(); } /** @@ -132,19 +122,16 @@ public class NonceAttribute extends Attribute */ public boolean equals(Object obj) { - if (! (obj instanceof NonceAttribute) || obj == null) - return false; - if (obj == this) return true; - - NonceAttribute att = (NonceAttribute) obj; - if (att.getAttributeType() != getAttributeType() - || att.getDataLength() != getDataLength() - || !Arrays.equals( att.nonce, nonce)) + if (! (obj instanceof NonceAttribute)) return false; - return true; + NonceAttribute att = (NonceAttribute) obj; + + return + (att.getAttributeType() == getAttributeType() + && att.getDataLength() == getDataLength() + && Arrays.equals(att.nonce, nonce)); } } - diff --git a/src/org/ice4j/attribute/RealmAttribute.java b/src/org/ice4j/attribute/RealmAttribute.java index d9916c1..c5d77fc 100644 --- a/src/org/ice4j/attribute/RealmAttribute.java +++ b/src/org/ice4j/attribute/RealmAttribute.java @@ -95,18 +95,13 @@ public class RealmAttribute extends Attribute } /** - * Returns a (cloned) byte array containg the data value of the realm + * Returns a (cloned) byte array containing the data value of the realm * attribute. * @return the binary array containing the realm. */ public byte[] getRealm() { - if (realm == null) - return null; - - byte[] copy = new byte[realm.length]; - System.arraycopy(realm, 0, copy, 0, realm.length); - return copy; + return (realm == null) ? null : realm.clone(); } /** diff --git a/src/org/ice4j/attribute/SoftwareAttribute.java b/src/org/ice4j/attribute/SoftwareAttribute.java index 64b0512..4bb91db 100644 --- a/src/org/ice4j/attribute/SoftwareAttribute.java +++ b/src/org/ice4j/attribute/SoftwareAttribute.java @@ -8,8 +8,6 @@ package org.ice4j.attribute; import java.util.*; -import org.ice4j.*; - /** * The SOFTWARE attribute contains a textual description of the software * being used by the software or the client, including manufacturer and version number. diff --git a/src/org/ice4j/attribute/UsernameAttribute.java b/src/org/ice4j/attribute/UsernameAttribute.java index 1e5e745..6eee035 100644 --- a/src/org/ice4j/attribute/UsernameAttribute.java +++ b/src/org/ice4j/attribute/UsernameAttribute.java @@ -105,12 +105,7 @@ public class UsernameAttribute extends Attribute */ public byte[] getUsername() { - if (username == null) - return null; - - byte[] copy = new byte[username.length]; - System.arraycopy(username, 0, copy, 0, username.length); - return copy; + return (username == null) ? null : username.clone(); } /** diff --git a/src/org/ice4j/ice/ConnectivityCheckClient.java b/src/org/ice4j/ice/ConnectivityCheckClient.java index bc6acf8..30fb9f7 100644 --- a/src/org/ice4j/ice/ConnectivityCheckClient.java +++ b/src/org/ice4j/ice/ConnectivityCheckClient.java @@ -202,7 +202,7 @@ class ConnectivityCheckClient else if(evt.getResponse().getMessageType() == Response.BINDING_ERROR_RESPONSE) { - if(! evt.getResponse().contains(Attribute.ERROR_CODE)) + if(! evt.getResponse().containsAttribute(Attribute.ERROR_CODE)) { logger.fine("Received a malformed error response."); return; //malformed error response @@ -298,7 +298,7 @@ class ConnectivityCheckClient CandidatePair checkedPair = ((CandidatePair)evt.getTransactionID() .getApplicationData()); - if(! response.contains(Attribute.XOR_MAPPED_ADDRESS)) + if(! response.containsAttribute(Attribute.XOR_MAPPED_ADDRESS)) { logger.fine("Received a success response with no " +"XOR_MAPPED_ADDRESS attribute."); @@ -432,7 +432,7 @@ class ConnectivityCheckClient //CANDIDATE attribute in the Binding request, the valid pair generated //from that check has its nominated flag set to true. if(parentAgent.isControlling() - && request.contains(Attribute.USE_CANDIDATE)) + && request.containsAttribute(Attribute.USE_CANDIDATE)) { parentAgent.nominationConfirmed( validPair ); } @@ -504,7 +504,7 @@ class ConnectivityCheckClient if(errorCode.getErrorCode() == ErrorCodeAttribute.ROLE_CONFLICT) { boolean wasControlling = originalRequest - .contains(Attribute.ICE_CONTROLLING); + .containsAttribute(Attribute.ICE_CONTROLLING); logger.finer("Swithing to isControlling=" + !wasControlling); parentAgent.setControlling(!wasControlling); diff --git a/src/org/ice4j/ice/ConnectivityCheckServer.java b/src/org/ice4j/ice/ConnectivityCheckServer.java index 6a42834..29ea5f4 100644 --- a/src/org/ice4j/ice/ConnectivityCheckServer.java +++ b/src/org/ice4j/ice/ConnectivityCheckServer.java @@ -13,6 +13,7 @@ import org.ice4j.attribute.*; import org.ice4j.message.*; import org.ice4j.security.*; import org.ice4j.stack.*; + /** * The class that would be handling and responding to incoming connectivity * checks. @@ -56,7 +57,7 @@ class ConnectivityCheckServer /** * Handles the {@link Request} delivered in evt by possibly - * queueing a triggered check and sending a success or or error response + * queuing a triggered check and sending a success or an error response * depending on how processing goes. * * @param evt the {@link StunMessageEvent} containing the {@link Request} @@ -94,16 +95,17 @@ class ConnectivityCheckServer //detect role conflicts if( ( parentAgent.isControlling() - && request.contains(Attribute.ICE_CONTROLLING)) + && request.containsAttribute(Attribute.ICE_CONTROLLING)) || ( ! parentAgent.isControlling() - && request.contains(Attribute.ICE_CONTROLLED))) + && request.containsAttribute(Attribute.ICE_CONTROLLED))) { if (!repairRoleConflict(evt)) return; } long priority = extractPriority(request); - boolean useCandidate = request.contains(Attribute.USE_CANDIDATE); + boolean useCandidate + = request.containsAttribute(Attribute.USE_CANDIDATE); //tell our address handler we saw a new remote address; parentAgent.incomingCheckReceived(evt.getRemoteAddress(), @@ -187,7 +189,7 @@ class ConnectivityCheckServer // If the agent is in the controlling role, and the // ICE-CONTROLLING attribute is present in the request: if(parentAgent.isControlling() - && req.contains(Attribute.ICE_CONTROLLING)) + && req.containsAttribute(Attribute.ICE_CONTROLLING)) { IceControllingAttribute controlling = (IceControllingAttribute) req.getAttribute(Attribute.ICE_CONTROLLING); @@ -234,7 +236,7 @@ class ConnectivityCheckServer // If the agent is in the controlled role, and the ICE-CONTROLLED // attribute is present in the request: else if(!parentAgent.isControlling() - && req.contains(Attribute.ICE_CONTROLLED)) + && req.containsAttribute(Attribute.ICE_CONTROLLED)) { IceControlledAttribute controlled = (IceControlledAttribute) req.getAttribute(Attribute.ICE_CONTROLLED); diff --git a/src/org/ice4j/ice/HostCandidate.java b/src/org/ice4j/ice/HostCandidate.java index f7cedd6..9f0ac9a 100644 --- a/src/org/ice4j/ice/HostCandidate.java +++ b/src/org/ice4j/ice/HostCandidate.java @@ -42,11 +42,6 @@ public class HostCandidate extends LocalCandidate */ private final DatagramSocket socket; - /** - * The DatagramPacketFilter that only accepts STUN messages. - */ - private DatagramPacketFilter stunDatagramPacketFilter; - /** * Creates a HostCandidate for the specified transport address. * @@ -99,6 +94,7 @@ public class HostCandidate extends LocalCandidate Throwable exception = null; if (hostSocket instanceof MultiplexingDatagramSocket) + { try { stunSocket @@ -108,12 +104,13 @@ public class HostCandidate extends LocalCandidate } catch (SocketException sex)//don't u just luv da name? ;) { - logger.log( Level.SEVERE, - "Failed to acquire DatagramSocket" - + " specific to STUN communication.", - sex); + logger.log(Level.SEVERE, + "Failed to acquire DatagramSocket" + + " specific to STUN communication.", + sex); exception = sex; } + } if (stunSocket == null) throw new IllegalArgumentException("hostCand", exception); else diff --git a/src/org/ice4j/message/Message.java b/src/org/ice4j/message/Message.java index f5d6d08..cd3ed06 100644 --- a/src/org/ice4j/message/Message.java +++ b/src/org/ice4j/message/Message.java @@ -13,8 +13,6 @@ import org.ice4j.*; import org.ice4j.attribute.*; import org.ice4j.stack.*; -import sun.tools.tree.*; - /** * This class represents a STUN message. STUN messages are TLV (type-length-value) * encoded using big endian (network ordered) binary. All STUN messages start @@ -308,7 +306,7 @@ public abstract class Message * @return true if the this Message contains an attribute * with the specified type or false otherwise. */ - public boolean contains(char attributeType) + public boolean containsAttribute(char attributeType) { return attributes.containsKey(attributeType); } @@ -491,12 +489,13 @@ public abstract class Message { switch (messageType) { - case BINDING_REQUEST: return "BINDING-REQUEST"; - case BINDING_SUCCESS_RESPONSE: return "BINDING-RESPONSE"; - case BINDING_ERROR_RESPONSE: return "BINDING-ERROR-RESPONSE"; - case SHARED_SECRET_REQUEST: return "SHARED-SECRET-REQUEST"; - case SHARED_SECRET_RESPONSE: return "SHARED-SECRET-RESPONSE"; - case SHARED_SECRET_ERROR_RESPONSE: return "SHARED-SECRET-ERROR-RESPONSE"; + case ALLOCATE_REQUEST: return "ALLOCATE-REQUEST"; + case BINDING_REQUEST: return "BINDING-REQUEST"; + case BINDING_SUCCESS_RESPONSE: return "BINDING-RESPONSE"; + case BINDING_ERROR_RESPONSE: return "BINDING-ERROR-RESPONSE"; + case SHARED_SECRET_REQUEST: return "SHARED-SECRET-REQUEST"; + case SHARED_SECRET_RESPONSE: return "SHARED-SECRET-RESPONSE"; + case SHARED_SECRET_ERROR_RESPONSE: return "SHARED-SECRET-ERROR-RESPONSE"; } return "UNKNOWN-MESSAGE"; @@ -705,7 +704,7 @@ public abstract class Message offset+=TRANSACTION_ID_LENGTH; - while(offset - Message.HEADER_LENGTH< length) + while(offset - Message.HEADER_LENGTH < length) { Attribute att = AttributeDecoder.decode( binMessage, offset, (char)(length - offset)); @@ -824,7 +823,6 @@ public abstract class Message if(getAttributePresentity(i) == M && getAttribute(i) == null) throw new IllegalStateException( "A mandatory attribute (type=" +(int)i + ") is missing!"); - } /** @@ -886,12 +884,27 @@ public abstract class Message * * @return a String representation of this message. */ + @Override public String toString() { - return getName()+"(0x"+Integer.toHexString(getMessageType()) - +")[attrib.count=" + getAttributeCount() - +" len=" + (int) this.getDataLength() - +" tranID=" + TransactionID.toString(getTransactionID()) + "]"; - } + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(getName()); + stringBuilder.append("(0x"); + stringBuilder.append(Integer.toHexString(getMessageType())); + stringBuilder.append(")[attrib.count="); + stringBuilder.append(getAttributeCount()); + stringBuilder.append(" len="); + stringBuilder.append((int) this.getDataLength()); + + byte[] transactionID = getTransactionID(); + + if (transactionID != null) + { + stringBuilder.append(" tranID="); + stringBuilder.append(TransactionID.toString(transactionID)); + } + stringBuilder.append("]"); + return stringBuilder.toString(); + } } diff --git a/src/org/ice4j/message/MessageFactory.java b/src/org/ice4j/message/MessageFactory.java index d6b0f29..0c67447 100644 --- a/src/org/ice4j/message/MessageFactory.java +++ b/src/org/ice4j/message/MessageFactory.java @@ -6,6 +6,7 @@ */ package org.ice4j.message; +import java.io.*; import java.util.logging.*; import org.ice4j.*; @@ -20,9 +21,8 @@ import org.ice4j.attribute.*; */ public class MessageFactory { - private static final Logger logger = Logger - .getLogger(MessageFactory.class - .getName()); + private static final Logger logger + = Logger.getLogger(MessageFactory.class.getName()); /** * Creates a default binding request. The request DOES NOT contains a @@ -374,34 +374,64 @@ public class MessageFactory } /** - * Add the required attributes for long-term authentication.
- * This will also add a MESSAGE-INTEGRITY and FINGERPRINT attribute.
- * Do not add another attributes after called this method. + * Adds the Attributes to a specific Request which support + * the STUN long-term credential mechanism. + *

+ * Warning: The MESSAGE-INTEGRITY Attribute will also be + * added so Attributes added afterwards will not be taken into + * account for the calculation of the MESSAGE-INTEGRITY value. For example, + * the FINGERPRINT Attribute may still safely be added afterwards, + * because it is known to appear after the MESSAGE-INTEGRITY. + *

* - * @param request the original request - * @param username username value - * @param realm realm value - * @param nonce nonce value + * @param request the Request in which the Attributes of + * the STUN long-term credential mechanism are to be added + * @param username the value for the USERNAME Attribute to be added + * to request + * @param realm the value for the REALM Attribute to be added to + * request + * @param nonce the value for the NONCE Attribute to be added to + * request * - * @throws StunException in case we have a problem creating the username - * realm or nonce attributes. + * @throws StunException if anything goes wrong while adding the + * Attributes to request which support the STUN long-term + * credential mechanism */ - public static void addLongTermAuthentifcationAttribute( - Request request, byte username[], byte realm[], - byte nonce[]) throws StunException + public static void addLongTermCredentialAttributes( + Request request, + byte username[], byte realm[], byte nonce[]) + throws StunException { - UsernameAttribute usernameAttr = AttributeFactory - .createUsernameAttribute(username); - RealmAttribute realmAttr = AttributeFactory - .createRealmAttribute(realm); - NonceAttribute nonceAttr = AttributeFactory - .createNonceAttribute(nonce); + UsernameAttribute usernameAttribute + = AttributeFactory.createUsernameAttribute(username); + RealmAttribute realmAttribute + = AttributeFactory.createRealmAttribute(realm); + NonceAttribute nonceAttribute + = AttributeFactory.createNonceAttribute(nonce); - request.addAttribute(usernameAttr); - request.addAttribute(realmAttr); - request.addAttribute(nonceAttr); + request.addAttribute(usernameAttribute); + request.addAttribute(realmAttribute); + request.addAttribute(nonceAttribute); - /* TODO calculate MESSAGE-INTEGRITY and FINGERPRINT */ + // MESSAGE-INTEGRITY + MessageIntegrityAttribute messageIntegrityAttribute; + + try + { + /* + * The value of USERNAME is a variable-length value. It MUST contain + * a UTF-8 [RFC3629] encoded sequence of less than 513 bytes, and + * MUST have been processed using SASLprep [RFC4013]. + */ + messageIntegrityAttribute + = AttributeFactory.createMessageIntegrityAttribute( + new String(username, "UTF-8")); + } + catch (UnsupportedEncodingException ueex) + { + throw new StunException("username", ueex); + } + request.addAttribute(messageIntegrityAttribute); } /** diff --git a/src/org/ice4j/message/Request.java b/src/org/ice4j/message/Request.java index 53d2b94..e17b209 100644 --- a/src/org/ice4j/message/Request.java +++ b/src/org/ice4j/message/Request.java @@ -13,7 +13,6 @@ package org.ice4j.message; * * @author Emil Ivov */ - public class Request extends Message { @@ -22,7 +21,6 @@ public class Request extends Message */ Request() { - } /** @@ -43,5 +41,4 @@ public class Request extends Message super.setMessageType(requestType); } - } diff --git a/src/org/ice4j/message/Response.java b/src/org/ice4j/message/Response.java index a36efb4..6f91891 100644 --- a/src/org/ice4j/message/Response.java +++ b/src/org/ice4j/message/Response.java @@ -6,16 +6,16 @@ */ package org.ice4j.message; -import org.ice4j.*; - /** * A response descendant of the message class. The primary purpose of the * Response class is to allow better functional definition of the classes in the * stack package. * * @author Emil Ivov + * @author Lubomir Marinov */ -public class Response extends Message +public class Response + extends Message { /** @@ -25,6 +25,28 @@ public class Response extends Message { } + /** + * Determines whether this instance represents a STUN error response. + * + * @return true if this instance represents a STUN error response; + * otherwise, false + */ + public boolean isErrorResponse() + { + return isErrorResponseType(getMessageType()); + } + + /** + * Determines whether this instance represents a STUN success response. + * + * @return true if this instance represents a STUN success + * response; otherwise, false + */ + public boolean isSuccessResponse() + { + return isSuccessResponseType(getMessageType()); + } + /** * Checks whether responseType is a valid response type and if yes sets it * as the type of the current instance. @@ -37,8 +59,8 @@ public class Response extends Message { if(!isResponseType(responseType)) throw new IllegalArgumentException( - (int)(responseType) - + " - is not a valid response type."); + Integer.toString(responseType) + + " is not a valid response type."); super.setMessageType(responseType); diff --git a/src/org/ice4j/security/CredentialsAuthority.java b/src/org/ice4j/security/CredentialsAuthority.java index 2bc0dd5..6bada7f 100644 --- a/src/org/ice4j/security/CredentialsAuthority.java +++ b/src/org/ice4j/security/CredentialsAuthority.java @@ -9,7 +9,7 @@ package org.ice4j.security; /** * The {@link CredentialsAuthority} interface is implemented by applications * in order to allow the stack to verify the integrity of incoming messages - * containing the MessageIntegrity attribute. + * containing the MessageIntegrityAttribute. * * @author Emil Ivov */ diff --git a/src/org/ice4j/security/CredentialsManager.java b/src/org/ice4j/security/CredentialsManager.java index e666b86..4966721 100644 --- a/src/org/ice4j/security/CredentialsManager.java +++ b/src/org/ice4j/security/CredentialsManager.java @@ -7,7 +7,6 @@ package org.ice4j.security; import java.util.*; -import java.util.logging.*; /** * The CredentialsManager allows an application to handle verification diff --git a/src/org/ice4j/stack/MessageProcessor.java b/src/org/ice4j/stack/MessageProcessor.java index cdb3d95..8031caa 100644 --- a/src/org/ice4j/stack/MessageProcessor.java +++ b/src/org/ice4j/stack/MessageProcessor.java @@ -9,7 +9,6 @@ package org.ice4j.stack; import java.util.logging.*; import org.ice4j.*; -import org.ice4j.attribute.*; import org.ice4j.message.*; /** diff --git a/src/org/ice4j/stack/RequestListener.java b/src/org/ice4j/stack/RequestListener.java index b0b26f9..fa0734a 100644 --- a/src/org/ice4j/stack/RequestListener.java +++ b/src/org/ice4j/stack/RequestListener.java @@ -9,14 +9,11 @@ package org.ice4j.stack; import org.ice4j.*; import org.ice4j.message.*; -import com.sun.corba.se.impl.protocol.*; - /** * Handles incoming requests. * * @author Emil Ivov */ - public interface RequestListener { /** diff --git a/src/org/ice4j/stack/StunStack.java b/src/org/ice4j/stack/StunStack.java index 75a452e..47f3180 100644 --- a/src/org/ice4j/stack/StunStack.java +++ b/src/org/ice4j/stack/StunStack.java @@ -19,8 +19,6 @@ import org.ice4j.attribute.*; import org.ice4j.message.*; import org.ice4j.security.*; -import com.sun.corba.se.impl.protocol.*; - /** * The entry point to the Stun4J stack. The class is used to start, stop and * configure the stack. @@ -693,8 +691,9 @@ public class StunStack } //assert Message Integrity - MessageIntegrityAttribute msgIntAttr = (MessageIntegrityAttribute) - request.getAttribute(Attribute.MESSAGE_INTEGRITY); + MessageIntegrityAttribute msgIntAttr + = (MessageIntegrityAttribute) + request.getAttribute(Attribute.MESSAGE_INTEGRITY); if (msgIntAttr != null) {