Re: [PATCH] bcrypt: Added stub implementation for BCryptGetFipsAlgorithmMode
Kai Blaschke <kai.blaschke(a)kb-dev.net> wrote:
diff --git a/dlls/bcrypt/tests/Makefile.in b/dlls/bcrypt/tests/Makefile.in new file mode 100644 index 0000000..363986e --- /dev/null +++ b/dlls/bcrypt/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = bcrypt.dll +IMPORTS = user32 gdi32 bcrypt
user32 and gdi32 APIs are not used in the test and should be removed from the imports list.
+static void test_getFipsAlgorithmMode(void) +{ + BOOLEAN result = TRUE; + NTSTATUS status = BCryptGetFipsAlgorithmMode(&result); + ok(!status, "expected status STATUS_SUCCESS(0), got %d\n", status); + ok(!result, "expected result FALSE, got %d\n", result); +}
Probably BCryptGetFipsAlgorithmMode should be loaded dynamically. A usual test for invalid (NULL) argument would be useful. Also status should be printed in hex to match ntstatus.h definitions. -- Dmitry.
Dmitry Timoshkov <dmitry(a)baikal.ru> wrote:
user32 and gdi32 APIs are not used in the test and should be removed from the imports list.
Probably BCryptGetFipsAlgorithmMode should be loaded dynamically. A usual test for invalid (NULL) argument would be useful. Also status should be printed in hex to match ntstatus.h definitions.
Valid points, consider it done. Additionally, I did some quick research about the implementation of BCryptGetFipsAlgorithmMode, and all it actually does is querying two registry keys, as documented in the Windows knowledge base article 811833 (http://support.microsoft.com/kb/811833/en-us). I'm going to implement this properly instead of a stub, and also add a NULL pointer check for pfEnabled, returning STATUS_INVALID_PARAMETER if it fails. Scrub my patch, I'll send in a new one. -- Kai
participants (2)
-
Dmitry Timoshkov -
Kai Blaschke