mheyman / Isopoh.Cryptography.Argon2

Fully managed .Net Core implementation of Argon2
Other
196 stars 9 forks source link

Unable to load DLL 'kernel32.dll' #9

Closed lust4life closed 6 years ago

lust4life commented 6 years ago
DllNotFoundException: Unable to load DLL 'kernel32.dll': The specified module or one of its dependencies could not be found.
(Exception from HRESULT: 0x8007007E)
Isopoh.Cryptography.SecureArray.SecureArray.GetModuleHandle(string moduleName)

TypeInitializationException: The type initializer for 'Isopoh.Cryptography.SecureArray.SecureArray' threw an exception.
Isopoh.Cryptography.Argon2.Argon2.Verify(string encoded, string password, SecureArrayCall secureArrayCall)

dotnet core : 2.1.4 os : mac os x 10.13.3

don't work on mac os , is there anything i can do to handle this ?

mheyman commented 6 years ago

It turns out this is a known issue - I had used System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform() for platform detection and that fails depending on the way you deploy. See https://github.com/dotnet/corefx/issues/3032.

I've implemented a fix based on https://stackoverflow.com/a/38795621 which requires moving SecureArray from netstandard1.1 to 1.3 because it checks file system information to determine OS.

I don't have an OSX box to test on, however. I've pushed the fix to github and will get the Nuget packages out as soon as I can.