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
0da8a521
Commit
0da8a521
authored
Jan 03, 2005
by
Michael Jung
Committed by
Alexandre Julliard
Jan 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adhere to const'ness of the input data in encrypt_block_impl.
parent
6971e1d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
implglue.c
dlls/rsaenh/implglue.c
+22
-18
No files found.
dlls/rsaenh/implglue.c
View file @
0da8a521
...
...
@@ -259,6 +259,8 @@ BOOL encrypt_block_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, CONST BYTE *in
DWORD
enc
)
{
unsigned
long
inlen
,
outlen
;
BYTE
*
in_reversed
=
NULL
;
int
key
;
switch
(
aiAlgid
)
{
case
CALG_RC2
:
...
...
@@ -287,36 +289,38 @@ BOOL encrypt_block_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, CONST BYTE *in
break
;
case
CALG_RSA_KEYX
:
case
CALG_RSA_SIGN
:
outlen
=
inlen
=
(
mp_count_bits
(
&
pKeyContext
->
rsa
.
N
)
+
7
)
/
8
;
if
(
enc
)
{
if
(
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PUBLIC
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
if
(
aiAlgid
==
CALG_RSA_SIGN
)
{
key
=
PK_PRIVATE
;
}
else
{
key
=
PK_PUBLIC
;
}
if
(
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
key
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
reverse_bytes
(
(
BYTE
*
)
out
,
outlen
);
reverse_bytes
(
out
,
outlen
);
}
else
{
reverse_bytes
((
BYTE
*
)
in
,
inlen
);
if
(
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PRIVATE
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
SetLastError
(
NTE_FAIL
);
return
FALS
E
;
if
(
aiAlgid
==
CALG_RSA_SIGN
)
{
key
=
PK_PUBLIC
;
}
else
{
key
=
PK_PRIVAT
E
;
}
}
break
;
case
CALG_RSA_SIGN
:
outlen
=
inlen
=
(
mp_count_bits
(
&
pKeyContext
->
rsa
.
N
)
+
7
)
/
8
;
if
(
enc
)
{
if
(
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PRIVATE
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
SetLastError
(
NTE_FAIL
);
in_reversed
=
HeapAlloc
(
GetProcessHeap
(),
0
,
inlen
);
if
(
!
in_reversed
)
{
SetLastError
(
NTE_NO_MEMORY
);
return
FALSE
;
}
reverse_bytes
((
BYTE
*
)
out
,
out
len
);
}
else
{
reverse_bytes
((
BYTE
*
)
in
,
inlen
);
if
(
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PUBLIC
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
memcpy
(
in_reversed
,
in
,
in
len
);
reverse_bytes
(
in_reversed
,
inlen
);
if
(
rsa_exptmod
(
in_reversed
,
inlen
,
out
,
&
outlen
,
key
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
HeapFree
(
GetProcessHeap
(),
0
,
in_reversed
);
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
in_reversed
);
}
break
;
...
...
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