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

Fix for segfaults with empty keys, a couple editions to allow building on iPhone devices. #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bmmcginty
Copy link

Didn't include my keychain_dumper binary in last commit. Figured it was better to have original author compile and release.
I'm going to add printing of private/public? keys, I'll send that along as well to take or leave.
I hope this is useful.
Appologies for any code style issues, if there are any.

Brandon McGinty-Carroll added 3 commits February 11, 2014 11:17
Keys whose length is 0 cause segfaults when requesting the following properties:
kSecAttrIsPermanent
kSecAttrCanEncrypt
kSecAttrCanDecrypt
kSecAttrCanDerive
kSecAttrCanSign
kSecAttrCanVerify
kSecAttrCanWrap
kSecAttrCanUnwrap
This commit insures that only those keys with a kSecAttrKeySizeInBits greater than 0 requests any of the above attributes.
…ly on IOS devices

Sign uses the ldid tool to sign the keychain_dumper binary.
This allows for signing and running keychain_dumper, even if one does not have a Mac and the codesign tool.
… use $BIN

If compiling on the iPhone platform, the -arch option causes gcc to fail.
This commit checks the type of the compiling machine using uname -m, and removes the -arch argument if it finds the string "iphone" in the result of
said check.
Also fix the sign command to use the $BIN path when calling ldid.
printToStdOut(@"For Key Wrapping: %@\n", CFBooleanGetValue((CFBooleanRef)[keyItem objectForKey:(id)kSecAttrCanWrap]) == true ? @"True" : @"False");
printToStdOut(@"For Key Unwrapping: %@\n\n", CFBooleanGetValue((CFBooleanRef)[keyItem objectForKey:(id)kSecAttrCanUnwrap]) == true ? @"True" : @"False");
if (keySize) {
printToStdOut(@"For Encryption: %@\n", CFBooleanGetValue((CFBooleanRef)[keyItem objectForKey:(id)kSecAttrCanEncrypt]) == true ? @"True" : @"False");
Copy link
Owner

Choose a reason for hiding this comment

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

Is that an extra space?

change single spaces to tabs for new code
@bored-engineer
Copy link

bump

@ptoomey3
Copy link
Owner

ptoomey3 commented Jul 8, 2014

Sorry for such a late reply. I've not kept up with iOS jailbreaking in recent history. I quickly attempted to see if my original README for compiling still worked, but it appears the instructions are a bit dated. If you would like to help me merge this/update the binary it would be super 🆒 if you could also update the readme so that it is up to date with the current build tool locations/etc. If you don't have the time I may eventually get around to getting this built, but it could be some time.

@ikkisoft ikkisoft mentioned this pull request Mar 24, 2018
@ptoomey3
Copy link
Owner

Ill get this merged after fixing some merge conflict.

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.

3 participants