Skip to content

Commit d246350

Browse files
committed
CDRIVER-3352: Improve parameter names for C# libmongocrypt wrapper
1 parent 518f9a2 commit d246350

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public void EncryptExplicitStepwise()
230230
using (var context = cryptClient.StartExplicitEncryptionContext(
231231
key: key,
232232
encryptionAlgorithm: EncryptionAlgorithm.AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic,
233-
command: testData))
233+
message: testData))
234234
{
235235
var (state, binaryProduced, operationProduced) = ProcessState(context);
236236
state.Should().Be(CryptContext.StateCode.MONGOCRYPT_CTX_NEED_MONGO_KEYS);

bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public CryptContext StartEncryptionContext(string db, byte[] command)
9393
/// </summary>
9494
/// <param name="key">The key.</param>
9595
/// <param name="encryptionAlgorithm">The encryption algorithm.</param>
96-
/// <param name="command">The BSON command.</param>
96+
/// <param name="message">The BSON message.</param>
9797
/// <returns>A encryption context. </returns>
98-
public CryptContext StartExplicitEncryptionContext(Guid key, EncryptionAlgorithm encryptionAlgorithm, byte[] command)
98+
public CryptContext StartExplicitEncryptionContext(Guid key, EncryptionAlgorithm encryptionAlgorithm, byte[] message)
9999
{
100100
ContextSafeHandle handle = Library.mongocrypt_ctx_new(_handle);
101101

@@ -116,10 +116,10 @@ public CryptContext StartExplicitEncryptionContext(Guid key, EncryptionAlgorithm
116116

117117
unsafe
118118
{
119-
fixed (byte* p = command)
119+
fixed (byte* p = message)
120120
{
121121
IntPtr ptr = (IntPtr)p;
122-
using (PinnedBinary pinned = new PinnedBinary(ptr, (uint)command.Length))
122+
using (PinnedBinary pinned = new PinnedBinary(ptr, (uint)message.Length))
123123
{
124124
handle.Check(_status, Library.mongocrypt_ctx_explicit_encrypt_init(handle, pinned.Handle));
125125
}
@@ -134,9 +134,9 @@ public CryptContext StartExplicitEncryptionContext(Guid key, EncryptionAlgorithm
134134
/// </summary>
135135
/// <param name="keyAltName">The alternative key name.</param>
136136
/// <param name="encryptionAlgorithm">The algorithm.</param>
137-
/// <param name="command">The BSON command.</param>
137+
/// <param name="message">The BSON message.</param>
138138
/// <returns>A encryption context. </returns>
139-
public CryptContext StartExplicitEncryptionContext(byte[] keyAltName, EncryptionAlgorithm encryptionAlgorithm, byte[] command)
139+
public CryptContext StartExplicitEncryptionContext(byte[] keyAltName, EncryptionAlgorithm encryptionAlgorithm, byte[] message)
140140
{
141141
ContextSafeHandle handle = Library.mongocrypt_ctx_new(_handle);
142142
unsafe
@@ -155,10 +155,10 @@ public CryptContext StartExplicitEncryptionContext(byte[] keyAltName, Encryption
155155

156156
unsafe
157157
{
158-
fixed (byte* p = command)
158+
fixed (byte* p = message)
159159
{
160160
IntPtr ptr = (IntPtr)p;
161-
using (PinnedBinary pinned = new PinnedBinary(ptr, (uint)command.Length))
161+
using (PinnedBinary pinned = new PinnedBinary(ptr, (uint)message.Length))
162162
{
163163
handle.Check(_status, Library.mongocrypt_ctx_explicit_encrypt_init(handle, pinned.Handle));
164164
}

0 commit comments

Comments
 (0)