Skip to content

Commit daeddee

Browse files
authored
fix: add application checksum to TDX session (#322)
1 parent a9b33bf commit daeddee

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# x-release-please-start-version
22
version=9.2.2
33
# x-release-please-end
4-
iexecCommonsPocoVersion=5.3.1
4+
iexecCommonsPocoVersion=5.4.0
55
iexecCommonVersion=9.2.0
66

77
nexusUser

src/main/java/com/iexec/sms/tee/session/tdx/TdxSessionMakerService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public TdxSession generateSession(final TeeSessionRequest request) throws TeeSes
4646
if (baseSession.getPreCompute() != null) {
4747
tdxEnclaves.add(toTdxEnclave(baseSession.getPreCompute(), request.getTeeServicesProperties().getPreComputeProperties()));
4848
}
49-
// FIXME fingerprint should be dapp checksum from TaskDescription after commons-poco update
50-
tdxEnclaves.add(toTdxEnclave(baseSession.getAppCompute(), request.getTaskDescription().getAppUri(), ""));
49+
tdxEnclaves.add(toTdxEnclave(baseSession.getAppCompute(), request.getTaskDescription().getAppUri(), request.getTaskDescription().getAppChecksum()));
5150
tdxEnclaves.add(toTdxEnclave(baseSession.getPostCompute(), request.getTeeServicesProperties().getPostComputeProperties()));
5251
return new TdxSession(request.getSessionId(), TDX_SESSION_VERSION, List.copyOf(tdxEnclaves));
5352
}

src/test/java/com/iexec/sms/tee/session/TeeSessionTestUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public class TeeSessionTestUtils {
6060
public static final String REQUESTER_SECRET_KEY_2 = "requesterSecretKey2";
6161
public static final String REQUESTER_SECRET_VALUE_2 = "requesterSecretValue2";
6262
public static final String APP_URI = "appUri";
63+
public static final String APP_CHECKSUM = "appChecksum";
6364
public static final String APP_FINGERPRINT = "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b";
6465
public static final String APP_ENTRYPOINT = "appEntrypoint";
6566
public static final String ARGS = "args";
@@ -150,6 +151,7 @@ public static TaskDescription.TaskDescriptionBuilder createTaskDescription(final
150151
.workerpoolOwner(workerpoolAddress)
151152
.appUri(APP_URI)
152153
.appAddress(appAddress)
154+
.appChecksum(APP_CHECKSUM)
153155
.appEnclaveConfiguration(enclaveConfig)
154156
.datasetAddress(BytesUtils.EMPTY_ADDRESS)
155157
.tag(OrderTag.TEE_SCONE.getValue())

src/test/java/com/iexec/sms/tee/session/tdx/TdxSessionMakerServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void shouldGenerateTdxSessionWithPreCompute() throws TeeSessionGenerationExcepti
9191
final TdxSession tdxSession = tdxSessionMakerService.generateSession(request);
9292
final List<TdxSession.Service> services = List.of(
9393
new TdxSession.Service(preCompute.getName(), "pre-compute-image", "pre-compute-fingerprint", Map.of("PRE_COMPUTE", "PRE_COMPUTE")),
94-
new TdxSession.Service(appCompute.getName(), APP_URI, "", Map.of("APP_COMPUTE", "APP_COMPUTE")),
94+
new TdxSession.Service(appCompute.getName(), APP_URI, APP_CHECKSUM, Map.of("APP_COMPUTE", "APP_COMPUTE")),
9595
new TdxSession.Service(postCompute.getName(), "post-compute-image", "post-compute-fingerprint", Map.of("POST_COMPUTE", "POST_COMPUTE"))
9696
);
9797
assertThat(tdxSession)
@@ -118,7 +118,7 @@ void shouldGenerateTdxSessionWithoutPreCompute() throws TeeSessionGenerationExce
118118
.thenReturn(secretSessionBase);
119119
final TdxSession tdxSession = tdxSessionMakerService.generateSession(request);
120120
final List<TdxSession.Service> services = List.of(
121-
new TdxSession.Service(appCompute.getName(), APP_URI, "", Map.of("APP_COMPUTE", "APP_COMPUTE")),
121+
new TdxSession.Service(appCompute.getName(), APP_URI, APP_CHECKSUM, Map.of("APP_COMPUTE", "APP_COMPUTE")),
122122
new TdxSession.Service(postCompute.getName(), "post-compute-image", "post-compute-fingerprint", Map.of("POST_COMPUTE", "POST_COMPUTE"))
123123
);
124124
assertThat(tdxSession)

0 commit comments

Comments
 (0)