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
035c3230
Commit
035c3230
authored
Dec 05, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Dec 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Fix memory leak in CPSignHash.
parent
cdbf6e86
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
rsaenh.c
dlls/rsaenh/rsaenh.c
+14
-9
No files found.
dlls/rsaenh/rsaenh.c
View file @
035c3230
...
...
@@ -4162,11 +4162,12 @@ BOOL WINAPI RSAENH_CPSignHash(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwKeySpe
LPCWSTR
sDescription
,
DWORD
dwFlags
,
BYTE
*
pbSignature
,
DWORD
*
pdwSigLen
)
{
HCRYPTKEY
hCryptKey
;
HCRYPTKEY
hCryptKey
=
(
HCRYPTKEY
)
INVALID_HANDLE_VALUE
;
CRYPTKEY
*
pCryptKey
;
DWORD
dwHashLen
;
BYTE
abHashValue
[
RSAENH_MAX_HASH_SIZE
];
ALG_ID
aiAlgid
;
BOOL
ret
=
FALSE
;
TRACE
(
"(hProv=%08lx, hHash=%08lx, dwKeySpec=%08x, sDescription=%s, dwFlags=%08x, "
"pbSignature=%p, pdwSigLen=%p)
\n
"
,
hProv
,
hHash
,
dwKeySpec
,
debugstr_w
(
sDescription
),
...
...
@@ -4183,18 +4184,19 @@ BOOL WINAPI RSAENH_CPSignHash(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwKeySpe
(
OBJECTHDR
**
)
&
pCryptKey
))
{
SetLastError
(
NTE_NO_KEY
);
return
FALSE
;
goto
out
;
}
if
(
!
pbSignature
)
{
*
pdwSigLen
=
pCryptKey
->
dwKeyLen
;
return
TRUE
;
ret
=
TRUE
;
goto
out
;
}
if
(
pCryptKey
->
dwKeyLen
>
*
pdwSigLen
)
{
SetLastError
(
ERROR_MORE_DATA
);
*
pdwSigLen
=
pCryptKey
->
dwKeyLen
;
return
FALSE
;
goto
out
;
}
*
pdwSigLen
=
pCryptKey
->
dwKeyLen
;
...
...
@@ -4202,22 +4204,25 @@ BOOL WINAPI RSAENH_CPSignHash(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwKeySpe
if
(
!
RSAENH_CPHashData
(
hProv
,
hHash
,
(
CONST
BYTE
*
)
sDescription
,
(
DWORD
)
lstrlenW
(
sDescription
)
*
sizeof
(
WCHAR
),
0
))
{
return
FALSE
;
goto
out
;
}
}
dwHashLen
=
sizeof
(
DWORD
);
if
(
!
RSAENH_CPGetHashParam
(
hProv
,
hHash
,
HP_ALGID
,
(
BYTE
*
)
&
aiAlgid
,
&
dwHashLen
,
0
))
return
FALSE
;
if
(
!
RSAENH_CPGetHashParam
(
hProv
,
hHash
,
HP_ALGID
,
(
BYTE
*
)
&
aiAlgid
,
&
dwHashLen
,
0
))
goto
out
;
dwHashLen
=
RSAENH_MAX_HASH_SIZE
;
if
(
!
RSAENH_CPGetHashParam
(
hProv
,
hHash
,
HP_HASHVAL
,
abHashValue
,
&
dwHashLen
,
0
))
return
FALSE
;
if
(
!
RSAENH_CPGetHashParam
(
hProv
,
hHash
,
HP_HASHVAL
,
abHashValue
,
&
dwHashLen
,
0
))
goto
out
;
if
(
!
build_hash_signature
(
pbSignature
,
*
pdwSigLen
,
aiAlgid
,
abHashValue
,
dwHashLen
,
dwFlags
))
{
return
FALSE
;
goto
out
;
}
return
encrypt_block_impl
(
pCryptKey
->
aiAlgid
,
PK_PRIVATE
,
&
pCryptKey
->
context
,
pbSignature
,
pbSignature
,
RSAENH_ENCRYPT
);
ret
=
encrypt_block_impl
(
pCryptKey
->
aiAlgid
,
PK_PRIVATE
,
&
pCryptKey
->
context
,
pbSignature
,
pbSignature
,
RSAENH_ENCRYPT
);
out:
RSAENH_CPDestroyKey
(
hProv
,
hCryptKey
);
return
ret
;
}
/******************************************************************************
...
...
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