Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update match manual decryption example #1196

Merged
merged 3 commits into from
Apr 24, 2023
Merged

Conversation

tylermilner
Copy link
Contributor

When attempting to manually decrypt some provisioning profiles generated by match, I noticed that the existing manual decryption example was generating a bad decrypt error:

tylermilner@Tylers-MBP adhoc % openssl aes-256-cbc -k 'password' -in 'AdHoc_com.tylermilner.appname.mobileprovision' -out 'AdHoc_com.tylermilner.appname.decrypted.mobileprovision' -a -d       
bad decrypt
8547113792:error:06FFF064:digital envelope routines:CRYPTO_internal:bad decrypt:/AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/evp/evp_enc.c:554:

Based on the code samples for .cer + .p12 repackaging, I noticed that they have the -md flag specified at the end. Adding this flag with the appropriate hash type results in a successful decryption:

tylermilner@Tylers-MBP adhoc % openssl aes-256-cbc -k 'password' -in 'AdHoc_com.tylermilner.appname.mobileprovision' -out 'AdHoc_com.tylermilner.appname.decrypted.mobileprovision' -a -d -md md5

Also in my case, my match repo password contains an exclamation point !, which was causing dquote> to be output with no actual decryption happening when run:

tylermilner@Tylers-MBP adhoc % openssl aes-256-cbc -k "password!" -in "AdHoc_com.tylermilner.appname.mobileprovision" -out "AdHoc_com.tylermilner.appname.decrypted.mobileprovision" -a -d -md md5
dquote> 

It appears that the ! was causing the trailing quote for the password parameter to get removed when run, which I could verify by pressing up arrow to stage the previous command in Terminal (notice missing double quote " after password):

openssl aes-256-cbc -k "password! -in "AdHoc_com.tylermilner.appname.mobileprovision" -out "AdHoc_com.tylermilner.appname.decrypted.mobileprovision" -a -d -md md5

Switching from double quotes to single quotes as suggested in this SO post, allowed my command to succeed with the ! in the password. I added a note here in the docs to make others aware as well.

@google-cla
Copy link

google-cla bot commented Apr 24, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Well done! Great improvement, thank you so much!

@rogerluan
Copy link
Member

Netlify deploy is broken on master too, so we can merge this in as is :)

@rogerluan rogerluan merged commit da7358f into fastlane:master Apr 24, 2023
2 of 3 checks passed
rogerluan added a commit to fastlane/fastlane that referenced this pull request May 25, 2023
getaaron pushed a commit to fastlane/fastlane that referenced this pull request Jul 4, 2023
… match documentation examples (#21302)

* Incorporate changes made in fastlane/docs#1196.

* Improve wording and fix typos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants