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
a554ff21
Commit
a554ff21
authored
Feb 24, 2023
by
Sven Baars
Committed by
Alexandre Julliard
Feb 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Factor out wow64 padding conversion.
parent
c898503e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
20 deletions
+32
-20
gnutls.c
dlls/bcrypt/gnutls.c
+32
-20
No files found.
dlls/bcrypt/gnutls.c
View file @
a554ff21
...
@@ -2302,6 +2302,34 @@ struct key32
...
@@ -2302,6 +2302,34 @@ struct key32
}
u
;
}
u
;
};
};
union
padding
{
BCRYPT_PKCS1_PADDING_INFO
pkcs1
;
};
union
padding32
{
struct
{
PTR32
pszAlgId
;
}
pkcs1
;
};
static
union
padding
*
get_padding
(
union
padding32
*
padding32
,
union
padding
*
padding
,
ULONG
flags
)
{
if
(
!
padding32
)
return
NULL
;
switch
(
flags
)
{
case
BCRYPT_PAD_PKCS1
:
padding
->
pkcs1
.
pszAlgId
=
ULongToPtr
(
padding32
->
pkcs1
.
pszAlgId
);
return
padding
;
default:
break
;
}
return
NULL
;
}
static
struct
key
*
get_symmetric_key
(
struct
key32
*
key32
,
struct
key
*
key
)
static
struct
key
*
get_symmetric_key
(
struct
key32
*
key32
,
struct
key
*
key
)
{
{
key
->
hdr
=
key32
->
hdr
;
key
->
hdr
=
key32
->
hdr
;
...
@@ -2576,12 +2604,12 @@ static NTSTATUS wow64_key_asymmetric_sign( void *args )
...
@@ -2576,12 +2604,12 @@ static NTSTATUS wow64_key_asymmetric_sign( void *args )
NTSTATUS
ret
;
NTSTATUS
ret
;
struct
key
key
;
struct
key
key
;
BCRYPT_PKCS1_PADDING_INFO
padding
;
union
padding
padding
;
struct
key32
*
key32
=
ULongToPtr
(
params32
->
key
);
struct
key32
*
key32
=
ULongToPtr
(
params32
->
key
);
struct
key_asymmetric_sign_params
params
=
struct
key_asymmetric_sign_params
params
=
{
{
get_asymmetric_key
(
key32
,
&
key
),
get_asymmetric_key
(
key32
,
&
key
),
NULL
,
/* padding */
get_padding
(
ULongToPtr
(
params32
->
padding
),
&
padding
,
params32
->
flags
),
ULongToPtr
(
params32
->
input
),
ULongToPtr
(
params32
->
input
),
params32
->
input_len
,
params32
->
input_len
,
ULongToPtr
(
params32
->
output
),
ULongToPtr
(
params32
->
output
),
...
@@ -2590,14 +2618,6 @@ static NTSTATUS wow64_key_asymmetric_sign( void *args )
...
@@ -2590,14 +2618,6 @@ static NTSTATUS wow64_key_asymmetric_sign( void *args )
params32
->
flags
params32
->
flags
};
};
if
(
params32
->
flags
&
BCRYPT_PAD_PKCS1
)
{
PTR32
*
info
=
ULongToPtr
(
params32
->
padding
);
if
(
!
info
)
return
STATUS_INVALID_PARAMETER
;
padding
.
pszAlgId
=
ULongToPtr
(
*
info
);
params
.
padding
=
&
padding
;
}
ret
=
key_asymmetric_sign
(
&
params
);
ret
=
key_asymmetric_sign
(
&
params
);
put_asymmetric_key32
(
&
key
,
key32
);
put_asymmetric_key32
(
&
key
,
key32
);
return
ret
;
return
ret
;
...
@@ -2618,12 +2638,12 @@ static NTSTATUS wow64_key_asymmetric_verify( void *args )
...
@@ -2618,12 +2638,12 @@ static NTSTATUS wow64_key_asymmetric_verify( void *args )
NTSTATUS
ret
;
NTSTATUS
ret
;
struct
key
key
;
struct
key
key
;
BCRYPT_PKCS1_PADDING_INFO
padding
;
union
padding
padding
;
struct
key32
*
key32
=
ULongToPtr
(
params32
->
key
);
struct
key32
*
key32
=
ULongToPtr
(
params32
->
key
);
struct
key_asymmetric_verify_params
params
=
struct
key_asymmetric_verify_params
params
=
{
{
get_asymmetric_key
(
key32
,
&
key
),
get_asymmetric_key
(
key32
,
&
key
),
NULL
,
/* padding */
get_padding
(
ULongToPtr
(
params32
->
padding
),
&
padding
,
params32
->
flags
),
ULongToPtr
(
params32
->
hash
),
ULongToPtr
(
params32
->
hash
),
params32
->
hash_len
,
params32
->
hash_len
,
ULongToPtr
(
params32
->
signature
),
ULongToPtr
(
params32
->
signature
),
...
@@ -2631,14 +2651,6 @@ static NTSTATUS wow64_key_asymmetric_verify( void *args )
...
@@ -2631,14 +2651,6 @@ static NTSTATUS wow64_key_asymmetric_verify( void *args )
params32
->
flags
params32
->
flags
};
};
if
(
params32
->
flags
&
BCRYPT_PAD_PKCS1
)
{
PTR32
*
info
=
ULongToPtr
(
params32
->
padding
);
if
(
!
info
)
return
STATUS_INVALID_PARAMETER
;
padding
.
pszAlgId
=
ULongToPtr
(
*
info
);
params
.
padding
=
&
padding
;
}
ret
=
key_asymmetric_verify
(
&
params
);
ret
=
key_asymmetric_verify
(
&
params
);
put_asymmetric_key32
(
&
key
,
key32
);
put_asymmetric_key32
(
&
key
,
key32
);
return
ret
;
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