Skip to content

Commit

Permalink
测试
Browse files Browse the repository at this point in the history
  • Loading branch information
kouzhudong committed Aug 9, 2023
1 parent f72e51b commit 4d1eef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libdrv/signature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NTSTATUS WINAPI EcdsaSignHash(_In_reads_bytes_(PrivateKeyLen) PUCHAR PrivateKey,

NTSTATUS status = STATUS_UNSUCCESSFUL;
BCRYPT_ALG_HANDLE hSignAlg = NULL;
status = BCryptOpenAlgorithmProvider(&hSignAlg, BCRYPT_ECDSA_P256_ALGORITHM, NULL, 0);
status = BCryptOpenAlgorithmProvider(&hSignAlg, BCRYPT_ECDSA_P521_ALGORITHM, NULL, 0);
ASSERT(NT_SUCCESS(status));

BCRYPT_KEY_HANDLE hPrivateKey = NULL;
Expand Down Expand Up @@ -63,7 +63,7 @@ BOOL WINAPI EcdsaVerifySignature(_In_reads_bytes_(PublicKeyLen) PUCHAR PublicKey

NTSTATUS status = STATUS_UNSUCCESSFUL;
BCRYPT_ALG_HANDLE hSignAlg = NULL;
status = BCryptOpenAlgorithmProvider(&hSignAlg, BCRYPT_ECDSA_P256_ALGORITHM, NULL, 0);
status = BCryptOpenAlgorithmProvider(&hSignAlg, BCRYPT_ECDSA_P521_ALGORITHM, NULL, 0);
ASSERT(NT_SUCCESS(status));

BCRYPT_KEY_HANDLE hPublicKey = NULL;
Expand Down
4 changes: 2 additions & 2 deletions test/signature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void TestEcdsaSignature()
*/
{
BCRYPT_ALG_HANDLE hAlgorithm = nullptr;
LPCWSTR AlgId = BCRYPT_ECDSA_P256_ALGORITHM;
LPCWSTR AlgId = BCRYPT_ECDSA_P521_ALGORITHM;
LPCWSTR Implementation = nullptr;
ULONG Flags = 0;
NTSTATUS NtStatus = BCryptOpenAlgorithmProvider(&hAlgorithm, AlgId, Implementation, Flags);
Expand All @@ -33,7 +33,7 @@ void TestEcdsaSignature()
}

BCRYPT_KEY_HANDLE hKey = nullptr;
ULONG Length = 256;
ULONG Length = 521;
NtStatus = BCryptGenerateKeyPair(hAlgorithm, &hKey, Length, 0);
if (STATUS_SUCCESS != NtStatus) {
BCryptCloseAlgorithmProvider(hAlgorithm, 0);
Expand Down

0 comments on commit 4d1eef8

Please sign in to comment.