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
f5c687e3
Commit
f5c687e3
authored
Jul 23, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jul 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: CALG_AES cannot be used if the key length was not specified.
parent
453d6dc1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
rsaenh.c
dlls/rsaenh/rsaenh.c
+9
-1
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+0
-17
No files found.
dlls/rsaenh/rsaenh.c
View file @
f5c687e3
...
...
@@ -780,7 +780,7 @@ static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTK
{
HCRYPTKEY
hCryptKey
;
CRYPTKEY
*
pCryptKey
;
DWORD
dwKeyLen
=
HIWORD
(
dwFlags
);
DWORD
dwKeyLen
=
HIWORD
(
dwFlags
)
,
bKeyLen
=
dwKeyLen
;
const
PROV_ENUMALGS_EX
*
peaAlgidInfo
;
*
ppCryptKey
=
NULL
;
...
...
@@ -839,6 +839,14 @@ static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTK
*/
break
;
case
CALG_AES
:
if
(
!
bKeyLen
)
{
TRACE
(
"missing key len for CALG_AES
\n
"
);
SetLastError
(
NTE_BAD_ALGID
);
return
(
HCRYPTKEY
)
INVALID_HANDLE_VALUE
;
}
/* fall through */
default:
if
(
dwKeyLen
%
8
||
dwKeyLen
>
peaAlgidInfo
->
dwMaxLen
||
...
...
dlls/rsaenh/tests/rsaenh.c
View file @
f5c687e3
...
...
@@ -3511,13 +3511,6 @@ static void test_key_derivation(const char *prov)
/* 47 */
},
};
/* Temporary struct to hold wine broken cases */
struct
broken
{
int
mode
,
exp_data
,
blen
;
}
wine_broken
[
sizeof
(
tests
)
/
sizeof
(
tests
[
0
])];
/* Due to differences between encryption from <= 2000 and >= XP some tests need to be skipped */
int
old_broken
[
sizeof
(
tests
)
/
sizeof
(
tests
[
0
])];
memset
(
old_broken
,
0
,
sizeof
(
old_broken
));
...
...
@@ -3525,10 +3518,6 @@ static void test_key_derivation(const char *prov)
old_broken
[
27
]
=
old_broken
[
28
]
=
old_broken
[
39
]
=
old_broken
[
40
]
=
1
;
uniquecontainer
(
NULL
);
memset
(
wine_broken
,
0
,
sizeof
(
wine_broken
));
wine_broken
[
8
].
mode
=
wine_broken
[
8
].
blen
=
1
;
wine_broken
[
20
]
=
wine_broken
[
32
]
=
wine_broken
[
44
]
=
wine_broken
[
8
];
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
if
(
win2k
&&
old_broken
[
i
])
continue
;
...
...
@@ -3567,23 +3556,17 @@ static void test_key_derivation(const char *prov)
mode
=
0xdeadbeef
;
result
=
CryptGetKeyParam
(
hKey
,
KP_MODE
,
(
BYTE
*
)
&
mode
,
&
len
,
0
);
ok
(
result
,
"Test [%s %d]: CryptGetKeyParam failed with error %08x
\n
"
,
prov
,
i
,
GetLastError
());
if
(
wine_broken
[
i
].
mode
)
winetest_start_todo
(
"wine"
);
ok
(
mode
==
tests
[
i
].
chain_mode
,
"Test [%s %d]: Expected chaining mode %d, got %d
\n
"
,
prov
,
i
,
tests
[
i
].
chain_mode
,
mode
);
if
(
wine_broken
[
i
].
mode
)
winetest_end_todo
(
"wine"
);
SetLastError
(
0xdeadbeef
);
len
=
4
;
result
=
CryptEncrypt
(
hKey
,
0
,
TRUE
,
0
,
dvData
,
&
len
,
sizeof
(
dvData
));
ok
(
result
,
"Test [%s %d]: CryptEncrypt failed with error 0x%08x
\n
"
,
prov
,
i
,
GetLastError
());
if
(
wine_broken
[
i
].
blen
)
winetest_start_todo
(
"wine"
);
ok
(
len
==
tests
[
i
].
blocklen
,
"Test [%s %d]: Expected block len %d, got %d
\n
"
,
prov
,
i
,
tests
[
i
].
blocklen
,
len
);
if
(
wine_broken
[
i
].
blen
)
winetest_end_todo
(
"wine"
);
if
(
wine_broken
[
i
].
exp_data
)
winetest_start_todo
(
"wine"
);
ok
(
!
memcmp
(
dvData
,
tests
[
i
].
expected_enc
,
tests
[
i
].
blocklen
),
"Test [%s %d]: Encrypted data comparison failed
\n
"
,
prov
,
i
);
if
(
wine_broken
[
i
].
exp_data
)
winetest_end_todo
(
"wine"
);
CryptDestroyKey
(
hKey
);
err:
...
...
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