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

Allow for specifying an arbitrary Team ID #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _ldid
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ _arguments \
'-K-[Signing private key]:key:_files' \
'-P-[Set as platform]:number' \
'-U-[Password for -K]' \
'-T-[Set team identifier]:identifier' \
'*: :_files'
14 changes: 13 additions & 1 deletion ldid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ bool flag_U(false);
std::string password = "";
std::vector<std::string> cleanup;
bool flag_H(false);
const char *flag_t(NULL);

template <typename Type_>
struct Iterator_ {
Expand Down Expand Up @@ -2268,6 +2269,13 @@ Hash Sign(const void *idata, size_t isize, std::streambuf &output, const std::st
get(common, name, NID_commonName);
}

if (flag_t != NULL) {
if (strlen(flag_t) != 10) {
fprintf(stderr, "ldid: Team ID must be 10 characters long\n");
exit(1);
}
team = flag_t;
}

std::stringbuf backing;

Expand Down Expand Up @@ -3302,7 +3310,7 @@ static void usage(const char *argv0) {
fprintf(stderr, " host | kill | library-validation | restrict | runtime | linker-signed]] [-D] [-d]\n");
fprintf(stderr, " [-Enum:file] [-e] [-H[sha1 | sha256]] [-h] [-Iname]\n");
fprintf(stderr, " [-Kkey.p12 [-Upassword]] [-M] [-P[num]] [-Qrequirements.xml] [-q]\n");
fprintf(stderr, " [-r | -Sfile.xml | -s] [-w] [-u] [-arch arch_type] file ...\n");
fprintf(stderr, " [-r | -Sfile.xml | -s] [-w] [-u] [-tTeamID] [-arch arch_type] file ...\n");
Copy link
Member

Choose a reason for hiding this comment

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

What format is TeamID supposed to be in? Add this flag and the format to the manpage.

fprintf(stderr, "Common Options:\n");
fprintf(stderr, " -S[file.xml] Pseudo-sign using the entitlements in file.xml\n");
fprintf(stderr, " -w Shallow sign\n");
Expand Down Expand Up @@ -3579,6 +3587,10 @@ int main(int argc, char *argv[]) {
flag_u = true;
} break;

case 't': {
flag_t = argv[argi] + 2;
} break;

case 'I': {
flag_I = argv[argi] + 2;
} break;
Expand Down