Skip to content

Commit

Permalink
fix: bundle StartSSL certs
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed May 5, 2016
1 parent 2d0f5f1 commit 16d3805
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 11 deletions.
34 changes: 34 additions & 0 deletions certs/sca.code2.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF2DCCA8CgAwIBAgIQbDvSft08lJ6Vjiips8dXoDANBgkqhkiG9w0BAQsFADB9
MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi
U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh
cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTUxMjE2MDEwMDA1WhcN
MzAxMjE2MDEwMDA1WjB1MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20g
THRkLjEpMCcGA1UECxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx
IzAhBgNVBAMTGlN0YXJ0Q29tIENsYXNzIDIgT2JqZWN0IENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuRQEWPeyxYYsCDJgrQgmwIF3uWgZ2RUrHRhp
5NoalgWXLmR5Gqk9UTNa0Hdq9AKTQcOOunAbq9h7dG+Y6Ne5qT5odqSJoCKsF9Yp
+Lu4YZ/SB9BmDjBHICtwAh7+cwkccTS14n6prKin8Y46QAZ2ksr3eGzvWAVzfX+D
UOmiVQLjAK6Wp8bCZHvj+FhAlS5Ne7/dggDeSVWnMyPm2k/5YKOTVXExJJaAlYkm
yH1OiC3soTkkGb6aJjGJPHiaiNJ4pjkySX5l2p4DQ7K1/J6ft5Vw9PuqwmYrF0Vi
Gnn38kzB2d9UI9Q+dFmHUbV+cnr+FoGl6CiUDd5ZIF1HMrb8hwIDAQ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YlT0dKQIb0obTN6FOF63hBRFFhGB7NuX2FeFjJsZFCk
oJkpsEauObb7Rh+C02+fnHfoi6ivKwUC9BOsWlI4xn7GMe27niL6k7wpK0L6MTG5
/6gxwosqaMA1aukw
-----END CERTIFICATE-----
34 changes: 34 additions & 0 deletions certs/sca.code3.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF5DCCA8ygAwIBAgIQeCJDoVPfKAof+uFc0ChMhjANBgkqhkiG9w0BAQsFADB9
MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi
U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh
cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTUxMjE2MDEwMDA1WhcN
MzAxMjE2MDEwMDA1WjB1MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20g
THRkLjEpMCcGA1UECxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx
IzAhBgNVBAMTGlN0YXJ0Q29tIENsYXNzIDMgT2JqZWN0IENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2GwlNhRkXHnNYZgCnwWVUbzIQGbKV1cyk2Wg
VbvCet+v/uVVKDJn5mMvwu9lwMHmd+1NpKW93kwI4lb1aUwgJGSwtL/a+jlv8Gw6
MizkD2PwVK3R9qvia0TR2W7mZDf7qFufa2CNb6bpqSyoPKawAgABb80UoKzKsOWo
05q6NeR+Z2lt7SR5mop8MPDsOgdnKA/17opoOfSly6F6Jg1r5P5yqWtXxPDexmbM
/LG/+K1IKJHcb7Kj0soNnBUV9GP+2kAmEUCh0cTD1LCdrYVFiWkDVNmD3dBIQN67
oeNNH0Ak8cDgjhJGGwgvku4ZZWG7FPWFfakuYpIvaY8AJXd61wIDAQABo4IBZjCC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EEww3GTQtVIRN8n8W1Umvom9Y99CBHF6T4vyzqzD9tvg
mvoucIJCNoKGgMWufQJ69GAOyh0wltsU9OhMmTyyA44rUPeZY4CEsvUbvrkMPzTK
3Nf9o45cDnB+lBNPMhv/pI9cdfWcpFjJ
-----END CERTIFICATE-----
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"ts-babel": "^0.8.6",
"tsconfig-glob": "^0.4.3",
"tslint": "next",
"typescript": "^1.9.0-dev.20160504",
"typescript": "1.9.0-dev.20160505",
"whitespace": "^2.0.0"
},
"babel": {
Expand Down
18 changes: 12 additions & 6 deletions src/codeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function generateKeychainName(): string {
}

export function createKeychain(keychainName: string, cscLink: string, cscKeyPassword: string, cscILink?: string | null, cscIKeyPassword?: string | null, csaLink?: string | null): Promise<CodeSigningInfo> {
const certLinks = csaLink == null ? ["https://startssl.com/certs/sca.code2.crt", "https://startssl.com/certs/sca.code3.crt"] : [csaLink]
const certLinks = csaLink == null ? [] : [csaLink]
certLinks.push(cscLink)
if (cscILink != null) {
certLinks.push(cscILink)
Expand All @@ -52,13 +52,19 @@ export function createKeychain(keychainName: string, cscLink: string, cscKeyPass
})
}

async function importCerts(keychainName: string, paths: Array<string>, keyPasswords: Array<string | null | undefined>, importAppleCerts: boolean): Promise<CodeSigningInfo> {
for (let f of paths.slice(0, -keyPasswords.length)) {
await exec("security", ["import", f, "-k", keychainName, "-T", "/usr/bin/codesign"])
async function importCerts(keychainName: string, paths: Array<string>, keyPasswords: Array<string | null | undefined>, importBundledCerts: boolean): Promise<CodeSigningInfo> {
const certFiles = paths.slice(0, -keyPasswords.length)
if (importBundledCerts) {
const bundledCertsPath = path.join(__dirname, "..", "certs")
certFiles.push(
path.join(bundledCertsPath, "AppleWWDRCA.cer"),
path.join(bundledCertsPath, "sca.code2.crt"),
path.join(bundledCertsPath, "sca.code3.crt")
)
}

if (importAppleCerts) {
await exec("security", ["import", path.join(__dirname, "..", "certs", "AppleWWDRCA.cer"), "-k", keychainName, "-T", "/usr/bin/codesign"])
for (let file of certFiles) {
await exec("security", ["import", file, "-k", keychainName, "-T", "/usr/bin/codesign"])
}

const namePromises: Array<Promise<string>> = []
Expand Down
6 changes: 2 additions & 4 deletions test/install-linux-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ gem install --no-rdoc --no-ri fpm
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

sudo dpkg --add-architecture i386

sudo add-apt-repository ppa:wine/wine-builds -y
sudo add-apt-repository ppa:ubuntu-wine/ppa -y
sudo apt-get update

sudo apt-get install -y winehq-devel
sudo apt-get install wine1.8 -y

0 comments on commit 16d3805

Please sign in to comment.