New issue
Advanced search Search tips

Issue 748235 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Task



Sign in to add a comment

Warn when running codesign.py when the keychain is locked

Project Member Reported by justincohen@chromium.org, Jul 24 2017

Issue description

This problem has bit me a few times over the years.  I ssh to a remote machine and run a device build.  This will fail one does not run security keychain unlock first.  And it will fail with an unhelpful -1 error.

What do you think of checking the keychain lock status first, and emiting a warning if running codesign while locked?
 

Comment 1 by sczs@chromium.org, Jul 26 2017

Cc: -sdefresne@chromium.org
Labels: -Type-Bug Type-Task
Owner: sdefresne@chromium.org
Status: Assigned (was: Untriaged)
sdefresne@ are you interested? If not we can re-triage later.
Sure, I'll give it a look soon.
This is already checked as part of "gn gen" by the find_signing_identity.py. If the keychain is locked, then no identity will be found, and "gn gen" will fail with the following error:

  Tried to prepare a device build without specifying a code signing
  identity and could not detect one automatically either.
  TIP: Simulator builds don't require code signing...

I can move the detection from the "gn gen" step to the build step (by moving the code into codesign.py) but then it will mean that developer that don't have a code signing identity installed will only see the error at the end of the build instead of at the beginning (though they will probably fail also at that step as they do not have mobile provisioning profiles).
Cc: sdefresne@chromium.org
Labels: Needs-Feedback
Owner: justincohen@chromium.org
=> back to justincohen for feedback on proposed change.
python ./build/config/ios/find_signing_identity.py --identity-description 'iPhone Developer' seems to work regardless of the keychain being locked.
Ah, then I don't know how to detect whether the keychain is locked or not. I was expecting the command to not have access to Keychain and return an error if it was locked.

I looked at "xcrun security help" but don't see any command to check whether the keychain is locked or not (there is an unlock command but it is interactive and thus I cannot run it as part of the build and I'm afraid it will ask for password even if the keychain is already unlocked).
Cc: justincohen@chromium.org
Labels: -Needs-Feedback
Owner: ----
Status: Available (was: Assigned)
Project Member

Comment 8 by sheriffbot@chromium.org, Aug 20

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment