Skip to content

Commit

Permalink
💄 (#234417)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno authored and osortega committed Nov 26, 2024
1 parent dff8203 commit c337f26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build/azure-pipelines/common/sign.js

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

5 changes: 3 additions & 2 deletions build/azure-pipelines/common/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ export function main([esrpCliPath, type, folderPath, pattern]: string[]) {

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 cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
const encryptedToken = cipher.update(process.env['SYSTEM_ACCESSTOKEN']!.trim(), 'utf8', 'hex') + cipher.final('hex');
const encryptedTokenPath = tmp.tmpNameSync();
fs.writeFileSync(encryptedTokenPath, encryptedToken);

Expand Down

0 comments on commit c337f26

Please sign in to comment.