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
07232b38
Commit
07232b38
authored
Oct 02, 2018
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Oct 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Move PKCS1 padding and unpadding functions.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8a2c0b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
6 deletions
+48
-6
rsaenh.c
dlls/rsaenh/rsaenh.c
+48
-6
No files found.
dlls/rsaenh/rsaenh.c
View file @
07232b38
...
...
@@ -1655,7 +1655,7 @@ exit:
}
/******************************************************************************
* pad_data [Internal]
* pad_data
_pkcs1
[Internal]
*
* Helper function for data padding according to PKCS1 #2
*
...
...
@@ -1670,8 +1670,7 @@ exit:
* Success: TRUE
* Failure: FALSE (NTE_BAD_LEN, too much data to pad)
*/
static
BOOL
pad_data
(
const
BYTE
*
abData
,
DWORD
dwDataLen
,
BYTE
*
abBuffer
,
DWORD
dwBufferLen
,
DWORD
dwFlags
)
static
BOOL
pad_data_pkcs1
(
const
BYTE
*
abData
,
DWORD
dwDataLen
,
BYTE
*
abBuffer
,
DWORD
dwBufferLen
,
DWORD
dwFlags
)
{
DWORD
i
;
...
...
@@ -1696,7 +1695,29 @@ static BOOL pad_data(const BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWORD
}
/******************************************************************************
* unpad_data [Internal]
* pad_data [Internal]
*
* Helper function for data padding according to padding format
*
* PARAMS
* abData [I] The data to be padded
* dwDataLen [I] Length of the data
* abBuffer [O] Padded data will be stored here
* dwBufferLen [I] Length of the buffer (also length of padded data)
* dwFlags [I] 0 or CRYPT_SSL2_FALLBACK
*
* RETURN
* Success: TRUE
* Failure: FALSE
*/
static
BOOL
pad_data
(
const
BYTE
*
abData
,
DWORD
dwDataLen
,
BYTE
*
abBuffer
,
DWORD
dwBufferLen
,
DWORD
dwFlags
)
{
return
pad_data_pkcs1
(
abData
,
dwDataLen
,
abBuffer
,
dwBufferLen
,
dwFlags
);
}
/******************************************************************************
* unpad_data_pkcs1 [Internal]
*
* Remove the PKCS1 padding from RSA decrypted data
*
...
...
@@ -1711,8 +1732,7 @@ static BOOL pad_data(const BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWORD
* Success: TRUE
* Failure: FALSE, (NTE_BAD_DATA, no valid PKCS1 padding or buffer too small)
*/
static
BOOL
unpad_data
(
const
BYTE
*
abData
,
DWORD
dwDataLen
,
BYTE
*
abBuffer
,
DWORD
*
dwBufferLen
,
DWORD
dwFlags
)
static
BOOL
unpad_data_pkcs1
(
const
BYTE
*
abData
,
DWORD
dwDataLen
,
BYTE
*
abBuffer
,
DWORD
*
dwBufferLen
,
DWORD
dwFlags
)
{
DWORD
i
;
...
...
@@ -1738,6 +1758,28 @@ static BOOL unpad_data(const BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWOR
}
/******************************************************************************
* unpad_data [Internal]
*
* Remove the padding from RSA decrypted data according to padding format
*
* PARAMS
* abData [I] The padded data
* dwDataLen [I] Length of the padded data
* abBuffer [O] Data without padding will be stored here
* dwBufferLen [I/O] I: Length of the buffer, O: Length of unpadded data
* dwFlags [I] Currently none defined
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
static
BOOL
unpad_data
(
const
BYTE
*
abData
,
DWORD
dwDataLen
,
BYTE
*
abBuffer
,
DWORD
*
dwBufferLen
,
DWORD
dwFlags
)
{
return
unpad_data_pkcs1
(
abData
,
dwDataLen
,
abBuffer
,
dwBufferLen
,
dwFlags
);
}
/******************************************************************************
* CPAcquireContext (RSAENH.@)
*
* Acquire a handle to the key container specified by pszContainer
...
...
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