-
Notifications
You must be signed in to change notification settings - Fork 300
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
base: master
Are you sure you want to change the base?
Conversation
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"); |
There was a problem hiding this comment.
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
bump |
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. |
Ill get this merged after fixing some merge conflict. |
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.