Skip to content

Commit 9452c90

Browse files
committed
fix(profile): set default hash for empty package
1 parent b3b7976 commit 9452c90

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/main/customization/packager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import debug_ from "debug";
99
import * as fs from "fs";
1010
import * as path from "path";
11+
import * as crypto from "crypto";
1112

1213
import { extractCrc32OnZip } from "../tools/crc";
1314
import { createSign, createVerify } from "crypto";
@@ -107,7 +108,7 @@ export async function createProfilePackageZip(
107108
}, 200); // to avoid issues with some filesystems (allow extra completion time)
108109
});
109110
} else {
110-
manifest.contentHash = "";
111+
manifest.contentHash = crypto.createHash("sha1").update("|").digest("hex");
111112
manifest.signature = undefined;
112113

113114
if (signed) {

src/main/customization/provisioning.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ async function checkIfProfilePackageSigned(manifest: ICustomizationManifest, pac
123123
const packageAbsolutePath = path.join(customizationWellKnownFolder, packageFileName);
124124
const contentHash = await extractCrc32OnZip(packageAbsolutePath, "profile");
125125
if (manifest.contentHash !== contentHash) {
126+
debug("manifest.contentHash=", manifest.contentHash);
127+
debug("contentHash=", contentHash);
126128
return Promise.reject("manifest contentHash missmatch");
127129
}
128130

0 commit comments

Comments
 (0)