未验证 提交 44bb2ad6 编写于 作者: O Oded Hanson 提交者: GitHub

Dispose transient CFData in Interop.AppleCrypto.X509GetRawData

上级 0cdd423f
......@@ -55,18 +55,21 @@ internal static byte[] X509GetRawData(SafeSecCertificateHandle cert)
out data,
out osStatus);
if (ret == 1)
using (data)
{
return CoreFoundation.CFGetData(data);
if (ret == 1)
{
return CoreFoundation.CFGetData(data);
}
if (ret == 0)
{
throw CreateExceptionForOSStatus(osStatus);
}
Debug.Fail($"Unexpected return value {ret}");
throw new CryptographicException();
}
if (ret == 0)
{
throw CreateExceptionForOSStatus(osStatus);
}
Debug.Fail($"Unexpected return value {ret}");
throw new CryptographicException();
}
internal static SafeSecKeyRefHandle X509GetPrivateKeyFromIdentity(SafeSecIdentityHandle identity)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册