1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-25 02:49:52 +03:00

Mayaqua/Secure.h: add support for the OpenSC PKCS#11 module

This commit is contained in:
Davide Beatrici 2018-10-30 23:14:17 +01:00
parent 080edcdb81
commit 77e4bbb493
2 changed files with 9 additions and 0 deletions

View File

@ -156,6 +156,7 @@ HINSTANCE Win32SecureLoadLibraryEx(char *dllname, DWORD flags)
char tmp1[MAX_PATH]; char tmp1[MAX_PATH];
char tmp2[MAX_PATH]; char tmp2[MAX_PATH];
char tmp3[MAX_PATH]; char tmp3[MAX_PATH];
char tmp4[MAX_PATH];
HINSTANCE h; HINSTANCE h;
// Validate arguments // Validate arguments
if (dllname == NULL) if (dllname == NULL)
@ -166,6 +167,7 @@ HINSTANCE Win32SecureLoadLibraryEx(char *dllname, DWORD flags)
Format(tmp1, sizeof(tmp1), "%s\\%s", MsGetSystem32Dir(), dllname); Format(tmp1, sizeof(tmp1), "%s\\%s", MsGetSystem32Dir(), dllname);
Format(tmp2, sizeof(tmp2), "%s\\JPKI\\%s", MsGetProgramFilesDir(), dllname); Format(tmp2, sizeof(tmp2), "%s\\JPKI\\%s", MsGetProgramFilesDir(), dllname);
Format(tmp3, sizeof(tmp3), "%s\\LGWAN\\%s", MsGetProgramFilesDir(), dllname); Format(tmp3, sizeof(tmp3), "%s\\LGWAN\\%s", MsGetProgramFilesDir(), dllname);
Format(tmp4, sizeof(tmp4), "%s\\OpenSC Project\\OpenSC\\pkcs11\\%s", MsGetProgramFilesDir(), dllname);
h = LoadLibraryEx(dllname, NULL, flags); h = LoadLibraryEx(dllname, NULL, flags);
if (h != NULL) if (h != NULL)
@ -191,6 +193,12 @@ HINSTANCE Win32SecureLoadLibraryEx(char *dllname, DWORD flags)
return h; return h;
} }
h = LoadLibraryEx(tmp4, NULL, flags);
if (h != NULL)
{
return h;
}
return NULL; return NULL;
} }

View File

@ -309,6 +309,7 @@ SECURE_DEVICE SupportedList[] =
{21, SECURE_USB_TOKEN, "ePass 1000ND/2000/3000", "Feitian Technologies", "ngp11v211.dll"}, {21, SECURE_USB_TOKEN, "ePass 1000ND/2000/3000", "Feitian Technologies", "ngp11v211.dll"},
{22, SECURE_USB_TOKEN, "CryptoID", "Longmai Technology", "cryptoide_pkcs11.dll"}, {22, SECURE_USB_TOKEN, "CryptoID", "Longmai Technology", "cryptoide_pkcs11.dll"},
{23, SECURE_USB_TOKEN, "RuToken", "Aktiv Co.", "rtPKCS11.dll"}, {23, SECURE_USB_TOKEN, "RuToken", "Aktiv Co.", "rtPKCS11.dll"},
{24, SECURE_USB_TOKEN, "OpenSC", "OpenSC Project", "opensc-pkcs11.dll"}
}; };
#ifdef OS_WIN32 #ifdef OS_WIN32