X Tutup
Skip to content

Commit 1378f7c

Browse files
committed
merge 3.4 (closes python#25939)
2 parents f38c93f + 9491272 commit 1378f7c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Core and Builtins
7676
Library
7777
-------
7878

79+
- Issue #25939: On Windows open the cert store readonly in ssl.enum_certificates.
80+
7981
- Issue #25995: os.walk() no longer uses FDs proportional to the tree depth.
8082

8183
- Issue #26117: The os.scandir() iterator now closes file descriptor not only

Modules/_ssl.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4198,7 +4198,9 @@ _ssl_enum_certificates_impl(PyModuleDef *module, const char *store_name)
41984198
if (result == NULL) {
41994199
return NULL;
42004200
}
4201-
hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
4201+
hStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, (HCRYPTPROV)NULL,
4202+
CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE,
4203+
store_name);
42024204
if (hStore == NULL) {
42034205
Py_DECREF(result);
42044206
return PyErr_SetFromWindowsErr(GetLastError());
@@ -4284,7 +4286,9 @@ _ssl_enum_crls_impl(PyModuleDef *module, const char *store_name)
42844286
if (result == NULL) {
42854287
return NULL;
42864288
}
4287-
hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
4289+
hStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, (HCRYPTPROV)NULL,
4290+
CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE,
4291+
store_name);
42884292
if (hStore == NULL) {
42894293
Py_DECREF(result);
42904294
return PyErr_SetFromWindowsErr(GetLastError());

0 commit comments

Comments
 (0)
X Tutup