Skip to content

Commit

Permalink
Merge pull request #208 from netop/master
Browse files Browse the repository at this point in the history
feat: adding signature-size option
  • Loading branch information
sethlu authored Oct 29, 2019
2 parents ebc478e + 927256e commit 912ca2c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,15 @@ Default to `undefined`.

`restrict` - *Boolean*

**To be deprecated, see `signature-flags`.**
**To be deprecated, see `signature-flags`.**
Restrict dyld loading. See doc about this [code signature flag](https://developer.apple.com/documentation/security/seccodesignatureflags/kseccodesignaturerestrict?language=objc) for more details. Disabled by default.

`signature-flags` - *String*
Comma separated string or array for [code signature flag](https://developer.apple.com/documentation/security/seccodesignatureflags?language=objc). Default to `undefined`.

`signature-size` - *Number*
Provide a value to be passed to `codesign` along with the `--signature-size` flag, to work around the *signature too large to embed* issue. A value of `12000` should do it - see the [FAQ](https://github.com/electron/electron-osx-sign/wiki/FAQ) for details. Default to `undefined`.

`strict-verify` - *Boolean|String|Array.<String>*

Flag to enable/disable `--strict` flag when verifying the signed application bundle.
Expand Down
3 changes: 3 additions & 0 deletions bin/electron-osx-sign-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ DESCRIPTION
--signature-flags=flags
Code signature flags. Default to none.

--signature-size=size
Signature size. Default to none.

--strict-verify, --strict-verify=options, --no-strict-verify
Flag to enable/disable ``--strict'' flag when verifying the signed application bundle.
Each component should be separated in ``options'' with comma (``,'').
Expand Down
3 changes: 3 additions & 0 deletions bin/electron-osx-sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ var args = require('minimist')(process.argv.slice(2), {
'string': [
'signature-flags'
],
'number': [
'signature-size'
],
'boolean': [
'help',
'pre-auto-entitlements',
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ declare module "electron-osx-sign" {
'pre-embed-provisioning-profile'?: boolean;
'provisioning-profile'?: string;
'requirements'?: string;
'signature-size'?: number;
'type'?: string;
version?: string;
'identity-validation'?: boolean;
Expand Down
7 changes: 7 additions & 0 deletions sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ function signApplicationAsync (opts) {
} else {
args.push('--timestamp')
}
if (opts['signature-size']) {
if (Number.isInteger(opts['signature-size']) && opts['signature-size'] > 0) {
args.push('--signature-size', opts['signature-size'])
} else {
debugwarn(`Invalid value provided for --signature-size (${opts['signature-size']}). Must be a positive integer.`)
}
}

let optionsArguments = []

Expand Down

0 comments on commit 912ca2c

Please sign in to comment.