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
7861b1e8
Commit
7861b1e8
authored
Jun 26, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "crypt32: Do not create persistent container in CRYPT_CreateKeyProv().".
This reverts commit
a19c8712
.
parent
00df1bea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
10 deletions
+43
-10
cert.c
dlls/crypt32/cert.c
+43
-10
No files found.
dlls/crypt32/cert.c
View file @
7861b1e8
...
...
@@ -3682,21 +3682,54 @@ 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
prov
;
H
CRYPTKEY
key
;
HCRYPTPROV
hProv
=
0
;
H
MODULE
rpcrt
=
LoadLibraryW
(
L"rpcrt4"
)
;
if
(
!
CryptAcquireContextA
(
&
prov
,
NULL
,
MS_DEF_PROV_A
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
|
CRYPT_NEWKEYSET
))
return
0
;
if
(
!
CryptGenKey
(
prov
,
AT_SIGNATURE
,
0
,
&
key
))
if
(
rpcrt
)
{
CryptReleaseContext
(
prov
,
0
);
return
0
;
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
);
if
(
ret
)
{
HCRYPTKEY
key
;
ret
=
CryptGenKey
(
hProv
,
AT_SIGNATURE
,
0
,
&
key
);
if
(
ret
)
CryptDestroyKey
(
key
);
}
rpcStringFree
(
&
uuidStr
);
}
}
}
FreeLibrary
(
rpcrt
);
}
CryptDestroyKey
(
key
);
return
prov
;
return
hProv
;
}
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