bitrise-steplib / steps-ios-auto-provision

MIT License
20 stars 33 forks source link

Install certificate error with complex password #73

Closed OrWest closed 3 years ago

OrWest commented 5 years ago

Hello. I uploaded the certificate (p12) with complex password:

DKQt)VF5@0HK\GG{-\3

On Bitrise step it was failed with error:

Install certificates sh: -c: line 0: syntax error near unexpected token )' sh: -c: line 0:security import "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/Certrificate_0.p12" -k "/Users/vagrant/Library/Keychains/login.keychain" -P DKQt)VF5@0HK\GG{-\3 -A'

Error: security import "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/Certrificate_0.p12" -k "/Users/vagrant/Library/Keychains/login.keychain" -P DKQt)VF5@0HK\GG{-\3 -A failed, out:

Stacktrace (for debugging): /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:50:in import_certificate' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:33:inblock in install_certificates' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:32:in each' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:32:ininstall_certificates' /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/step.rb:136:in `

'

Seems password in command should be quoted to prevent this issue.

ghost commented 5 years ago

I can corroborate this, I had a PW for my p12 that included a double quote " character, when I removed that cert and replaced with a p12 holding the same cert, but with a simply alphanumeric password, it resolved the issue.

The error I had received was the following:

Install certificates
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
Error:
security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_0.p12" -k "/Users/vagrant/Library/Keychains/login.keychain-db" -P vx,6CW;(!h#"2B)fkz -A failed, out: 
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise814661766/step_src/lib/autoprovision/keychain_helper.rb:50:in `import_certificate'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise814661766/step_src/lib/autoprovision/keychain_helper.rb:33:in `block in install_certificates'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise814661766/step_src/lib/autoprovision/keychain_helper.rb:32:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise814661766/step_src/lib/autoprovision/keychain_helper.rb:32:in `install_certificates'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise814661766/step_src/step.rb:136:in `<main>'

Notice the unquoted option value of vx,6CW;(!h#"2B)fkz in there, that was the password of the old p12.

sethdeckard commented 5 years ago

I ran into the same issue since I used a PW generator to generate a strong password and it contained the following specials: <-=?'#;{$>(\%*:

bitce commented 5 years ago

Hi guys!

Sorry for our silence on this. The team is aware of the problem and has a related task to fix this. We'll make sure to update this thread once it's done! 🙂

michaelrccurtis commented 4 years ago

This issue appears to still be present - we've fixed by using a purely alphanumeric password but it would be great to see this addressed. We also got this error: https://github.com/bitrise-steplib/steps-ios-auto-provision/issues/125, when using a slightly different password (possibly with a space inside, which a glance at the code might mean the way the password is injected into the cli command is broken).

mjones-droid commented 4 years ago

Hey Michael. I'm sorry you're still experiencing issues with this.

Can you enable support access on your app and send us a link to a recent build with these issues? Thanks!

ghost commented 3 years ago

Hello, any solution to this?

Install certificates
$ security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A
security: SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)
Error:
security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A failed, out: 
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:54:in `import_certificate'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:33:in `block in install_certificates'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `install_certificates'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/step.rb:137:in `<main>'
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision@1.5 (exit code: 1)                         | 1.9 min  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

https://app.bitrise.io/build/8f25eefab52bb46d#?tab=log

this is my build failed

thinguyenbit commented 3 years ago

Hello, any solution to this?

Install certificates
$ security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A
security: SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)
Error:
security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A failed, out: 
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:54:in `import_certificate'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:33:in `block in install_certificates'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `install_certificates'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/step.rb:137:in `<main>'
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision@1.5 (exit code: 1)                         | 1.9 min  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

https://app.bitrise.io/build/8f25eefab52bb46d#?tab=log

this is my build failed

Can you please enable support access?

Thi

ghost commented 3 years ago

Hello, any solution to this?

Install certificates
$ security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A
security: SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)
Error:
security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A failed, out: 
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:54:in `import_certificate'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:33:in `block in install_certificates'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `install_certificates'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/step.rb:137:in `<main>'
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision@1.5 (exit code: 1)                         | 1.9 min  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

https://app.bitrise.io/build/8f25eefab52bb46d#?tab=log this is my build failed

Can you please enable support access?

Thi

Done!

thinguyenbit commented 3 years ago

Hello, any solution to this?

Install certificates
$ security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A
security: SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)
Error:
security import "/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_2.p12" -k '/Users/vagrant/Library/Keychains/login.keychain-db' -P "****" -A failed, out: 
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:54:in `import_certificate'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:33:in `block in install_certificates'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/lib/autoprovision/keychain_helper.rb:32:in `install_certificates'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise199243010/step_src/step.rb:137:in `<main>'
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision@1.5 (exit code: 1)                         | 1.9 min  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

https://app.bitrise.io/build/8f25eefab52bb46d#?tab=log this is my build failed

Can you please enable support access? Thi

Done!

Can you try removing the certificates under the codesigning tab, generating new ones and uploading them back?

Thi

github-actions[bot] commented 3 years ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

github-actions[bot] commented 3 years ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.