Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
1 change: 1 addition & 0 deletions core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
1 change: 1 addition & 0 deletions decoding/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
4 changes: 2 additions & 2 deletions decoding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15</artifactId>
<version>1.45</version>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.49</version>
</dependency>
</dependencies>
</project>
14 changes: 10 additions & 4 deletions decoding/src/main/java/org/jaaslounge/decoding/DecodingUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import java.util.Enumeration;

import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERObject;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.DERSequence;

public final class DecodingUtil {
Expand Down Expand Up @@ -45,22 +46,27 @@ public static <T extends Object> T as(Class<T> type, Enumeration<?> enumeration)
return as(type, enumeration.nextElement());
}

public static <T extends DERObject> T as(Class<T> type, ASN1InputStream stream)
public static <T extends ASN1Primitive> T as(Class<T> type, ASN1InputStream stream)
throws DecodingException, IOException {

return as(type, stream.readObject());
}

public static <T extends DERObject> T as(Class<T> type, ASN1TaggedObject tagged)
public static <T extends ASN1Primitive> T as(Class<T> type, ASN1TaggedObject tagged)
throws DecodingException {

return as(type, tagged.getObject());
}

public static <T extends DERObject> T as(Class<T> type, DERSequence sequence, int index)
public static <T extends ASN1Primitive> T as(Class<T> type, DERSequence sequence, int index)
throws DecodingException {

return as(type, sequence.getObjectAt(index));
}

public static <T extends ASN1Primitive> T as(Class<T> type, ASN1Sequence sequence, int index)
throws DecodingException {
return as(type, sequence.getObjectAt(index));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javax.security.auth.kerberos.KerberosKey;

import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERApplicationSpecific;
import org.bouncycastle.asn1.DERBitString;
Expand All @@ -25,10 +26,10 @@ public KerberosApRequest(byte[] token, KerberosKey[] keys) throws DecodingExcept
if(token.length <= 0)
throw new DecodingException("kerberos.request.empty", null, null);

DERSequence sequence;
ASN1Sequence sequence;
try {
ASN1InputStream stream = new ASN1InputStream(new ByteArrayInputStream(token));
sequence = DecodingUtil.as(DERSequence.class, stream);
sequence = DecodingUtil.as(ASN1Sequence.class, stream);
stream.close();
} catch(IOException e) {
throw new DecodingException("kerberos.ticket.malformed", null, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import javax.crypto.spec.SecretKeySpec;

import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERApplicationSpecific;
import org.bouncycastle.asn1.DERGeneralString;
Expand Down Expand Up @@ -47,9 +48,9 @@ public KerberosEncData(byte[] token, Key key) throws DecodingException {
}

stream = new ASN1InputStream(new ByteArrayInputStream(derToken.getContents()));
DERSequence sequence;
ASN1Sequence sequence;
try {
sequence = DecodingUtil.as(DERSequence.class, stream);
sequence = DecodingUtil.as(ASN1Sequence.class, stream);
stream.close();
} catch(IOException e) {
throw new DecodingException("kerberos.ticket.malformed", null, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.util.List;

import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERInteger;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.DERSequence;
Expand All @@ -21,9 +23,9 @@ public class KerberosRelevantAuthData extends KerberosAuthData {

public KerberosRelevantAuthData(byte[] token, Key key) throws DecodingException {
ASN1InputStream stream = new ASN1InputStream(new ByteArrayInputStream(token));
DERSequence authSequence;
ASN1Sequence authSequence;
try {
authSequence = DecodingUtil.as(DERSequence.class, stream);
authSequence = DecodingUtil.as(ASN1Sequence.class, stream);
stream.close();
} catch(IOException e) {
throw new DecodingException("kerberos.ticket.malformed", null, e);
Expand All @@ -32,11 +34,11 @@ public KerberosRelevantAuthData(byte[] token, Key key) throws DecodingException
authorizations = new ArrayList<KerberosAuthData>();
Enumeration<?> authElements = authSequence.getObjects();
while(authElements.hasMoreElements()) {
DERSequence authElement = DecodingUtil.as(DERSequence.class, authElements);
ASN1Sequence authElement = DecodingUtil.as(ASN1Sequence.class, authElements);
DERInteger authType = DecodingUtil.as(DERInteger.class, DecodingUtil.as(
DERTaggedObject.class, authElement, 0));
ASN1TaggedObject.class, authElement, 0));
DEROctetString authData = DecodingUtil.as(DEROctetString.class, DecodingUtil.as(
DERTaggedObject.class, authElement, 1));
ASN1TaggedObject.class, authElement, 1));

authorizations.addAll(KerberosAuthData.parse(authType.getValue().intValue(), authData
.getOctets(), key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javax.security.auth.login.LoginException;

import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERGeneralString;
import org.bouncycastle.asn1.DERInteger;
Expand All @@ -32,9 +33,9 @@ public KerberosTicket(byte[] token, byte apOptions, KerberosKey[] keys)
throw new DecodingException("kerberos.ticket.empty", null, null);

ASN1InputStream stream = new ASN1InputStream(new ByteArrayInputStream(token));
DERSequence sequence;
ASN1Sequence sequence;
try {
sequence = DecodingUtil.as(DERSequence.class, stream);
sequence = DecodingUtil.as(ASN1Sequence.class, stream);
stream.close();
} catch(IOException e) {
throw new DecodingException("kerberos.ticket.malformed", null, e);
Expand Down
1 change: 1 addition & 0 deletions sso/oas/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
1 change: 1 addition & 0 deletions sso/tomcat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
1 change: 1 addition & 0 deletions sso/weblogic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
1 change: 1 addition & 0 deletions sso/websphere/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/