[Python-checkins] cpython (merge 3.4 -> 3.5): merge 3.4 (closes #25939)

benjamin.peterson python-checkins at python.org
Thu Feb 18 01:18:47 EST 2016


https://hg.python.org/cpython/rev/8ff4c1827499
changeset:   100252:8ff4c1827499
branch:      3.5
parent:      100248:8ee91cb2e2a4
parent:      100251:9f29cf9ad17f
user:        Benjamin Peterson <benjamin at python.org>
date:        Wed Feb 17 22:18:20 2016 -0800
summary:
  merge 3.4 (closes #25939)

files:
  Misc/NEWS      |  2 ++
  Modules/_ssl.c |  8 ++++++--
  2 files changed, 8 insertions(+), 2 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -76,6 +76,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 #26117: The os.scandir() iterator now closes file descriptor not only
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -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());

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list