Skip to content

Commit 87ca5c0

Browse files
Merge branch 'main' into feature/ecwrap
2 parents 3e6552f + d3be28e commit 87ca5c0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.github/workflows/checks.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ jobs:
336336
needs: platform-integration
337337
uses: opentdf/tests/.github/workflows/xtest.yml@main
338338
with:
339+
focus-sdk: java
339340
java-ref: ${{ github.ref }}
340341

341342
ci:

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

+14-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import io.opentdf.platform.sdk.nanotdf.ECKeyPair;
1414
import org.apache.commons.codec.DecoderException;
1515
import org.apache.commons.codec.binary.Hex;
16+
import org.bouncycastle.crypto.digests.SHA256Digest;
1617
import org.bouncycastle.jce.interfaces.ECPublicKey;
1718
import org.slf4j.Logger;
1819
import org.slf4j.LoggerFactory;
@@ -37,7 +38,19 @@
3738
*/
3839
public class TDF {
3940

40-
public static final byte[] GLOBAL_KEY_SALT = null;
41+
private static byte[] tdfECKeySaltCompute() {
42+
byte[] salt;
43+
try {
44+
MessageDigest digest = MessageDigest.getInstance("SHA-256");
45+
digest.update("TDF".getBytes());
46+
salt = digest.digest();
47+
} catch (NoSuchAlgorithmException e) {
48+
throw new RuntimeException("failed to compute salt for TDF", e);
49+
}
50+
return salt;
51+
}
52+
53+
public static final byte[] GLOBAL_KEY_SALT = tdfECKeySaltCompute();
4154
private static final String EMPTY_SPLIT_ID = "";
4255
private static final String TDF_VERSION = "4.3.0";
4356
private static final String KEY_ACCESS_SECHMA_VERSION = "1.0";

0 commit comments

Comments
 (0)