Skip to content

Commit f1cce4f

Browse files
committed
Fix the issues bug - can't decrypt tdfs with assertion created with older version of sdks
1 parent a4212bd commit f1cce4f

File tree

1 file changed

+2
-3
lines changed
  • sdk/src/main/java/io/opentdf/platform/sdk

1 file changed

+2
-3
lines changed

sdk/src/main/java/io/opentdf/platform/sdk/TDF.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*/
3737
public class TDF {
3838

39-
private static final String TDF_VERSION = "1.0.0";
39+
private static final String TDF_VERSION = "4.3.0";
4040
private final long maximumSize;
4141

4242
/**
@@ -733,8 +733,7 @@ public Reader loadTDF(SeekableByteChannel tdf, SDK.KAS kas,
733733
throw new AssertionException("assertion hash mismatch", assertion.id);
734734
}
735735

736-
var hashOfAssertion = Hex.decodeHex(hashOfAssertionAsHex);
737-
736+
byte[] hashOfAssertion = isLegacyTdf ? hashOfAssertionAsHex.getBytes(StandardCharsets.UTF_8) : Hex.decodeHex(hashOfAssertionAsHex);
738737
var signature = new byte[aggregateHashByteArrayBytes.length + hashOfAssertion.length];
739738
System.arraycopy(aggregateHashByteArrayBytes, 0, signature, 0, aggregateHashByteArrayBytes.length);
740739
System.arraycopy(hashOfAssertion, 0, signature, aggregateHashByteArrayBytes.length, hashOfAssertion.length);

0 commit comments

Comments
 (0)