Commit a6a90ca
[3.10] pythongh-114572: Fix locking in cert_store_stats and get_ca_certs (pythonGH-114573) (python#115548)
pythongh-114572: Fix locking in cert_store_stats and get_ca_certs (pythonGH-114573)
* pythongh-114572: Fix locking in cert_store_stats and get_ca_certs
cert_store_stats and get_ca_certs query the SSLContext's X509_STORE with
X509_STORE_get0_objects, but reading the result requires a lock. See
openssl/openssl#23224 for details.
Instead, use X509_STORE_get1_objects, newly added in that PR.
X509_STORE_get1_objects does not exist in current OpenSSLs, but we can
polyfill it with X509_STORE_lock and X509_STORE_unlock.
* Work around const-correctness problem
* Add missing X509_STORE_get1_objects failure check
* Add blurb
(cherry picked from commit bce6931)
Co-authored-by: David Benjamin <davidben@google.com>1 parent 3ec9183 commit a6a90ca
1 file changed
Lines changed: 60 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4712 | 4712 | | |
4713 | 4713 | | |
4714 | 4714 | | |
| 4715 | + | |
| 4716 | + | |
| 4717 | + | |
| 4718 | + | |
| 4719 | + | |
| 4720 | + | |
| 4721 | + | |
| 4722 | + | |
| 4723 | + | |
| 4724 | + | |
| 4725 | + | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
| 4738 | + | |
| 4739 | + | |
| 4740 | + | |
| 4741 | + | |
| 4742 | + | |
| 4743 | + | |
| 4744 | + | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
4715 | 4759 | | |
4716 | 4760 | | |
4717 | 4761 | | |
| |||
4741 | 4785 | | |
4742 | 4786 | | |
4743 | 4787 | | |
4744 | | - | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
4745 | 4794 | | |
4746 | 4795 | | |
4747 | 4796 | | |
| |||
4755 | 4804 | | |
4756 | 4805 | | |
4757 | 4806 | | |
4758 | | - | |
4759 | | - | |
4760 | | - | |
| 4807 | + | |
4761 | 4808 | | |
4762 | 4809 | | |
4763 | 4810 | | |
| 4811 | + | |
4764 | 4812 | | |
4765 | 4813 | | |
4766 | 4814 | | |
| |||
4792 | 4840 | | |
4793 | 4841 | | |
4794 | 4842 | | |
4795 | | - | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
4796 | 4849 | | |
4797 | 4850 | | |
4798 | 4851 | | |
| |||
4820 | 4873 | | |
4821 | 4874 | | |
4822 | 4875 | | |
| 4876 | + | |
4823 | 4877 | | |
4824 | 4878 | | |
4825 | 4879 | | |
| 4880 | + | |
4826 | 4881 | | |
4827 | 4882 | | |
4828 | 4883 | | |
| |||
0 commit comments