[jboss-cvs] JBossAS SVN: r70968 - in projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego: encoding and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 18 17:51:47 EDT 2008
Author: darran.lofthouse at jboss.com
Date: 2008-03-18 17:51:47 -0400 (Tue, 18 Mar 2008)
New Revision: 70968
Modified:
projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/SPNEGOLoginModule.java
projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInit.java
projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInitDecoder.java
projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargDecoder.java
projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargEncoder.java
Log:
[SECURITY-65] Java 5.0 type safety and TODO markers for unused variables.
Modified: projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/SPNEGOLoginModule.java
===================================================================
--- projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/SPNEGOLoginModule.java 2008-03-18 21:27:13 UTC (rev 70967)
+++ projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/SPNEGOLoginModule.java 2008-03-18 21:51:47 UTC (rev 70968)
@@ -216,7 +216,7 @@
if (reqToken[0] == 0x60)
{
NegTokenInit negTokenInit = NegTokenInitDecoder.decode(reqToken);
- List mechList = negTokenInit.getMechTypes();
+ List<Oid> mechList = negTokenInit.getMechTypes();
if (mechList.get(0).equals(kerberos))
{
@@ -226,7 +226,7 @@
{
boolean kerberosSupported = false;
- Iterator it = mechList.iterator();
+ Iterator<Oid> it = mechList.iterator();
while (it.hasNext() && kerberosSupported == false)
{
kerberosSupported = it.next().equals(kerberos);
Modified: projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInit.java
===================================================================
--- projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInit.java 2008-03-18 21:27:13 UTC (rev 70967)
+++ projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInit.java 2008-03-18 21:51:47 UTC (rev 70968)
@@ -31,7 +31,7 @@
private Oid messageOid;
- private final List mechTypes = new LinkedList();
+ private final List<Oid> mechTypes = new LinkedList<Oid>();
private byte[] reqFlags;
@@ -49,7 +49,7 @@
this.messageOid = messageOid;
}
- public List getMechTypes()
+ public List<Oid> getMechTypes()
{
return mechTypes;
}
Modified: projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInitDecoder.java
===================================================================
--- projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInitDecoder.java 2008-03-18 21:27:13 UTC (rev 70967)
+++ projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenInitDecoder.java 2008-03-18 21:51:47 UTC (rev 70968)
@@ -43,7 +43,9 @@
protected static void decodeMechTypes(final InputStream is, final NegTokenInit negTokenInit) throws IOException,
GSSException
{
+ // TODO - Either drop or verify length.
int length = NegTokenDecoder.readLength(is);
+ // TODO - Verify correct sequence type.
byte sequenceType = (byte) is.read();
int sequenceLength = NegTokenDecoder.readLength(is);
@@ -57,9 +59,11 @@
protected static void decodeMechToken(final InputStream is, final NegTokenInit negTokenInit) throws IOException
{
+ // TODO - Either drop or verify length.
int length = NegTokenDecoder.readLength(is);
-
+ // TODO - Verify type.
byte type = (byte) is.read();
+
int tokenLength = readLength(is);
byte[] mechToken = new byte[tokenLength];
@@ -80,6 +84,7 @@
protected static void decodeNegTokenInitSequence(final InputStream is, final NegTokenInit negTokenInit)
throws IOException, GSSException
{
+ // TODO - Verify type.
byte type = (byte) is.read();
int sequenceLength = NegTokenDecoder.readLength(is);
@@ -124,13 +129,16 @@
{
NegTokenInit negTokenInit = new NegTokenInit();
ByteArrayInputStream bais = new ByteArrayInputStream(token);
+ // TODO - Drop or verify.
byte firstByte = (byte) bais.read();
-
+ // TODO - Drop or verify.
int totalLength = NegTokenDecoder.readLength(bais);
negTokenInit.setMessageOid(new Oid(bais));
+ // TODO - Verify
int tokenType = bais.read();
+ // TODO - Drop or verify.
int remainingLength = NegTokenDecoder.readLength(bais);
decodeNegTokenInitSequence(bais, negTokenInit);
Modified: projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargDecoder.java
===================================================================
--- projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargDecoder.java 2008-03-18 21:27:13 UTC (rev 70967)
+++ projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargDecoder.java 2008-03-18 21:51:47 UTC (rev 70968)
@@ -33,7 +33,9 @@
private static void decodeNegResult(final InputStream is, final NegTokenTarg negTokenTarg) throws IOException
{
+ // TODO - Drop or verify.
int length = readLength(is);
+ // TODO - Verify
byte type = (byte) is.read();
byte negResult = (byte) is.read();
@@ -57,6 +59,7 @@
private static void decodeSupportedMech(final InputStream is, final NegTokenTarg negTokenTarg) throws IOException,
GSSException
{
+ // TODO - Drop or verify.
int length = readLength(is);
negTokenTarg.setSupportedMech(new Oid(is));
@@ -64,8 +67,10 @@
private static void decodeResponseToken(final InputStream is, final NegTokenTarg negTokenTarg) throws IOException
{
+ // TODO - Drop or verify.
int length = readLength(is);
+ // TODO - Verify.
byte type = (byte) is.read();
int tokenLength = readLength(is);
@@ -88,6 +93,7 @@
private static void decodeNegTokenTargSequence(final InputStream is, final NegTokenTarg negTokenTarg)
throws IOException, GSSException
{
+ // TODO - Veirfy
byte type = (byte) is.read();
int sequenceLength = readLength(is);
@@ -123,7 +129,9 @@
NegTokenTarg negTokenTarg = new NegTokenTarg();
ByteArrayInputStream bais = new ByteArrayInputStream(token);
+ // TODO - Drop or verify.
byte firstByte = (byte) bais.read();
+ // TODO - Drop or verify.
int totalLength = readLength(bais);
decodeNegTokenTargSequence(bais, negTokenTarg);
Modified: projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargEncoder.java
===================================================================
--- projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargEncoder.java 2008-03-18 21:27:13 UTC (rev 70967)
+++ projects/security/security-negotiation/trunk/jboss-negotiation/src/main/org/jboss/security/negotiation/spnego/encoding/NegTokenTargEncoder.java 2008-03-18 21:51:47 UTC (rev 70968)
@@ -33,10 +33,10 @@
public class NegTokenTargEncoder extends NegTokenEncoder
{
- protected static int getTotalLength(final List tokens)
+ protected static int getTotalLength(final List<byte[]> tokens)
{
int length = 0;
- Iterator it = tokens.iterator();
+ Iterator<byte[]> it = tokens.iterator();
while (it.hasNext())
{
byte[] current = (byte[]) it.next();
@@ -46,21 +46,21 @@
return length;
}
- protected static void encodeNegTokenTarg(final List tokens)
+ protected static void encodeNegTokenTarg(final List<byte[]> tokens)
{
byte[] constructedSequence = createTypeLength((byte) 0xa1, getTotalLength(tokens));
tokens.add(0, constructedSequence);
}
- protected static void encodeConstructedSequence(final List tokens)
+ protected static void encodeConstructedSequence(final List<byte[]> tokens)
{
byte[] constructedSequence = createTypeLength((byte) 0x30, getTotalLength(tokens));
tokens.add(0, constructedSequence);
}
- protected static void encodeNegResult(final List tokens, final Integer negResult)
+ protected static void encodeNegResult(final List<byte[]> tokens, final Integer negResult)
{
if (negResult == null)
return;
@@ -86,7 +86,7 @@
tokens.add(0, negResultToken);
}
- protected static void encodeSupportedMech(final List tokens, final Oid supportedMech) throws GSSException
+ protected static void encodeSupportedMech(final List<byte[]> tokens, final Oid supportedMech) throws GSSException
{
if (supportedMech == null)
return;
@@ -98,7 +98,7 @@
tokens.add(0, sequenceLength);
}
- protected static void encodeResponseToken(final List tokens, final byte[] responseToken)
+ protected static void encodeResponseToken(final List<byte[]> tokens, final byte[] responseToken)
{
if (responseToken == null || responseToken.length == 0)
return;
@@ -111,7 +111,7 @@
tokens.add(0, sequenceLength);
}
- protected static void encodeMechListMIC(final List tokens, final byte[] mechListMIC)
+ protected static void encodeMechListMIC(final List<byte[]> tokens, final byte[] mechListMIC)
{
if (mechListMIC == null || mechListMIC.length == 0)
return;
@@ -124,13 +124,13 @@
tokens.add(0, sequenceLength);
}
- protected static byte[] contructMessage(final List tokens) throws IOException
+ protected static byte[] contructMessage(final List<byte[]> tokens) throws IOException
{
int length = getTotalLength(tokens);
ByteArrayOutputStream baous = new ByteArrayOutputStream(length);
- Iterator it = tokens.iterator();
+ Iterator<byte[]> it = tokens.iterator();
while (it.hasNext())
{
baous.write((byte[]) it.next());
@@ -141,7 +141,7 @@
public static byte[] encode(final NegTokenTarg negTokenTarg) throws GSSException, IOException
{
- List tokens = new LinkedList();
+ List<byte[]> tokens = new LinkedList<byte[]>();
encodeMechListMIC(tokens, negTokenTarg.getMechListMIC());
encodeResponseToken(tokens, negTokenTarg.getResponseToken());
More information about the jboss-cvs-commits
mailing list