Change:
Continue installing the extension when signature verification fails - Report the error in telemetry CC
To verify: Install extension and make sure the extension is installed successfully. Also make sure you see following in the Shared log

Discussion:
import { Emitter, Event } from 'vs/base/common/event'; import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { isWeb } from 'vs/base/common/platform'; <ins> import { isDefined } from 'vs/base/common/types'; </ins> import { URI } from 'vs/base/common/uri'; import * as nls from 'vs/nls'; import {

import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; <del> export const enum ExtensionVerificationStatus { 'Verified' = 'Verified', 'Unverified' = 'Unverified', 'UnknownError' = 'UnknownError', } </del> <ins> export type ExtensionVerificationStatus = boolean | string; </ins> export type InstallExtensionTaskOptions = InstallOptions & InstallVSIXOptions & { readonly profileLocation: URI }; export interface IInstallExtensionTask {

let errorcode: ExtensionManagementErrorCode | undefined; let errorcodeDetail: string | undefined; <ins> if (isDefined(verificationStatus)) { if (verificationStatus === true) { verificationStatus = 'Verified'; } else if (verificationStatus === false) { verificationStatus = 'Unverified'; } else { errorcode = ExtensionManagementErrorCode.Signature; errorcodeDetail = verificationStatus; verificationStatus = 'Unverified'; } } </ins> if (error) { if (error instanceof ExtensionManagementError) { errorcode = error.code;

throw new ExtensionManagementError(error.message, ExtensionManagementErrorCode.Download); } <del> let verificationStatus: ExtensionVerificationStatus = ExtensionVerificationStatus.Unverified; </del> <ins> let verificationStatus: ExtensionVerificationStatus = false; </ins> if (verifySignature && this.shouldVerifySignature(extension)) { const signatureArchiveLocation = await this.downloadSignatureArchive(extension); try { <del> const verified = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath, this.logService.getLevel() === LogLevel.Trace); if (verified) { verificationStatus = ExtensionVerificationStatus.Verified; } this.logService.info(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); </del> <ins> verificationStatus = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath, this.logService.getLevel() === LogLevel.Trace); </ins> } catch (error) { const sigError = error as ExtensionSignatureVerificationError; <del> const code: string = sigError.code; </del> <ins> verificationStatus = sigError.code; </ins> if (sigError.output) { this.logService.trace(`Extension signature verification details for ${extension.identifier.id} ${extension.version}:n${sigError.output}`); } <del> if (code === ExtensionSignaturetErrorCode.UnknownError) { verificationStatus = ExtensionVerificationStatus.UnknownError; this.logService.warn(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); } else if (code === ExtensionSignaturetErrorCode.PackageIsInvalidZip || code === ExtensionSignaturetErrorCode.SignatureArchiveIsInvalidZip) { </del> <ins> if (verificationStatus === ExtensionSignaturetErrorCode.PackageIsInvalidZip || verificationStatus === ExtensionSignaturetErrorCode.SignatureArchiveIsInvalidZip) { </ins> throw new ExtensionManagementError(CorruptZipMessage, ExtensionManagementErrorCode.CorruptZip); <del> } else if (!sigError.didExecute) { this.logService.warn(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus} (${code})`); } else { await this.delete(location); throw new ExtensionManagementError(code, ExtensionManagementErrorCode.Signature); </del> } } finally { try {

} } <ins> if (verificationStatus === true) { this.logService.info(`Extension signature is verified: ${extension.identifier.id}`); } else if (verificationStatus === false) { this.logService.info(`Extension signature verification is not done: ${extension.identifier.id}`); } else { this.logService.warn(`Extension signature verification failed with error '${verificationStatus}': ${extension.identifier.id}`); } </ins> return { location, verificationStatus }; }

private _profileLocation = this.options.profileLocation; get profileLocation() { return this._profileLocation; } <del> protected _verificationStatus = ExtensionVerificationStatus.Unverified; </del> <ins> protected _verificationStatus: ExtensionVerificationStatus = false; </ins> get verificationStatus() { return this._verificationStatus; } protected _operation = InstallOperation.Install;

import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; <del> import { ExtensionVerificationStatus } from 'vs/platform/extensionManagement/common/abstractExtensionManagementService'; import { ExtensionManagementError, ExtensionManagementErrorCode, getTargetPlatform, IExtensionGalleryService, IGalleryExtension, IGalleryExtensionAssets, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; </del> <ins> import { getTargetPlatform, IExtensionGalleryService, IGalleryExtension, IGalleryExtensionAssets, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; </ins> import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService';

await testObject.run(); <del> assert.strictEqual(testObject.verificationStatus, ExtensionVerificationStatus.Unverified); </del> <ins> assert.strictEqual(testObject.verificationStatus, errorCode); </ins> assert.strictEqual(testObject.installed, true); }); <del> test('if verification fails, the task throws', async () => { </del> <ins> test('if verification fails', async () => { </ins> const errorCode = 'IntegrityCheckFailed'; const testObject = new TestInstallGalleryExtensionTask(aGalleryExtension('a', { isSigned: true }), anExtensionsDownloader({ isSignatureVerificationEnabled: true, verificationResult: errorCode, didExecute: true })); <del> try { await testObject.run(); } catch (e) { assert.ok(e instanceof ExtensionManagementError); assert.strictEqual(e.code, ExtensionManagementErrorCode.Signature); assert.strictEqual(e.message, errorCode); assert.strictEqual(testObject.verificationStatus, ExtensionVerificationStatus.Unverified); assert.strictEqual(testObject.installed, false); return; } </del> <ins> await testObject.run(); </ins> <del> assert.fail('It should have thrown.'); </del> <ins> assert.strictEqual(testObject.verificationStatus, errorCode); assert.strictEqual(testObject.installed, true); </ins> }); test('if verification succeeds, the task completes', async () => {

await testObject.run(); <del> assert.strictEqual(testObject.verificationStatus, ExtensionVerificationStatus.Verified); </del> <ins> assert.strictEqual(testObject.verificationStatus, true); </ins> assert.strictEqual(testObject.installed, true); });

await testObject.run(); <del> assert.strictEqual(testObject.verificationStatus, ExtensionVerificationStatus.Unverified); </del> <ins> assert.strictEqual(testObject.verificationStatus, false); </ins> assert.strictEqual(testObject.installed, true); });