Skip to Content.
Sympa Menu

mace-opensaml-users - bug with artifact builder

Subject: OpenSAML user discussion

List archive

bug with artifact builder


Chronological Thread 
  • From: Jeff Brewer <>
  • To: "" <>
  • Subject: bug with artifact builder
  • Date: Tue, 15 May 2007 18:03:34 -0700
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Z-usanet-msgid: XID366LePBDn0250X40

Given the code to build an artifact:

SAML2ArtifactType0004Builder artifactBuilder = new
SAML2ArtifactType0004Builder();
SAML2ArtifactType0004 artifactObject =
artifactBuilder.buildArtifact("PAYCYCLEPAYCYCLEPAYC");
artifactObject.setEndpointIndex(new byte[] {0,0});
artifactObject.setMessageHandle("00000000000000000001".getBytes());
String encode = artifactObject.base64Encode();

I get an exception (ArrayIndexOutOfBoundsException) in
AbstractSAML2Artifact.getArtifactBytes (line 64)

public byte[] getArtifactBytes() {
byte[] remainingArtifact = getRemainingArtifact();
byte[] artifact = new byte[4 + remainingArtifact.length];

System.arraycopy(getTypeCode(), 0, artifact, 0, 2);
System.arraycopy(getEndpointIndex(), 0, artifact, 2, 2);
System.arraycopy(remainingArtifact, 0, artifact, 4, artifact.length);

return artifact;
}

I think line 64 should be:

System.arraycopy(remainingArtifact, 0, artifact, 4,
remainingArtifact.length);

Jeff Brewer





Archive powered by MHonArc 2.6.16.

Top of Page