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
a19c8712
Commit
a19c8712
authored
Jun 20, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Do not create persistent container in CRYPT_CreateKeyProv().
parent
e0ce5e33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
43 deletions
+10
-43
cert.c
dlls/crypt32/cert.c
+10
-43
No files found.
dlls/crypt32/cert.c
View file @
a19c8712
...
...
@@ -3682,54 +3682,21 @@ static void CRYPT_MakeCertInfo(PCERT_INFO info, const CRYPT_DATA_BLOB *pSerialNu
}
}
typedef
RPC_STATUS
(
RPC_ENTRY
*
UuidCreateFunc
)(
UUID
*
);
typedef
RPC_STATUS
(
RPC_ENTRY
*
UuidToStringFunc
)(
UUID
*
,
unsigned
char
**
);
typedef
RPC_STATUS
(
RPC_ENTRY
*
RpcStringFreeFunc
)(
unsigned
char
**
);
static
HCRYPTPROV
CRYPT_CreateKeyProv
(
void
)
{
HCRYPTPROV
hProv
=
0
;
HMODULE
rpcrt
=
LoadLibraryW
(
L"rpcrt4"
);
if
(
rpcrt
)
{
UuidCreateFunc
uuidCreate
=
(
UuidCreateFunc
)
GetProcAddress
(
rpcrt
,
"UuidCreate"
);
UuidToStringFunc
uuidToString
=
(
UuidToStringFunc
)
GetProcAddress
(
rpcrt
,
"UuidToStringA"
);
RpcStringFreeFunc
rpcStringFree
=
(
RpcStringFreeFunc
)
GetProcAddress
(
rpcrt
,
"RpcStringFreeA"
);
if
(
uuidCreate
&&
uuidToString
&&
rpcStringFree
)
{
UUID
uuid
;
RPC_STATUS
status
=
uuidCreate
(
&
uuid
);
if
(
status
==
RPC_S_OK
||
status
==
RPC_S_UUID_LOCAL_ONLY
)
{
unsigned
char
*
uuidStr
;
status
=
uuidToString
(
&
uuid
,
&
uuidStr
);
if
(
status
==
RPC_S_OK
)
{
BOOL
ret
=
CryptAcquireContextA
(
&
hProv
,
(
LPCSTR
)
uuidStr
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_NEWKEYSET
);
HCRYPTPROV
prov
;
HCRYPTKEY
key
;
if
(
ret
)
{
HCRYPTKEY
key
;
if
(
!
CryptAcquireContextA
(
&
prov
,
NULL
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
|
CRYPT_NEWKEYSET
))
return
0
;
ret
=
CryptGenKey
(
hProv
,
AT_SIGNATURE
,
0
,
&
key
);
if
(
ret
)
CryptDestroyKey
(
key
);
}
rpcStringFree
(
&
uuidStr
);
}
}
}
FreeLibrary
(
rpcrt
);
if
(
!
CryptGenKey
(
prov
,
AT_SIGNATURE
,
0
,
&
key
))
{
CryptReleaseContext
(
prov
,
0
);
return
0
;
}
return
hProv
;
CryptDestroyKey
(
key
);
return
prov
;
}
PCCERT_CONTEXT
WINAPI
CertCreateSelfSignCertificate
(
HCRYPTPROV_OR_NCRYPT_KEY_HANDLE
hProv
,
...
...
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