You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/VcpkgPortOverlay/cpprestsdk/add-server-certificate-validation.patch
+106-5Lines changed: 106 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,108 @@
1
+
From 888b4ed8f4f7d25cb05a47210e083fe29348163b Mon Sep 17 00:00:00 2001
2
+
From: JohnMcPMS <johnmcp@microsoft.com>
3
+
Date: Wed, 27 Jul 2022 18:03:45 -0700
4
+
Subject: [PATCH] Server certificate pinning for Store source (#2347)
5
+
6
+
This change adds a generic certificate chain verification infrastructure for pinning certificate chains. It is specifically used to pin the Microsoft Store source by default. More sources may be pinned later, but currently the packaged index is less in need of it because it is already signed.
7
+
8
+
The pinning configuration consists of 1 or more chains, only one of which needs to successfully validate the incoming certificate. This allows for rolling to a new certificate when needed. Each chain consists of a fixed set of certificates, which can each be configured to validate any or all of the following properties:
9
+
10
+
- Public Key
11
+
- Subject
12
+
- Issuer
13
+
14
+
If the certificate is configured to validate none of the values, it will allow any certificate through.
15
+
16
+
An admin setting is added to disable pinning, both as an emergency measure in the event that there is a bug or rolled certificate that was not communicated, but also because there are test scenarios where the user actively wants to disable it (HTTPS redirection via something like Fiddler).
17
+
18
+
The configuration can be loaded from JSON for future dynamic configuration, but it is currently only as a test hook to enable configuration via Group Policy.
19
+
20
+
In order to better secure the source by default, reconfiguring (remove then add) the Store source manually will convert it back to the built-in values. This includes the pinning configuration.
21
+
22
+
It was necessary to modify the cpprestsdk subtree to add a new callback. This enables the request handle to be passed back to our code when the server certificate is first available. We can then check the server certificate against the configured pinning chain, making a decision to terminate the request before it is sent.
0 commit comments