Skip to content

Commit 08ba4cf

Browse files
committed
Mono doesn't have BCrypt.dll
1 parent e7cb93d commit 08ba4cf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Renci.SshNet/Security/Cryptography/Ciphers/AesGcmCipher.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@ public AesGcmCipher(byte[] key, byte[] iv, int aadLength)
6565
#if !NETSTANDARD
6666
if (System.Security.Cryptography.AesGcm.IsSupported)
6767
{
68-
_impl = new BclImpl(key, _iv);
68+
try
69+
{
70+
_impl = new BclImpl(key, _iv);
71+
}
72+
catch (DllNotFoundException)
73+
{
74+
// Mono doesn't have BCrypt.dll
75+
_impl = new BouncyCastleImpl(key, _iv);
76+
}
6977
}
7078
else
7179
#endif

0 commit comments

Comments
 (0)