-
18067af2
by Sven Püschel at 2024-08-19T21:03:29+02:00
dssenh/tests: Remove skipping sign tests.
As the signature verification is already implemented, there is no more
need to skip the signature tests.
This may be related to the VerifySignature following fix:
1d0551ca49f ("dssenh: Finalize the hash if necessary in CPVerifySignature().")
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
5ab07d4e
by Sven Püschel at 2024-08-19T21:03:33+02:00
dssenh/tests: Remove unnecessary verify test cases.
Testing with two simple sentences as strings is redundant. Testing a
common input (sentence) is enough and all other inputs should be edge
cases like empty strings, min/max integer values, etc.
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
29000c0f
by Sven Püschel at 2024-08-19T21:03:34+02:00
dssenh/tests: Move test loop out of sub function.
Move the test loop out of the test_signhash_array function to allow
splitting the function into parts without duplicating the loop.
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
5d114397
by Sven Püschel at 2024-08-19T21:03:36+02:00
dssenh/tests: Remove redundant hash test.
Don't test the hashes to be equal before creating a signature. The
correct hash generation is already tested in the test_hash function.
Also reordered the hash creation and destruction, so that one HCRYPTHASH
variable is enough.
Furthermore removing this check caused the signature verification to
fail. Testing on a Windows 10 machine reveals that this is a wine bug.
Therefore marked the signature verification as todo_wine.
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
7d2ba383
by Sven Püschel at 2024-08-19T21:03:37+02:00
dssenh: Finish hash in the SignHash function.
Finish the Hash before trying to sign it, as Windows will also allow
this behaviour.
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
15c070de
by Sven Püschel at 2024-08-19T21:03:38+02:00
dssenh/tests: Fix signLen usage.
Remove the use of signLen to store the input data length. The variable
is used to store the generated signature length. Also using the
ARRAY_SIZE macro instead of the signLen, as in case of the signLen
returning an invalid value, we would compare or sign memory outside of
the arrays (as the failing length test check won't abort the whole
test).
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
dd6af54f
by Sven Püschel at 2024-08-19T21:03:40+02:00
dssenh/tests: Set 0xdeadbeef last error before function execution.
Set 0xdeadbeef as the last error before exection of a function, as it is
a common pattern to distinguish if the output was from the failing
function or from the previous executed function.
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
d361b8cd
by Sven Püschel at 2024-08-19T21:03:41+02:00
dssenh/tests: Remove redundant signature verification.
Don't verify the second signature, as the signature has identical inputs
as the first signature. The reason for two identical signature inputs is
to test the same input generates different signatures.
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
949fefea
by Sven Püschel at 2024-08-19T21:03:42+02:00
dssenh/tests: Separate the public key export from the signhash test.
Separate the exporting of the public key out of the signhash test. As
VerifySignature can also use a privete key, the conversion of the
private key to a public key is removed.
The public key export is kept and moved to a separate test. A
precalculated public key is used to check, that the output format is
correct.
Furthermore change the test_verify_signature -> test_signature as the
test only tested primarely the SignHash function and only used
VerifySignature to check the generated signature is valid.
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
b2de1260
by Sven Püschel at 2024-08-19T21:03:44+02:00
dssenh/tests: Add test for VerifySignatureA.
Add a test for the VerifySignatureA function. Currently the tests only
use VerifySignatureA to verify the signature generation functions. But
this doesn't test if the signature format is correct. Therefore
including signatures generated on a Windows 10 machine test run to check
that Wine can also verify these correctly.
As wine currently fails to verify these signatures, the tests are marked
as todo_wine.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55936
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>
-
0fe7520e
by Sven Püschel at 2024-08-19T21:03:46+02:00
dssenh: Swap the endianness of the signature.
Swap the endianess of the r and s integers of the signature. These are
expected to be little-endian in the dssenh API, but the BCrypt API uses
big endian integers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55936
Signed-off-by: Sven Püschel <Sven Püschel@akarisu.de>