Skip to content

Commit 2460397

Browse files
committed
Merge branch 'main' of github.com:aws/aws-database-encryption-sdk-dynamodb-java into robin-aws/fix-nightly-build-2024-05-15
# Conflicts: # DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj # project.properties
2 parents 73856a3 + 0aee1d1 commit 2460397

File tree

12 files changed

+44
-17
lines changed

12 files changed

+44
-17
lines changed

.github/workflows/ci_verification.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: dafny-lang/[email protected]
5151
with:
5252
# A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
53-
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
53+
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.6.0' }}
5454

5555
- name: Regenerate code using smithy-dafny if necessary
5656
if: ${{ github.event_name == 'schedule' || inputs.nightly }}

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [3.5.0](https://github.com/aws/aws-database-encryption-sdk-dynamodb/compare/v3.4.0...v3.5.0) (2024-05-30)
4+
5+
### Features
6+
7+
- **DynamoDbEncryption:** Add GetEncryptedDataKeyDescription operation ([#856](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/856)) ([8f8471a](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/8f8471a479d9e7526dd8aaa6f34c906d2a0e2dbb))
8+
- Bump MPL to 1.4 ([#1067](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1067)) ([51bbab5](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/51bbab5589a5db611a3b7564a1c9703fb0de1a23)). This provides three new KMSConfiguration options when constructing a KeyStore (see https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-hierarchical-keyring.html). To KmsKeyArn are added KmsMRKeyArn, Discovery and MrDiscovery.
9+
10+
### Maintenance
11+
12+
- improve verification ([#1020](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1020)) ([cbde4ef](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/cbde4efbd83c57bbbfb96358219dd421141f1da3))
13+
- simplify structured encryption ([#866](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/866)) ([a70a569](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/a70a569d632d051710cfeb37ce27c8785bdba7c2))
14+
- allow Legacy to use subclass of DynamoDBEncryptor ([#1073](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1073)) ([135acd9](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/135acd9871698e76228d6c3ce925bcf589df39c6))
15+
- **Java-Release:** update release commands and use SNAPSHOT builds ([#995](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/995)) ([ac9b79e](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/ac9b79eb18e1904962223e6add153fd49a0f188e))
16+
- reformat and enforce formatting ([#1035](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1035)) ([8a76a9d](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/8a76a9db2e6427b46748b07e654edaf855cd4338))
17+
- verify with Dafny 4.6 ([#1072](https://github.com/aws/aws-database-encryption-sdk-dynamodb/issues/1072)) ([9db6e78](https://github.com/aws/aws-database-encryption-sdk-dynamodb/commit/9db6e78ee01583dd04238252c939277636fc06ad))
18+
319
## [3.4.0](https://github.com/aws/aws-database-encryption-sdk-dynamodb/compare/v3.3.0...v3.4.0) (2024-04-30)
420

521
### Notes

DynamoDbEncryption/dafny/DynamoDbEncryption/src/DynamoToStruct.dfy

+7
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ module DynamoToStruct {
357357
&& U32ToBigEndian(|a.L|).Success?
358358
&& |ret.value| >= PREFIX_LEN + LENGTH_LEN
359359
&& ret.value[0..TYPEID_LEN] == SE.LIST
360+
&& ListAttrToBytes(a.L, depth).Success?
361+
&& ret.value[PREFIX_LEN..] == ListAttrToBytes(a.L, depth).value
362+
&& ListAttrToBytes(a.L, depth).value[..LENGTH_LEN] == U32ToBigEndian(|a.L|).value
360363
&& ret.value[PREFIX_LEN..PREFIX_LEN+LENGTH_LEN] == U32ToBigEndian(|a.L|).value
361364
&& (|a.L| == 0 ==> |ret.value| == PREFIX_LEN + LENGTH_LEN)
362365

@@ -492,6 +495,10 @@ module DynamoToStruct {
492495
}
493496

494497
function method ListAttrToBytes(l: ListAttributeValue, depth : nat): (ret: Result<seq<uint8>, string>)
498+
ensures ret.Success? ==>
499+
&& U32ToBigEndian(|l|).Success?
500+
&& LENGTH_LEN <= |ret.value|
501+
&& ret.value[..LENGTH_LEN] == U32ToBigEndian(|l|).value
495502
{
496503
var count :- U32ToBigEndian(|l|);
497504
var body :- CollectList(l, depth);

DynamoDbEncryption/dafny/DynamoDbEncryption/test/DynamoDbEncryptionBranchKeyIdSupplierTest.dfy

+6-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ module DynamoDbEncryptionBranchKeyIdSupplierTest {
4343
const BRANCH_KEY_ID_B := ALTERNATE_BRANCH_KEY_ID
4444
const EC_PARTITION_NAME := UTF8.EncodeAscii("aws-crypto-partition-name")
4545
const RESERVED_PREFIX := "aws-crypto-attr."
46+
const KEY_ATTR_NAME := UTF8.EncodeAscii(RESERVED_PREFIX + BRANCH_KEY)
47+
const BRANCH_KEY_NAME := UTF8.EncodeAscii(BRANCH_KEY)
4648

47-
method {:test} TestHappyCase()
49+
method {:test} {:vcs_split_on_every_assert} TestHappyCase()
4850
{
4951
var ddbKeyToBranchKeyId: Types.IDynamoDbKeyBranchKeyIdSupplier := new TestBranchKeyIdSupplier();
5052
var ddbEncResources :- expect DynamoDbEncryption.DynamoDbEncryption();
@@ -80,27 +82,26 @@ module DynamoDbEncryptionBranchKeyIdSupplierTest {
8082
)
8183
);
8284

83-
var keyAttrName := UTF8.EncodeAscii(RESERVED_PREFIX + BRANCH_KEY);
8485

8586
// Test Encryption Context with Case A
8687
var materials :- expect mpl.InitializeEncryptionMaterials(
8788
MPL.InitializeEncryptionMaterialsInput(
8889
algorithmSuiteId := TEST_DBE_ALG_SUITE_ID,
89-
encryptionContext := map[EC_PARTITION_NAME := UTF8.EncodeAscii(BRANCH_KEY)],
90+
encryptionContext := map[EC_PARTITION_NAME := BRANCH_KEY_NAME],
9091
requiredEncryptionContextKeys := [],
9192
signingKey := None,
9293
verificationKey := None
9394
)
9495
);
9596

9697
var caseA :- expect UTF8.Encode(Base64.Encode(CASE_A_BYTES));
97-
var contextCaseA := materials.encryptionContext[keyAttrName := caseA];
98+
var contextCaseA := materials.encryptionContext[KEY_ATTR_NAME := caseA];
9899
var materialsA := materials.(encryptionContext := contextCaseA);
99100
TestRoundtrip(hierarchyKeyring, materialsA, TEST_DBE_ALG_SUITE_ID, BRANCH_KEY_ID_A);
100101

101102
// Test Encryption Context with Case B
102103
var caseB :- expect UTF8.Encode(Base64.Encode(CASE_B_BYTES));
103-
var contextCaseB := materials.encryptionContext[keyAttrName := caseB];
104+
var contextCaseB := materials.encryptionContext[KEY_ATTR_NAME := caseB];
104105
var materialsB := materials.(encryptionContext := contextCaseB);
105106
TestRoundtrip(hierarchyKeyring, materialsB, TEST_DBE_ALG_SUITE_ID, BRANCH_KEY_ID_B);
106107
}

DynamoDbEncryption/dafny/StructuredEncryption/src/Canonize.dfy

+2
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ module {:options "/functionSyntax:4" } Canonize {
667667
forall i | 0 <= i < |input| ensures exists x :: x in origData && Updated2(x, input[i], DoDecrypt) {
668668
var x :| x in origData && Updated2(x, input[i], DoDecrypt);
669669
}
670+
assert forall i | 0 <= i < |input| :: exists x :: x in origData && Updated2(x, input[i], DoDecrypt);
670671
}
671672

672673
// command line tools that say /vcsSplitOnEveryAssert fail without the {:vcs_split_on_every_assert false}
@@ -678,6 +679,7 @@ module {:options "/functionSyntax:4" } Canonize {
678679
forall i | 0 <= i < |input| ensures exists x :: x in origData && Updated5(x, input[i], DoEncrypt) {
679680
var x :| x in origData && Updated5(x, input[i], DoEncrypt);
680681
}
682+
assert forall i | 0 <= i < |input| :: exists x :: x in origData && Updated5(x, input[i], DoEncrypt);
681683
}
682684

683685
lemma CryptoUpdatedAuthMaps(origData : AuthList, input : CanonCryptoList, output : CryptoList)

DynamoDbEncryption/dafny/StructuredEncryption/src/SortCanon.dfy

+2
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ module SortCanon {
222222
ensures multiset(x) == multiset(result)
223223
ensures SortedBy(result, AuthBelow)
224224
ensures CanonAuthListHasNoDuplicates(result)
225+
ensures |result| == |x|
225226
{
226227
AuthBelowIsTotal();
227228
var ret := MergeSortBy(x, AuthBelow);
@@ -236,6 +237,7 @@ module SortCanon {
236237
ensures multiset(result) == multiset(x)
237238
ensures SortedBy(result, CryptoBelow)
238239
ensures CanonCryptoListHasNoDuplicates(result)
240+
ensures |result| == |x|
239241
{
240242
CryptoBelowIsTotal();
241243
var ret := MergeSortBy(x, CryptoBelow);

DynamoDbEncryption/runtimes/java/src/main/java/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/internaldafny/legacy/InternalLegacyOverride.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ public static Error createError(String message) {
235235
public static boolean isDynamoDBEncryptor(
236236
software.amazon.cryptography.dbencryptionsdk.dynamodb.ILegacyDynamoDbEncryptor maybe
237237
) {
238-
System.out.println(maybe.getClass());
239-
return maybe.getClass().equals(DynamoDBEncryptor.class);
238+
return maybe instanceof DynamoDBEncryptor;
240239
}
241240

242241
public static String ToNativeString(DafnySequence<? extends Character> s) {

DynamoDbEncryption/runtimes/net/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
[assembly: AssemblyTitle("AWS.Cryptography.DbEncryptionSDK.DynamoDb")]
44

55
// This should be kept in sync with the version number in MPL.csproj
6-
[assembly: AssemblyVersion("3.4.0")]
6+
[assembly: AssemblyVersion("3.5.0")]
77

DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
66
<IsPackable>true</IsPackable>
77

8-
<Version>3.4.0</Version>
8+
<Version>3.5.0</Version>
99

1010
<AssemblyName>AWS.Cryptography.DbEncryptionSDK.DynamoDb</AssemblyName>
1111
<PackageId>AWS.Cryptography.DbEncryptionSDK.DynamoDb</PackageId>
@@ -57,8 +57,8 @@
5757
</PropertyGroup>
5858

5959
<ItemGroup>
60-
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.304.2"/>
61-
<PackageReference Include="AWSSDK.Core" Version="3.7.304.2"/>
60+
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.303.14"/>
61+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.7"/>
6262
<PackageReference Include="DafnyRuntime" Version="$(DafnyVersion)" />
6363
<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj"/>
6464
<!--

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ generate_properties_file:
7777
";
7878

7979
setup_semantic_release:
80-
npm i --no-save semantic-release @semantic-release/changelog semantic-release-replace-plugin conventional-changelog-conventionalcommits @semantic-release/git
80+
npm i --no-save semantic-release @semantic-release/changelog semantic-release-replace-plugin conventional-changelog-conventionalcommits@7.0.2 @semantic-release/git
8181

8282
run_semantic_release:
8383
npx semantic-release --no-ci

TestVectors/runtimes/net/DbEsdkTestVectors.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.300.2"/>
15-
<PackageReference Include="AWSSDK.Core" Version="3.7.300.2"/>
14+
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.303.14"/>
15+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.7"/>
1616
<ProjectReference Include="../../../DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj" />
1717
<ProjectReference Include="../../../submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/runtimes/net/TestVectors.csproj" />
1818
<Compile Include="*.cs"/>

project.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
projectJavaVersion=3.4.0-SNAPSHOT
2-
mplDependencyJavaVersion=1.3.0-SNAPSHOT
1+
projectJavaVersion=3.5.0
2+
mplDependencyJavaVersion=1.4.0
33
dafnyVersion=4.2.0
44
dafnyRuntimeJavaVersion=4.2.0
55
smithyDafnyJavaConversionVersion=0.1

0 commit comments

Comments
 (0)