Skip to content

chore: add instruction file manipulation test#119

Merged
josecorella merged 5 commits into
fireegg-test-serversfrom
jocorell/manipulate-instruction-file-tests
Dec 15, 2025
Merged

chore: add instruction file manipulation test#119
josecorella merged 5 commits into
fireegg-test-serversfrom
jocorell/manipulate-instruction-file-tests

Conversation

@josecorella

Copy link
Copy Markdown

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@seebees seebees left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the format should get changed.
It would be nice to be a little clearer about what exactly is being manipulated.

Comment on lines +824 to +829
// At high concurrency, this test tends to get:
// BadDigest Message: The CRC64NVME you specified did not match the calculated checksum.
// I think this is a read after write issue.
// A better fix, would be to break this tests suite up into encrypt/decrypt
// rather than having a test for many pairs and doing encrypt/decrypt on each pair
Thread.sleep(100);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these. They should get taken out.


@ParameterizedTest(name = "{displayName} for Encrypt: {0}, Decrypt: {1}")
@MethodSource("software.amazon.encryption.s3.TestUtils#encryptImprovedDecryptImproved")
public void GIVEN_KCGCMEncryptedData_AND_ImprovedClientDecryptingWithForbidEncryptAllowDecrypt_WHEN_Decrypt_THEN_Pass(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test tends to have an encryp, then decrypt step. So you don't need to do every pair.

@josecorella josecorella force-pushed the jocorell/manipulate-instruction-file-tests branch from 31b476e to 25ec63d Compare December 12, 2025 21:50

@seebees seebees left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the outs. but otherwise looks good.

@ParameterizedTest(name = "{0}: Fail to decrypt with manipulated V3 Instruction File")
@MethodSource("software.amazon.encryption.s3.InstructionFileFailures$DecryptTests#clientsCanGetKMSWithInstructionFile")
void decryptWithManipulatedInstructionFileV3ImprovedClients(TestUtils.LanguageServerTarget language) {
if (crossLanguageObjectsInstructionFileManipulatedV3.isEmpty()) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this. I think we would rather fail than silently not test this.

Suggested change
if (crossLanguageObjectsInstructionFileManipulatedV3.isEmpty()) return;

@ParameterizedTest(name = "{0}: Fail to decrypt with manipulated V2 Instruction File")
@MethodSource("software.amazon.encryption.s3.InstructionFileFailures$DecryptTests#clientsCanGetKMSWithInstructionFile")
void decryptWithManipulatedInstructionFileV2ImprovedClients(TestUtils.LanguageServerTarget language) {
if (crossLanguageObjectsInstructionFileManipulatedV2.isEmpty()) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Suggested change
if (crossLanguageObjectsInstructionFileManipulatedV2.isEmpty()) return;

@kessplas kessplas dismissed seebees’s stale review December 15, 2025 20:53

seebees is OOO, i've verified the requested changes were made

@josecorella josecorella merged commit 5461ae3 into fireegg-test-servers Dec 15, 2025
4 checks passed
@josecorella josecorella deleted the jocorell/manipulate-instruction-file-tests branch December 15, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants