Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Make build step sign binaries and generate widevine sig files on Windows" #3994

Merged
merged 1 commit into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ const build = (buildConfig = config.defaultBuildConfig, options) => {
if (config.shouldSign()) {
util.signApp()
}

if (process.platform === 'win32') {
util.signWinBinaries()

if (config.brave_enable_cdm_host_verification) {
util.generateWidevineSigFiles()
}
}


}

module.exports = build
20 changes: 1 addition & 19 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ const Config = function () {
this.ignore_compile_failure = false
this.enable_hangout_services_extension = true
this.widevineVersion = getNPMConfig(['widevine', 'version'])
this.brave_enable_cdm_host_verification = false
this.sign_widevine_cert = process.env.SIGN_WIDEVINE_CERT || ''
this.sign_widevine_key = process.env.SIGN_WIDEVINE_KEY || ''
this.sign_widevine_passwd = process.env.SIGN_WIDEVINE_PASSPHRASE || ''
this.signature_generator = path.join(this.srcDir, 'third_party', 'widevine', 'scripts', 'signature_generator.py') || ''
}

Config.prototype.buildArgs = function () {
Expand Down Expand Up @@ -96,8 +91,7 @@ Config.prototype.buildArgs = function () {
chrome_version_major: chrome_version_parts[0],
safebrowsing_api_endpoint: this.safeBrowsingApiEndpoint,
brave_referrals_api_key: this.braveReferralsApiKey,
enable_hangout_services_extension: this.enable_hangout_services_extension,
brave_enable_cdm_host_verification: this.brave_enable_cdm_host_verification,
enable_hangout_services_extension: this.enable_hangout_services_extension
}

if (process.platform === 'darwin') {
Expand Down Expand Up @@ -291,18 +285,6 @@ Config.prototype.update = function (options) {
this.channel = options.channel
}

if (this.buildConfig === 'Release' && process.platform !== 'linux') {
this.brave_enable_cdm_host_verification =
this.sign_widevine_cert !== "" && this.sign_widevine_key !== "" &&
this.sign_widevine_passwd !== "" && fs.existsSync(this.signature_generator)

if (this.brave_enable_cdm_host_verification) {
console.log('Widevine cdm host verification is enabled')
} else {
console.log('Widevine cdm host verification is disabled')
}
}

if (process.platform === 'win32' && options.build_omaha) {
this.build_omaha = true
this.tag_ap = options.tag_ap
Expand Down
43 changes: 0 additions & 43 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,49 +264,6 @@ const util = {
util.run('ninja', ['-C', config.outputDir, config.signTarget], options)
},

signWinBinaries: () => {
if (!config.buildConfig === 'Release' || config.skip_signing) {
console.log('binary signing is skipped because this is not ofiicial build or --skip_signing is used')
return
}

if (process.env.CERT === undefined || process.env.SIGNTOOL_ARGS === undefined) {
console.log('binary signing is skipped because of missing env vars')
return
}

console.log('signing win binaries...')

const core_dir = config.projects['brave-core'].dir
util.run('python', [path.join(core_dir, 'script', 'sign_binaries.py'),
'--build_dir=' + path.join(config.srcDir, 'out', 'Release')])
},

generateWidevineSigFiles: () => {
const cert = config.sign_widevine_cert
const key = config.sign_widevine_key
const passwd = config.sign_widevine_passwd
const sig_generator = config.signature_generator

console.log('generate Widevine sig files...')

util.run('python', [sig_generator, '--input_file=' + path.join(config.srcDir, 'out', 'Release', 'brave.exe'),
'--flags=1',
'--certificate=' + cert,
'--private_key=' + key,
'--private_key_passphrase=' + passwd])
util.run('python', [sig_generator, '--input_file=' + path.join(config.srcDir, 'out', 'Release', 'chrome.dll'),
'--flags=0',
'--certificate=' + cert,
'--private_key=' + key,
'--private_key_passphrase=' + passwd])
util.run('python', [sig_generator, '--input_file=' + path.join(config.srcDir, 'out', 'Release', 'chrome_child.dll'),
'--flags=0',
'--certificate=' + cert,
'--private_key=' + key,
'--private_key_passphrase=' + passwd])
},

buildTarget: (options = config.defaultOptions) => {
console.log('building ' + config.buildTarget + '...')

Expand Down
1 change: 0 additions & 1 deletion scripts/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ program
.option('--brave_google_api_endpoint <brave_google_api_endpoint>')
.option('--channel <target_chanel>', 'target channel to build', /^(beta|dev|nightly|release)$/i, 'release')
.option('--ignore_compile_failure', 'Keep compiling regardless of error')
.option('--skip_signing', 'skip signing binaries')
.arguments('[build_config]')
.action(build)

Expand Down