Skip to content

Commit dcd24d9

Browse files
authored
1 parent e592087 commit dcd24d9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

build/azure-pipelines/common/sign.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/azure-pipelines/common/sign.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,12 @@ export function main([esrpCliPath, type, folderPath, pattern]: string[]) {
140140

141141
const key = crypto.randomBytes(32);
142142
const iv = crypto.randomBytes(16);
143+
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
144+
const encryptedToken = cipher.update(process.env['SYSTEM_ACCESSTOKEN']!.trim(), 'utf8', 'hex') + cipher.final('hex');
145+
143146
const encryptionDetailsPath = tmp.tmpNameSync();
144147
fs.writeFileSync(encryptionDetailsPath, JSON.stringify({ key: key.toString('hex'), iv: iv.toString('hex') }));
145148

146-
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
147-
const encryptedToken = cipher.update(process.env['SYSTEM_ACCESSTOKEN']!.trim(), 'utf8', 'hex') + cipher.final('hex');
148149
const encryptedTokenPath = tmp.tmpNameSync();
149150
fs.writeFileSync(encryptedTokenPath, encryptedToken);
150151

0 commit comments

Comments
 (0)