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
f0e2cba4
Commit
f0e2cba4
authored
Oct 31, 2011
by
Juan Lang
Committed by
Alexandre Julliard
Nov 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Test importing a key with an input buffer that's too small for the key it contains.
parent
54b972e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+19
-1
No files found.
dlls/rsaenh/tests/rsaenh.c
View file @
f0e2cba4
...
...
@@ -1516,7 +1516,9 @@ static void test_import_private(void)
0x40
,
0x64
,
0x28
,
0xe8
,
0x8a
,
0xe7
,
0xa4
,
0xd4
,
0x1c
,
0xfd
,
0xde
,
0x71
};
BLOBHEADER
*
blobHeader
=
(
BLOBHEADER
*
)
abPlainPrivateKey
;
RSAPUBKEY
*
rsaPubKey
=
(
RSAPUBKEY
*
)(
blobHeader
+
1
);
dwLen
=
(
DWORD
)
sizeof
(
abPlainPrivateKey
);
result
=
CryptImportKey
(
hProv
,
abPlainPrivateKey
,
dwLen
,
0
,
0
,
&
hKeyExchangeKey
);
if
(
!
result
)
{
...
...
@@ -1561,6 +1563,22 @@ static void test_import_private(void)
CryptDestroyKey
(
hSessionKey
);
CryptDestroyKey
(
hKeyExchangeKey
);
/* Test importing a private key with a buffer that's smaller than the
* actual buffer. The private exponent can be omitted, its length is
* inferred from the passed-in length parameter.
*/
dwLen
=
sizeof
(
BLOBHEADER
)
+
sizeof
(
RSAPUBKEY
)
+
rsaPubKey
->
bitlen
/
8
+
5
*
rsaPubKey
->
bitlen
/
16
;
for
(;
dwLen
<
sizeof
(
abPlainPrivateKey
);
dwLen
++
)
{
result
=
CryptImportKey
(
hProv
,
abPlainPrivateKey
,
dwLen
,
0
,
0
,
&
hKeyExchangeKey
);
todo_wine
ok
(
result
,
"CryptImportKey failed at size %d: %d (%08x)
\n
"
,
dwLen
,
GetLastError
(),
GetLastError
());
if
(
result
)
CryptDestroyKey
(
hKeyExchangeKey
);
}
}
static
void
test_verify_signature
(
void
)
{
...
...
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