Skip to content

Commit b1f9acf

Browse files
authored
fix: Dispose of the crypto transform (#99)
ICryptoTransform is disposable. this PR ensures we properly dispose
1 parent f9afe5a commit b1f9acf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Darp.Ble/AesCmac.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public AesCmac(ReadOnlySpan<byte> key)
3131
/// <returns> The encrypted message. Always of length 16 </returns>
3232
public byte[] Encrypt(ReadOnlySpan<byte> message)
3333
{
34-
ICryptoTransform encryptor = _aes.CreateEncryptor();
34+
using ICryptoTransform encryptor = _aes.CreateEncryptor();
3535

3636
// Step 1
3737
Span<byte> subKey1 = stackalloc byte[16];

0 commit comments

Comments
 (0)