On Tue, 2022-04-05 at 01:23 -0400, Mohamad Al-Jaf wrote:
diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c index cc979a539d2..912f7ef643e 100644 --- a/dlls/ncrypt/main.c +++ b/dlls/ncrypt/main.c @@ -415,8 +415,28 @@ SECURITY_STATUS WINAPI NCryptImportKey(NCRYPT_PROV_HANDLE provider, NCRYPT_KEY_H SECURITY_STATUS WINAPI NCryptIsAlgSupported(NCRYPT_PROV_HANDLE provider, const WCHAR *algid, DWORD flags) {
- FIXME("(%#Ix, %s, %#lx): stub\n", provider, wine_dbgstr_w(algid), flags);
- return NTE_NOT_SUPPORTED;
- NCRYPT_KEY_HANDLE key;
- SECURITY_STATUS status;
- TRACE("(%#Ix, %s, %#lx)\n", provider, wine_dbgstr_w(algid), flags);
- if (!provider) return NTE_INVALID_HANDLE;
- if (!algid) return HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER);
- if (flags == NCRYPT_SILENT_FLAG)
- {
FIXME("Silent flag not implemented\n");
- }
- else if (flags)
- {
ERR("Invalid flags %#lx\n", flags);
return NTE_BAD_FLAGS;
- }
We don't ERR on invalid user input.
- status = NCryptCreatePersistedKey(provider, &key, algid, NULL, 0, 0);
- NCryptFinalizeKey(key, 0);
- NCryptFreeObject(key);
- NCryptFreeObject(provider);
- return status;
}
I think it would better to implement this on top of BCryptEnumAlgorithms(). Also note that you can't free provider here, it's owned by the caller.