Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b402b787
Commit
b402b787
authored
Dec 02, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Fix padding bytes check for 0-byte payload.
parent
b5ca0a9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
15 deletions
+7
-15
protectdata.c
dlls/crypt32/tests/protectdata.c
+6
-14
rsaenh.c
dlls/rsaenh/rsaenh.c
+1
-1
No files found.
dlls/crypt32/tests/protectdata.c
View file @
b402b787
...
...
@@ -213,7 +213,7 @@ static void test_cryptunprotectdata(void)
plain
.
cbData
=
0
;
}
static
void
test_simpleroundtrip
(
const
char
*
plaintext
,
int
wine_fails
)
static
void
test_simpleroundtrip
(
const
char
*
plaintext
)
{
DATA_BLOB
input
;
DATA_BLOB
encrypted
;
...
...
@@ -234,17 +234,9 @@ static void test_simpleroundtrip(const char *plaintext, int wine_fails)
}
res
=
pCryptUnprotectData
(
&
encrypted
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
&
output
);
if
(
wine_fails
)
{
todo_wine
ok
(
res
!=
0
,
"can't unprotect; last error %u
\n
"
,
GetLastError
());
}
else
{
ok
(
res
!=
0
,
"can't unprotect; last error %u
\n
"
,
GetLastError
());
}
if
(
res
)
{
ok
(
output
.
cbData
==
strlen
(
plaintext
),
"output wrong length %d for input '%s', wanted %d
\n
"
,
output
.
cbData
,
plaintext
,
strlen
(
plaintext
));
ok
(
!
memcmp
(
plaintext
,
(
char
*
)
output
.
pbData
,
output
.
cbData
),
"output wrong contents for input '%s'
\n
"
,
plaintext
);
}
ok
(
res
!=
0
,
"can't unprotect; last error %u
\n
"
,
GetLastError
());
ok
(
output
.
cbData
==
strlen
(
plaintext
),
"output wrong length %d for input '%s', wanted %d
\n
"
,
output
.
cbData
,
plaintext
,
strlen
(
plaintext
));
ok
(
!
memcmp
(
plaintext
,
(
char
*
)
output
.
pbData
,
output
.
cbData
),
"output wrong contents for input '%s'
\n
"
,
plaintext
);
}
START_TEST
(
protectdata
)
...
...
@@ -262,8 +254,8 @@ START_TEST(protectdata)
protected
=
FALSE
;
test_cryptprotectdata
();
test_cryptunprotectdata
();
test_simpleroundtrip
(
""
,
1
);
test_simpleroundtrip
(
"hello"
,
0
);
test_simpleroundtrip
(
""
);
test_simpleroundtrip
(
"hello"
);
/* deinit globals here */
if
(
cipher
.
pbData
)
LocalFree
(
cipher
.
pbData
);
...
...
dlls/rsaenh/rsaenh.c
View file @
b402b787
...
...
@@ -2324,7 +2324,7 @@ BOOL WINAPI RSAENH_CPDecrypt(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash,
if
(
Final
)
{
if
(
pbData
[
*
pdwDataLen
-
1
]
&&
pbData
[
*
pdwDataLen
-
1
]
<=
pCryptKey
->
dwBlockLen
&&
pbData
[
*
pdwDataLen
-
1
]
<
*
pdwDataLen
)
{
pbData
[
*
pdwDataLen
-
1
]
<
=
*
pdwDataLen
)
{
BOOL
padOkay
=
TRUE
;
/* check that every bad byte has the same value */
...
...
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