osx-sign icon indicating copy to clipboard operation
osx-sign copied to clipboard

A couple of issues when using DEBUG=electron-osx-sign*

Open chrisckc opened this issue 6 years ago • 1 comments
trafficstars

OS: MacOS 10.14.4 XCode: 10.2

When using DEBUG=electron-osx-sign* to debug code signing, i found a couple of issues:

First, if the path to the file to be signed contains "/p" in the path, the path shown in the logging output is messed up due to a function which removes password from the command to be executed:

https://github.com/electron-userland/electron-osx-sign/blob/b6fcaa570cf306771b3af9a8394ccd7037a74b25/util.js#L32-L36

The regex in the above function is matching paths such as /node_modules/puppeteer/ Maybe it should be modified to only match " /p" (/p with preceding space) like this: /(-P |pass:|^.\/p|-pass )([^ ]+)/

Second issue, likely related to the codesign tool or child.execFile is that for some reason the stdout from the command executed by child.ExecFile is appearing on stderr instead

https://github.com/electron-userland/electron-osx-sign/blob/b6fcaa570cf306771b3af9a8394ccd7037a74b25/util.js#L44-L56

To see this happening add a line such as this just before the resolve(stdout)

debuglog('Result: err: ', err, '\n', '> Stdout:', stdout, '\n', '> Stderr:', stderr)

A successful codesign results in the output appearing on stderr

Just thought it was worth mentioning as being able to see the path correctly when it contains "/p" and also the codesign output is useful.

chrisckc avatar Jun 11 '19 14:06 chrisckc