Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private enum EXECTYPE
// cached metadata
private _SqlMetaDataSet _cachedMetaData;

private Dictionary<int, SqlTceCipherInfoEntry> keysToBeSentToEnclave = new Dictionary<int, SqlTceCipherInfoEntry>();
private Dictionary<int, SqlTceCipherInfoEntry> keysToBeSentToEnclave;
private bool requiresEnclaveComputations = false;
internal EnclavePackage enclavePackage = null;
private SqlEnclaveAttestationParameters enclaveAttestationParameters = null;
Expand Down Expand Up @@ -2994,8 +2994,10 @@ private void ResetEncryptionState()
_parameters[i].HasReceivedMetadata = false;
}
}

keysToBeSentToEnclave.Clear();
if (keysToBeSentToEnclave != null)
{
keysToBeSentToEnclave.Clear();
}
enclavePackage = null;
requiresEnclaveComputations = false;
enclaveAttestationParameters = null;
Expand Down Expand Up @@ -3728,10 +3730,14 @@ private void ReadDescribeEncryptionParameterResults(SqlDataReader ds, ReadOnlyDi
{
throw SQL.InvalidEncryptionKeyOrdinalEnclaveMetadata(requestedKey, columnEncryptionKeyTable.Count);
}

if (!keysToBeSentToEnclave.ContainsKey(currentOrdinal))
if (keysToBeSentToEnclave == null)
{
keysToBeSentToEnclave = new Dictionary<int, SqlTceCipherInfoEntry>();
keysToBeSentToEnclave.Add(currentOrdinal, cipherInfo);
}
else if (!keysToBeSentToEnclave.ContainsKey(currentOrdinal))
{
this.keysToBeSentToEnclave.Add(currentOrdinal, cipherInfo);
keysToBeSentToEnclave.Add(currentOrdinal, cipherInfo);
}

requiresEnclaveComputations = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private enum EXECTYPE
// cached metadata
private _SqlMetaDataSet _cachedMetaData;

private Dictionary<int, SqlTceCipherInfoEntry> keysToBeSentToEnclave = new Dictionary<int, SqlTceCipherInfoEntry>();
private Dictionary<int, SqlTceCipherInfoEntry> keysToBeSentToEnclave;
private bool requiresEnclaveComputations = false;
internal EnclaveDelegate.EnclavePackage enclavePackage = null;
private SqlEnclaveAttestationParameters enclaveAttestationParameters = null;
Expand Down Expand Up @@ -3872,7 +3872,10 @@ private void ResetEncryptionState()
}
}

keysToBeSentToEnclave.Clear();
if (keysToBeSentToEnclave != null)
{
keysToBeSentToEnclave.Clear();
}
enclavePackage = null;
requiresEnclaveComputations = false;
enclaveAttestationParameters = null;
Expand Down Expand Up @@ -4666,9 +4669,14 @@ private void ReadDescribeEncryptionParameterResults(SqlDataReader ds, ReadOnlyDi
throw SQL.InvalidEncryptionKeyOrdinalEnclaveMetadata(requestedKey, columnEncryptionKeyTable.Count);
}

if (!keysToBeSentToEnclave.ContainsKey(currentOrdinal))
if (keysToBeSentToEnclave == null)
{
keysToBeSentToEnclave = new Dictionary<int, SqlTceCipherInfoEntry>();
keysToBeSentToEnclave.Add(currentOrdinal, cipherInfo);
}
else if (!keysToBeSentToEnclave.ContainsKey(currentOrdinal))
{
this.keysToBeSentToEnclave.Add(currentOrdinal, cipherInfo);
keysToBeSentToEnclave.Add(currentOrdinal, cipherInfo);
}

requiresEnclaveComputations = true;
Expand Down