Skip to content

Commit

Permalink
Address PR Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrsongg committed Aug 13, 2024
1 parent 60d5ee5 commit 1854e8c
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 200 deletions.
23 changes: 0 additions & 23 deletions Notice.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,6 @@ purpose, commercial or non-commercial, and by any means.

----------------

** Parsing PEM files from Bouncy Castle
Copyright (c) 2000 - 2017 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

----------------

** Performing CRC32 checks from vbAccelerator.com
vbAccelerator Software License

Expand Down
28 changes: 0 additions & 28 deletions buildtools/NoticeForZips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,6 @@ purpose, commercial or non-commercial, and by any means.

----------------

** Parsing PEM files from Bouncy Castle
Copyright (c) 2000 - 2017 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
** Microsoft.Bcl.AsyncInterfaces from Microsoft
Copyright (c) .NET Foundation and Contributors
** System.Runtime.CompilerServices.Unsafe from Microsoft
Copyright (c) .NET Foundation and Contributors
** System.Threading.Tasks.Extensions from Microsoft
Copyright (c) .NET Foundation and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

----------------

** Performing CRC32 checks from vbAccelerator.com
vbAccelerator Software License
Expand Down
1 change: 1 addition & 0 deletions buildtools/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@
<PrivateKeyException Include="sdk/code-analysis/ServiceAnalysis/OpsWorksCM/Generated/PropertyValueRules.xml" />
<PrivateKeyException Include="extensions/test/CloudFront.SignersTests/EmbeddedResource/sample.rsa.private.key.txt"/>
<PrivateKeyException Include="extensions/test/EC2.DecryptPasswordTests/PasswordTest.cs"/>
<PrivateKeyException Include="extensions/test/CloudFront.SignersTests/URLSignerTest.cs"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AssemblyName>AWSSDK.Extensions.CloudFront.Signers</AssemblyName>
<PackageId>AWSSDK.Extensions.CloudFront.Signers</PackageId>
<Version>4.0.0.0-preview</Version>
<Title>AWSSDK.Extensions.Cloudfront.Signers</Title>
<Description>
This package contains extension methods for creating signed URLs for Amazon CloudFront distributions and
for creating signed cookies for Amazon CloudFront distributions using canned or custom policies.
</Description>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Remove="**/obj/**" />
</ItemGroup>
<Choose>
<When Condition=" '$(AWSKeyFile)' == '' ">
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\..\sdk\awssdk.dll.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(AWSKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../../sdk/src/Core/AWSSDK.Core.NetFramework.csproj" />
<ProjectReference Include="../../../sdk/src/Services/CloudFront\AWSSDK.CloudFront.NetFramework.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AssemblyName>AWSSDK.Extensions.CloudFront.Signers</AssemblyName>
<PackageId>AWSSDK.Extensions.CloudFront.Signers</PackageId>
<Version>4.0.0.0-preview</Version>
<Title>AWSSDK.Extensions.Cloudfront.Signers</Title>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Remove="**/obj/**" />
</ItemGroup>
<Choose>
<When Condition=" '$(AWSKeyFile)' == '' ">
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\..\sdk\awssdk.dll.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(AWSKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../../sdk/src/Core/AWSSDK.Core.NetFramework.csproj" />
<ProjectReference Include="../../../sdk/src/Services/CloudFront/AWSSDK.CloudFront.NetFramework.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net8.0</TargetFrameworks>
<AssemblyName>AWSSDK.Extensions.CloudFront.Signers</AssemblyName>
<PackageId>AWSSDK.Extensions.CloudFront.Signers</PackageId>
<Version>4.0.0.0-preview</Version>
<Title>AWSSDK.Extensions.Cloudfront.Signers</Title>
<Description>
This package contains extension methods for creating signed URLs for Amazon CloudFront distributions and
for creating signed cookies for Amazon CloudFront distributions using canned or custom policies.
</Description>
<DefineConstants>$(DefineConstants);NETSTANDARD;AWS_ASYNC_API</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard2.0'">$(DefineConstants);NETSTANDARD20;AWS_ASYNC_ENUMERABLES_API</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp3.1'">$(DefineConstants);AWS_ASYNC_ENUMERABLES_API</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0'">$(DefineConstants);AWS_ASYNC_ENUMERABLES_API</DefineConstants>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Remove="**/obj/**" />
</ItemGroup>
<Choose>
<When Condition=" '$(AWSKeyFile)' == '' ">
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\..\sdk\awssdk.dll.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(AWSKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\sdk\src\Core\AWSSDK.Core.NetStandard.csproj" />
<ProjectReference Include="..\..\..\sdk\src\Services\CloudFront\AWSSDK.CloudFront.NetStandard.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net8.0</TargetFrameworks>
<AssemblyName>AWSSDK.Extensions.CloudFront.Signers</AssemblyName>
<PackageId>AWSSDK.Extensions.CloudFront.Signers</PackageId>
<Version>4.0.0.0-preview</Version>
<Title>AWSSDK.Extensions.Cloudfront.Signers</Title>
<DefineConstants>$(DefineConstants);NETSTANDARD;AWS_ASYNC_API</DefineConstants>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Remove="**/obj/**" />
</ItemGroup>
<Choose>
<When Condition=" '$(AWSKeyFile)' == '' ">
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\..\sdk\awssdk.dll.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(AWSKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../../sdk/src/Core/AWSSDK.Core.NetStandard.csproj" />
<ProjectReference Include="../../../sdk/src/Services/CloudFront/AWSSDK.CloudFront.NetStandard.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
<group targetFramework="net472">
<dependency id="AWSSDK.Core" version="4.0.0.0-preview" />
<dependency id="AWSSDK.CloudFront" version="4.0.0.0-preview" />
<dependency id="Portable.BouncyCastle" version="1.9.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="AWSSDK.Core" version="4.0.0.0-preview" />
<dependency id="AWSSDK.CloudFront" version="4.0.0.0-preview" />
<dependency id="Portable.BouncyCastle" version="1.9.0" />
</group>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,21 @@ internal static RSAParameters ConvertPEMToRSAParameters(TextReader privateKeyRea
try
{
var pemReader = new PemReader(privateKeyReader);
var keyPair = pemReader.ReadObject() as AsymmetricCipherKeyPair;
var privateKey = keyPair.Private as RsaPrivateCrtKeyParameters;
rsaParams = DotNetUtilities.ToRSAParameters(privateKey);

var keyPair = pemReader.ReadObject();
if (keyPair is RsaPrivateCrtKeyParameters)
{
rsaParams = DotNetUtilities.ToRSAParameters((RsaPrivateCrtKeyParameters)keyPair);
}
else if (keyPair is AsymmetricCipherKeyPair)
{
var asymmetricKeyPair = keyPair as AsymmetricCipherKeyPair;
var privateKey = asymmetricKeyPair.Private as RsaPrivateCrtKeyParameters;
rsaParams = DotNetUtilities.ToRSAParameters(privateKey);
}
else
{
throw new AmazonClientException("Unknown key type");
}
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
<icon>images\AWSLogo.png</icon>
<dependencies>
<group targetFramework="net472">
<dependency id="AWSSDK.Core" version="4.0.0.0-preview" />
<dependency id="AWSSDK.CloudFront" version="4.0.0.0-preview" />
<dependency id="AWSSDK.Core" version="4.0.0-preview" />
<dependency id="AWSCRT-AUTH" version="0.4.4" />
<dependency id="AWSCRT-CHECKSUMS" version="0.4.4" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="AWSSDK.Core" version="4.0.0.0-preview" />
<dependency id="AWSSDK.CloudFront" version="4.0.0.0-preview" />
<dependency id="AWSSDK.Core" version="4.0.0-preview" />
<dependency id="AWSCRT-AUTH" version="0.4.4" />
<dependency id="AWSCRT-CHECKSUMS" version="0.4.4" />
</group>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<PackageId>AWSSDK.Extensions.EC2.DecryptPassword</PackageId>
<Version>4.0.0.0-preview</Version>
<Title>AWSSDK.Extensions.EC2.DecryptPassword</Title>
<DefineConstants>$(DefineConstants);BCL;AWS_ASYNC_API;CODE_ANALYSIS</DefineConstants>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<PackageId>AWSSDK.Extensions.EC2.DecryptPassword</PackageId>
<Version>4.0.0.0-preview</Version>
<Title>AWSSDK.Extensions.EC2.DecryptPassword</Title>
<DefineConstants>$(DefineConstants);NETSTANDARD;AWS_ASYNC_API</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard2.0'">$(DefineConstants);NETSTANDARD20;AWS_ASYNC_ENUMERABLES_API</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp3.1'">$(DefineConstants);AWS_ASYNC_ENUMERABLES_API</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0'">$(DefineConstants);AWS_ASYNC_ENUMERABLES_API</DefineConstants>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
<group targetFramework="net472">
<dependency id="AWSSDK.Core" version="4.0.0.0-preview" />
<dependency id="AWSSDK.EC2" version="4.0.0.0-preview" />
<dependency id="Portable.BouncyCastle" version="1.9.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="AWSSDK.Core" version="4.0.0.0-preview" />
<dependency id="AWSSDK.EC2" version="4.0.0.0-preview" />
<dependency id="Portable.BouncyCastle" version="1.9.0" />
</group>
</dependencies>

Expand Down

This file was deleted.

Loading

0 comments on commit 1854e8c

Please sign in to comment.