changeset: 100253:d6474257ef38 parent: 100249:12502327d2c0 parent: 100252:8ff4c1827499 user: Benjamin Peterson date: Wed Feb 17 22:18:35 2016 -0800 files: Misc/NEWS Modules/_ssl.c description: merge 3.5 (closes #25939) diff -r 12502327d2c0 -r d6474257ef38 Misc/NEWS --- a/Misc/NEWS Tue Feb 16 13:27:45 2016 +1100 +++ b/Misc/NEWS Wed Feb 17 22:18:35 2016 -0800 @@ -186,6 +186,8 @@ Library ------- +- Issue #25939: On Windows open the cert store readonly in ssl.enum_certificates. + - Issue #25995: os.walk() no longer uses FDs proportional to the tree depth. - Issue #25994: Added the close() method and the support of the context manager diff -r 12502327d2c0 -r d6474257ef38 Modules/_ssl.c --- a/Modules/_ssl.c Tue Feb 16 13:27:45 2016 +1100 +++ b/Modules/_ssl.c Wed Feb 17 22:18:35 2016 -0800 @@ -4198,7 +4198,9 @@ if (result == NULL) { return NULL; } - hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name); + hStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, (HCRYPTPROV)NULL, + CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE, + store_name); if (hStore == NULL) { Py_DECREF(result); return PyErr_SetFromWindowsErr(GetLastError()); @@ -4284,7 +4286,9 @@ if (result == NULL) { return NULL; } - hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name); + hStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, (HCRYPTPROV)NULL, + CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE, + store_name); if (hStore == NULL) { Py_DECREF(result); return PyErr_SetFromWindowsErr(GetLastError());