properly dispose of cryptography-related classes.

This commit is contained in:
morkt
2016-02-18 02:36:03 +04:00
parent 747f917b44
commit 3e313995d7
2 changed files with 9 additions and 7 deletions

View File

@@ -89,8 +89,9 @@ namespace GameRes.Formats.NScripter
for (int i = 0; i < 16; i++)
hmac_key[i] = (byte)(md5_hash[i] ^ sha1_hash[i]);
var HMAC = new HMACSHA512 (hmac_key);
var hmac_hash = HMAC.ComputeHash (m_key);
byte[] hmac_hash;
using (var HMAC = new HMACSHA512 (hmac_key))
hmac_hash = HMAC.ComputeHash (m_key);
int[] map = Enumerable.Range (0, 256).ToArray();