You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AWS Encryption SDK in .NET (ESDK-NET) failed to enforce user input constraints.
Input shapes without required members set would always result in a `NullReferenceException`.
Now, the ESDK-NET will throw it's own Exceptions when illegal user input
is submitted.
software.amazon.cryptography.encryptionsdk.internaldafny.types.AwsEncryptionSdkConfig concrete = (software.amazon.cryptography.encryptionsdk.internaldafny.types.AwsEncryptionSdkConfig)value; AWS.Cryptography.EncryptionSDK.AwsEncryptionSdkConfig converted = new AWS.Cryptography.EncryptionSDK.AwsEncryptionSdkConfig(); if (concrete._commitmentPolicy.is_Some) converted.CommitmentPolicy = (AWS.Cryptography.MaterialProviders.ESDKCommitmentPolicy)FromDafny_N3_aws__N12_cryptography__N13_encryptionSdk__S22_AwsEncryptionSdkConfig__M16_commitmentPolicy(concrete._commitmentPolicy);
21
21
if (concrete._maxEncryptedDataKeys.is_Some) converted.MaxEncryptedDataKeys = (long)FromDafny_N3_aws__N12_cryptography__N13_encryptionSdk__S22_AwsEncryptionSdkConfig__M20_maxEncryptedDataKeys(concrete._maxEncryptedDataKeys);
@@ -26,6 +26,7 @@ index cc922a3..161bcf3 100644
26
26
}
27
27
public static software.amazon.cryptography.encryptionsdk.internaldafny.types._IAwsEncryptionSdkConfig ToDafny_N3_aws__N12_cryptography__N13_encryptionSdk__S22_AwsEncryptionSdkConfig(AWS.Cryptography.EncryptionSDK.AwsEncryptionSdkConfig value)
throw new System.ArgumentException("Invalid AWS.Cryptography.EncryptionSDK.NetV4_0_0_RetryPolicy value");
63
64
}
64
65
public static AWS.Cryptography.MaterialProviders.ESDKCommitmentPolicy FromDafny_N3_aws__N12_cryptography__N13_encryptionSdk__S22_AwsEncryptionSdkConfig__M16_commitmentPolicy(Wrappers_Compile._IOption<software.amazon.cryptography.materialproviders.internaldafny.types._IESDKCommitmentPolicy> value)
Copy file name to clipboardExpand all lines: AwsEncryptionSDK/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/encryptionsdk/ESDK.java
Copy file name to clipboardExpand all lines: AwsEncryptionSDK/runtimes/net/Generated/AwsEncryptionSdk/AwsEncryptionSdkConfig.cs
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,14 @@ public bool IsSetNetV4__0__0__RetryPolicy()
39
39
}
40
40
publicvoidValidate()
41
41
{
42
-
42
+
if(IsSetMaxEncryptedDataKeys())
43
+
{
44
+
if(MaxEncryptedDataKeys<1)
45
+
{
46
+
thrownewSystem.ArgumentException(
47
+
String.Format("Member MaxEncryptedDataKeys of structure AwsEncryptionSdkConfig has type CountingNumbers which has a minimum of 1 but was given the value {0}.",MaxEncryptedDataKeys));
Copy file name to clipboardExpand all lines: AwsEncryptionSDK/runtimes/net/Generated/AwsEncryptionSdk/EncryptInput.cs
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,19 @@ public bool IsSetFrameLength()
70
70
publicvoidValidate()
71
71
{
72
72
if(!IsSetPlaintext())thrownewSystem.ArgumentException("Missing value for required property 'Plaintext'");
73
-
73
+
if(IsSetFrameLength())
74
+
{
75
+
if(FrameLength<1)
76
+
{
77
+
thrownewSystem.ArgumentException(
78
+
String.Format("Member FrameLength of structure EncryptInput has type FrameLength which has a minimum of 1 but was given the value {0}.",FrameLength));
79
+
}
80
+
if(FrameLength>4294967296)
81
+
{
82
+
thrownewSystem.ArgumentException(
83
+
String.Format("Member FrameLength of structure EncryptInput has type FrameLength which has a maximum of 4294967296 but was given the value {0}.",FrameLength));
0 commit comments