diff --git a/README.md b/README.md index d11d5a3..0a0db30 100644 --- a/README.md +++ b/README.md @@ -224,14 +224,14 @@ 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`. +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.* diff --git a/sign.js b/sign.js index 822d50d..ff9aa6c 100644 --- a/sign.js +++ b/sign.js @@ -158,8 +158,12 @@ function signApplicationAsync (opts) { } else { args.push('--timestamp') } - if (opts['signature-size'] && Number.isInteger(opts['signature-size'])) { - args.push('--signature-size', opts['signature-size']) + 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 = []