Skip to content

Commit

Permalink
more signature incorrectness
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleene committed Dec 3, 2024
1 parent ad4db09 commit fc7bcb6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/src/main/java/io/opentdf/platform/sdk/TDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ public Reader loadTDF(SeekableByteChannel tdf, SDK.KAS kas,
throw new AssertionException("assertion hash mismatch", assertion.id);
}

if (isLegacyTdf) {
hashOfAssertion = Hex.encodeHexString(hashOfAssertion).getBytes(StandardCharsets.UTF_8);
}

var signature = new byte[aggregateSignatureBytes.length + hashOfAssertion.length];
System.arraycopy(aggregateSignatureBytes, 0, signature, 0, aggregateSignatureBytes.length);
System.arraycopy(hashOfAssertion, 0, signature, aggregateSignatureBytes.length, hashOfAssertion.length);
Expand Down

0 comments on commit fc7bcb6

Please sign in to comment.