Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ba06731c
Commit
ba06731c
authored
Jun 29, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jun 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dssenh/tests: Add tests for the default encryption chaining mode.
parent
3a2db918
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
dssenh.c
dlls/dssenh/tests/dssenh.c
+21
-0
No files found.
dlls/dssenh/tests/dssenh.c
View file @
ba06731c
...
...
@@ -704,6 +704,27 @@ static void test_cipher_modes(const struct ciphermode_test *tests, int testLen)
result
=
CryptDestroyHash
(
hHash
);
ok
(
result
,
"Expected destruction of hash after deriving key.
\n
"
);
/* the default algorithm is CBC, test that without setting a mode */
mode
=
0xdeadbeef
;
dataLen
=
sizeof
(
mode
);
result
=
CryptGetKeyParam
(
pKey
,
KP_MODE
,
(
BYTE
*
)
&
mode
,
&
dataLen
,
0
);
ok
(
result
,
"Expected getting of KP_MODE, got %x.
\n
"
,
GetLastError
());
ok
(
mode
==
CRYPT_MODE_CBC
,
"Default mode should be CBC
\n
"
);
memcpy
(
pbData
,
plainText
,
plainLen
);
dataLen
=
plainLen
;
result
=
CryptEncrypt
(
pKey
,
0
,
TRUE
,
0
,
pbData
,
&
dataLen
,
36
);
ok
(
result
,
"Expected data encryption, got %x.
\n
"
,
GetLastError
());
/* Verify we have the correct encrypted data */
ok
(
!
memcmp
(
pbData
,
tests
[
1
].
encrypted
,
dataLen
),
"Incorrect encrypted data.
\n
"
);
result
=
CryptDecrypt
(
pKey
,
0
,
TRUE
,
0
,
pbData
,
&
dataLen
);
ok
(
result
,
"Expected data decryption, got %x.
\n
"
,
GetLastError
());
/* Verify we have the correct decrypted data */
ok
(
!
memcmp
(
pbData
,
(
BYTE
*
)
plainText
,
dataLen
),
"Incorrect decrypted data.
\n
"
);
/* test block cipher modes */
for
(
i
=
0
;
i
<
testLen
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment