Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreadman committed Nov 22, 2024
2 parents e9499c7 + 7248aaa commit 401ba6b
Show file tree
Hide file tree
Showing 143 changed files with 3,016 additions and 889 deletions.
11 changes: 10 additions & 1 deletion build/azure-pipelines/common/sign.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion build/azure-pipelines/common/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ export function main([esrpCliPath, type, folderPath, pattern]: string[]) {
const tmp = new Temp();
process.on('exit', () => tmp.dispose());

const key = crypto.randomBytes(32);
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
const encryptedToken = cipher.update(process.env['SYSTEM_ACCESSTOKEN']!.trim(), 'utf8', 'hex') + cipher.final('hex');

const encryptionDetailsPath = tmp.tmpNameSync();
fs.writeFileSync(encryptionDetailsPath, JSON.stringify({ key: key.toString('hex'), iv: iv.toString('hex') }));

const encryptedTokenPath = tmp.tmpNameSync();
fs.writeFileSync(encryptedTokenPath, encryptedToken);

const patternPath = tmp.tmpNameSync();
fs.writeFileSync(patternPath, pattern);

Expand All @@ -157,7 +168,8 @@ export function main([esrpCliPath, type, folderPath, pattern]: string[]) {
managedIdentityTenantId: process.env['VSCODE_ESRP_TENANT_ID'],
serviceConnectionId: process.env['VSCODE_ESRP_SERVICE_CONNECTION_ID'],
tempDirectory: os.tmpdir(),
systemAccessToken: process.env['SYSTEM_ACCESSTOKEN']
systemAccessToken: encryptedTokenPath,
encryptionKey: encryptionDetailsPath
};

const args = [
Expand Down
Loading

0 comments on commit 401ba6b

Please sign in to comment.