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
{{ message }}
Repository navigation
Commit 780f7f6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Changes to prior versions can be found on the [GitHub release page](https://gith
10
10
## Unreleased
11
11
12
12
### Added
13
-
* Update mechanism `InstallerUpdateMechanism`, which downloads, verifies and runs the EXE or MSI installer matching the current installation. Self-updates are only performed if the registry value `HKLM\SOFTWARE\Skymatic GmbH\Cryptomator\InstallType` is `EXE` or `MSI`.
13
+
* Update mechanism `InstallerUpdateMechanism`, which downloads, verifies and runs the EXE or MSI installer matching the current installation. Self-updates are only performed if the registry value `HKLM\SOFTWARE\Skymatic GmbH\Cryptomator\InstallType` is `EXE` or `MSI`, and the expected signer of the installer is configured via the JVM properties `cryptomator.integrationsWin.updateDurableIdentityEku` and `cryptomator.integrationsWin.updateRootCaThumbprint`.
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,10 @@ This project uses the following JVM properties:
9
9
*`cryptomator.integrationsWin.windowsHelloKeyId` - Identifier for the Windows Hello keypair
10
10
*`cryptomator.integrationsWin.windowsHelloKeychainPaths` - Locations of the file-based windowsHello keychain
11
11
*`cryptomator.integrationsWin.keychainPaths` - List of file paths, which are checked for data encrypted with the Windows data protection api
12
+
*`cryptomator.integrationsWin.updateDurableIdentityEku` - OID of an extended key usage, which the code signing certificate of a downloaded installer must contain. With Azure Artifact Signing, this is the durable identity of the signing account, which stays the same across certificate renewals (e.g. `1.3.6.1.4.1.311.97.986645502.209118791.449271898.355477593` for Skymatic GmbH). Required by `InstallerUpdateMechanism`.
13
+
*`cryptomator.integrationsWin.updateRootCaThumbprint` - SHA-1 thumbprint (40 hex characters, without spaces) of the root certificate, at which the certificate chain of a downloaded installer's signature must end (e.g. `F40042E2E5F7E8EF8189FED15519AECE42C3BFA2` for Microsoft Identity Verification Root Certificate Authority 2020). Required by `InstallerUpdateMechanism`.
14
+
15
+
`InstallerUpdateMechanism` only updates if both of the `update…` properties are set.
* Verifies the embedded Authenticode signature of a file and checks that it was created by the expected signer.
114
+
*
115
+
* @param file the signed file, e.g. an .exe or .msi
116
+
* @param signerEku OID of an extended key usage, which the signing certificate must contain, e.g. the durable identity of an Azure Artifact Signing account
117
+
* @param rootThumbprint SHA-1 thumbprint (hex) of the root certificate, at which the certificate chain must end
118
+
* @return the signing certificate
119
+
* @throws SignatureException if the file is not signed, the signature is not trusted or it was created by a different signer
Copy file name to clipboardExpand all lines: src/main/java/org/cryptomator/windows/update/InstallerUpdateMechanism.java
+18-9Lines changed: 18 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@
19
19
importjava.nio.file.Path;
20
20
importjava.nio.file.StandardOpenOption;
21
21
importjava.security.SignatureException;
22
+
importjava.security.cert.X509Certificate;
22
23
importjava.util.List;
23
24
importjava.util.Locale;
24
25
importjava.util.Optional;
@@ -37,13 +38,17 @@ public class InstallerUpdateMechanism extends DownloadUpdateMechanism {
37
38
// written by the Cryptomator installer. Package managers (winget, Chocolatey, ...) set the INSTALLTYPE installer property to a different value, opting out of self-updates.
privatestaticfinalStringEXPECTED_SIGNER = "Skymatic GmbH"; // common name of the code signing certificate
41
+
// the installer's signature must chain up to this root CA and the signing certificate must contain this EKU (with Azure Artifact Signing: the durable identity, which stays the same across certificate renewals)
0 commit comments