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
95c3d9b2
Commit
95c3d9b2
authored
Dec 01, 2004
by
Michael Jung
Committed by
Alexandre Julliard
Dec 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved code specific to CPGenKey, CPDeriveKey or CPImportKey from
new_key into the respective functions.
parent
3b0a5d0a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
implglue.c
dlls/rsaenh/implglue.c
+27
-6
rsaenh.c
dlls/rsaenh/rsaenh.c
+0
-0
No files found.
dlls/rsaenh/implglue.c
View file @
95c3d9b2
...
...
@@ -149,12 +149,11 @@ BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen)
{
case
CALG_RSA_KEYX
:
case
CALG_RSA_SIGN
:
if
(
rsa_make_key
((
int
)
dwKeyLen
,
65537
,
&
pKeyContext
->
rsa
)
==
CRYPT_OK
)
{
return
TRUE
;
}
else
{
printf
(
"Error generating rsakey of len %ld!
\n
"
,
dwKeyLen
);
if
(
rsa_make_key
((
int
)
dwKeyLen
,
65537
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
return
TRUE
;
}
return
TRUE
;
...
...
@@ -286,11 +285,17 @@ BOOL encrypt_block_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, CONST BYTE *in
case
CALG_RSA_KEYX
:
outlen
=
inlen
=
(
mp_count_bits
(
&
pKeyContext
->
rsa
.
N
)
+
7
)
/
8
;
if
(
enc
)
{
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PUBLIC
,
&
pKeyContext
->
rsa
);
if
(
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PUBLIC
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
reverse_bytes
((
BYTE
*
)
in
,
inlen
);
}
else
{
reverse_bytes
((
BYTE
*
)
in
,
inlen
);
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PRIVATE
,
&
pKeyContext
->
rsa
);
if
(
rsa_exptmod
(
in
,
inlen
,
out
,
&
outlen
,
PK_PRIVATE
,
&
pKeyContext
->
rsa
)
!=
CRYPT_OK
)
{
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
}
break
;
...
...
@@ -363,6 +368,14 @@ BOOL import_public_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD d
{
BYTE
*
pbTemp
;
if
(
mp_init_multi
(
&
pKeyContext
->
rsa
.
e
,
&
pKeyContext
->
rsa
.
d
,
&
pKeyContext
->
rsa
.
N
,
&
pKeyContext
->
rsa
.
dQ
,
&
pKeyContext
->
rsa
.
dP
,
&
pKeyContext
->
rsa
.
qP
,
&
pKeyContext
->
rsa
.
p
,
&
pKeyContext
->
rsa
.
q
,
NULL
)
!=
MP_OKAY
)
{
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
pbTemp
=
(
BYTE
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
dwKeyLen
);
if
(
!
pbTemp
)
return
FALSE
;
memcpy
(
pbTemp
,
pbSrc
,
dwKeyLen
);
...
...
@@ -409,6 +422,14 @@ BOOL import_private_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD
{
BYTE
*
pbTemp
,
*
pbBigNum
;
if
(
mp_init_multi
(
&
pKeyContext
->
rsa
.
e
,
&
pKeyContext
->
rsa
.
d
,
&
pKeyContext
->
rsa
.
N
,
&
pKeyContext
->
rsa
.
dQ
,
&
pKeyContext
->
rsa
.
dP
,
&
pKeyContext
->
rsa
.
qP
,
&
pKeyContext
->
rsa
.
p
,
&
pKeyContext
->
rsa
.
q
,
NULL
)
!=
MP_OKAY
)
{
SetLastError
(
NTE_FAIL
);
return
FALSE
;
}
pbTemp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
2
*
dwKeyLen
+
5
*
((
dwKeyLen
+
1
)
>>
1
));
if
(
!
pbTemp
)
return
FALSE
;
memcpy
(
pbTemp
,
pbSrc
,
2
*
dwKeyLen
+
5
*
((
dwKeyLen
+
1
)
>>
1
));
...
...
dlls/rsaenh/rsaenh.c
View file @
95c3d9b2
This diff is collapsed.
Click to expand it.
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