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 windows enum #9

Merged
merged 1 commit into from
Oct 7, 2022
Merged
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
13 changes: 7 additions & 6 deletions tsschecker/tsschecker.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ static const char *win_paths[4];
enum paths{
kWINPathTSSCHECKER,
kWINPathOTA,
kWINPathBeta,
kWINPathFIRMWARE
kWINPathFIRMWARE,
kWINPathBetaFIRMWARE
};

static const char *win_pathvars[]={
"\\tsschecker",
"\\ota.json",
"\\firmwares.json"
"\\firmwares.json",
"\\betas_"
};

static const char *win_path_get(enum paths path){
Expand All @@ -94,6 +95,7 @@ static const char *win_path_get(enum paths path){
#define FIRMWARE_JSON_PATH win_path_get(kWINPathFIRMWARE)
#define FIRMWARE_OTA_JSON_PATH win_path_get(kWINPathOTA)
#define FIRMWARE_BETA_JSON_PATH win_path_get(kWINPathBeta)
#define FIRMWARE_BETA_JSON_PATH win_path_get(kWINPathBetaFIRMWARE)
#define DIRECTORY_DELIMITER_STR "\\"
#define DIRECTORY_DELIMITER_CHR '\\'

Expand Down Expand Up @@ -745,7 +747,6 @@ char *getBuildManifest(char *url, const char *device, const char *version, const
index = i;
}
}

char *buildmanifest_url = malloc(strlen(url));
buildmanifest_url = strncpy(buildmanifest_url, url, index);
buildmanifest_url[index] = '\0';
Expand Down Expand Up @@ -934,7 +935,7 @@ int tss_populate_random(plist_t tssreq, int is64bit, t_devicevals *devVals){
else if (devVals->parsedApnonceLen != nonceLen)
return error("[TSSR] parsed APNoncelen != requiredAPNoncelen (%u != %u)\n",(unsigned int)devVals->parsedApnonceLen,(unsigned int)nonceLen),-1;
}else{
devVals->apnonce = (char*)malloc((devVals->parsedApnonceLen = nonceLen)+1);
devVals->apnonce = (char*)calloc(1, (devVals->parsedApnonceLen = nonceLen)+1);
//nonce is derived from generator with SHA1
if (nonceLen == 20) {
unsigned char zz[9] = {0};
Expand Down Expand Up @@ -983,7 +984,7 @@ int tss_populate_random(plist_t tssreq, int is64bit, t_devicevals *devVals){
if (devVals->parsedSepnonceLen != NONCELEN_SEP)
return error("[TSSR] parsed SEPNoncelen != requiredSEPNoncelen (%u != %u)",(unsigned int)devVals->parsedSepnonceLen,(unsigned int)NONCELEN_SEP),-1;
}else{
devVals->sepnonce = (char*)malloc((devVals->parsedSepnonceLen = NONCELEN_SEP) +1);
devVals->sepnonce = (char*)calloc(1, (devVals->parsedSepnonceLen = NONCELEN_SEP) +1);
getRandNum(devVals->sepnonce, devVals->parsedSepnonceLen, 256);
}

Expand Down