Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmcdonald3 committed Oct 2, 2024
1 parent 6db2fa9 commit 18694c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/library_interop_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,6 @@ jobs:
# # # NET_41_VECTOR_PATH=$GITHUB_WORKSPACE/net41/vectors
# # Set-Location -Path "$env:GITHUB_WORKSPACE\net41\vectors"
# # Compress-Archive -Path "$env:GITHUB_WORKSPACE\net41\vectors\*" -DestinationPath "$env:GITHUB_WORKSPACE\net41\vectors\net41.zip"

- name: Fetch Python 2.3.0 Test Vectors
working-directory: ./
shell: bash
run: |
PYTHON_23_VECTOR_PATH=$GITHUB_WORKSPACE/python23/vectors
mkdir -p $PYTHON_23_VECTOR_PATH
DOWNLOAD_NAME=python23.zip
curl --no-progress-meter --output $DOWNLOAD_NAME --location $VECTORS_URL
unzip -o -qq $DOWNLOAD_NAME -d $PYTHON_23_VECTOR_PATH
rm $DOWNLOAD_NAME

- name: Generate Test Vectors with .NET Framework net6.0
# TODO Post-#619: Fix Zip file creation on Windows
Expand All @@ -214,8 +203,6 @@ jobs:
NET_41_VECTOR_PATH=net41/vectors
mkdir -p $NET_41_VECTOR_PATH
GEN_PATH=runtimes/net/TestVectorsNative/TestVectorGenerator
PYTHON_23_VECTOR_PATH=$GITHUB_WORKSPACE/python23/vectors
DAFNY_AWS_ESDK_TEST_VECTOR_MANIFEST_PATH="$PYTHON_23_VECTOR_PATH/manifest.json" \
dotnet run --project $GEN_PATH --framework net6.0 -- \
--encrypt-manifest $GEN_PATH/resources/0006-awses-message-decryption-generation.v2.json \
--output-dir $NET_41_VECTOR_PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,6 @@ private static IKeyring CreateKeyring(MasterKey keyInfo, Key key, CryptoOperatio
}

if (keyInfo.Type == "aws-kms-hierarchy") {
// Convert JSON to bytes for KeyVectors input
string jsonString = JsonConvert.SerializeObject(keyInfo);

var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write(jsonString);
writer.Flush();
stream.Position = 0;

// Create KeyVectors keyring
var getKeyDescriptionInput = new GetKeyDescriptionInput
{
Json = stream
};

// Lazily create a singleton KeyVectors client.
// KeyVectors manifest is only required if a test vector specifies a hierarchy keyring.
Expand All @@ -202,6 +188,21 @@ private static IKeyring CreateKeyring(MasterKey keyInfo, Key key, CryptoOperatio
singletonKeyVectors = new(keyVectorsConfig);
}

// Convert JSON to bytes for KeyVectors input
string jsonString = JsonConvert.SerializeObject(keyInfo);

var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write(jsonString);
writer.Flush();
stream.Position = 0;

// Create KeyVectors keyring
var getKeyDescriptionInput = new GetKeyDescriptionInput
{
Json = stream
};

var desc = singletonKeyVectors.GetKeyDescription(getKeyDescriptionInput);

var testVectorKeyringInput = new TestVectorKeyringInput
Expand Down

0 comments on commit 18694c1

Please sign in to comment.