Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/3 Code Health/7333.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused SHA512 hashing code.
43 changes: 0 additions & 43 deletions src/client/common/crypto.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/client/common/platform/fileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,6 @@ export class FileSystemUtils implements IFileSystemUtils {
}
}

// We *could* use ICryptoUtils, but it's a bit overkill, issue tracked
// in https://github.com/microsoft/vscode-python/issues/8438.
export function getHashString(data: string): string {
const hash = createHash('sha512');
hash.update(data);
Expand Down
3 changes: 0 additions & 3 deletions src/client/common/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
IAsyncDisposableRegistry,
IBrowserService,
IConfigurationService,
ICryptoUtils,
ICurrentProcess,
IEditorUtils,
IExperimentService,
Expand Down Expand Up @@ -59,7 +58,6 @@ import { WorkspaceService } from './application/workspace';
import { AsyncDisposableRegistry } from './asyncDisposableRegistry';
import { ConfigurationService } from './configuration/service';
import { PipEnvExecutionPath } from './configuration/executionSettings/pipEnvExecution';
import { CryptoUtils } from './crypto';
import { EditorUtils } from './editor';
import { ExperimentService } from './experiments/service';
import {
Expand Down Expand Up @@ -161,7 +159,6 @@ export function registerTypes(serviceManager: IServiceManager): void {
ITerminalActivationHandler,
PowershellTerminalActivationFailedHandler,
);
serviceManager.addSingleton<ICryptoUtils>(ICryptoUtils, CryptoUtils);
serviceManager.addSingleton<IExperimentService>(IExperimentService, ExperimentService);

serviceManager.addSingleton<ITerminalHelper>(ITerminalHelper, TerminalHelper);
Expand Down
19 changes: 0 additions & 19 deletions src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,25 +471,6 @@ export interface IHashFormat {
string: string; // If hash format is a string
}

/**
* Interface used to implement cryptography tools
*/
export const ICryptoUtils = Symbol('ICryptoUtils');
export interface ICryptoUtils {
/**
* Creates hash using the data and encoding specified
* @returns hash as number, or string
* @param data The string to hash
* @param hashFormat Return format of the hash, number or string
* @param [algorithm]
*/
createHash<E extends keyof IHashFormat>(
data: string,
hashFormat: E,
algorithm?: 'SHA512' | 'SHA256' | 'FNV',
): IHashFormat[E];
}

export const IAsyncDisposableRegistry = Symbol('IAsyncDisposableRegistry');
export interface IAsyncDisposableRegistry extends IAsyncDisposable {
push(disposable: IDisposable | IAsyncDisposable): void;
Expand Down
143 changes: 0 additions & 143 deletions src/test/common/crypto.unit.test.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/test/common/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
import { WorkspaceService } from '../../client/common/application/workspace';
import { AsyncDisposableRegistry } from '../../client/common/asyncDisposableRegistry';
import { ConfigurationService } from '../../client/common/configuration/service';
import { CryptoUtils } from '../../client/common/crypto';
import { EditorUtils } from '../../client/common/editor';
import { ExperimentService } from '../../client/common/experiments/service';
import {
Expand Down Expand Up @@ -93,7 +92,6 @@ import {
IAsyncDisposableRegistry,
IBrowserService,
IConfigurationService,
ICryptoUtils,
ICurrentProcess,
IEditorUtils,
IExperimentService,
Expand Down Expand Up @@ -214,7 +212,6 @@ suite('Installer', () => {
ITerminalActivationHandler,
PowershellTerminalActivationFailedHandler,
);
ioc.serviceManager.addSingleton<ICryptoUtils>(ICryptoUtils, CryptoUtils);
ioc.serviceManager.addSingleton<IExperimentService>(IExperimentService, ExperimentService);

ioc.serviceManager.addSingleton<ITerminalHelper>(ITerminalHelper, TerminalHelper);
Expand Down
3 changes: 0 additions & 3 deletions src/test/common/moduleInstaller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
import { WorkspaceService } from '../../client/common/application/workspace';
import { AsyncDisposableRegistry } from '../../client/common/asyncDisposableRegistry';
import { ConfigurationService } from '../../client/common/configuration/service';
import { CryptoUtils } from '../../client/common/crypto';
import { EditorUtils } from '../../client/common/editor';
import { DiscoveryVariants } from '../../client/common/experiments/groups';
import { ExperimentService } from '../../client/common/experiments/service';
Expand Down Expand Up @@ -94,7 +93,6 @@ import {
IAsyncDisposableRegistry,
IBrowserService,
IConfigurationService,
ICryptoUtils,
ICurrentProcess,
IEditorUtils,
IExperimentService,
Expand Down Expand Up @@ -256,7 +254,6 @@ suite('Module Installer', () => {
ITerminalActivationHandler,
PowershellTerminalActivationFailedHandler,
);
ioc.serviceManager.addSingleton<ICryptoUtils>(ICryptoUtils, CryptoUtils);
ioc.serviceManager.addSingleton<IExperimentService>(IExperimentService, ExperimentService);

ioc.serviceManager.addSingleton<ITerminalActivationCommandProvider>(
Expand Down
3 changes: 0 additions & 3 deletions src/test/common/serviceRegistry.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { WorkspaceService } from '../../client/common/application/workspace';
import { AsyncDisposableRegistry } from '../../client/common/asyncDisposableRegistry';
import { ConfigurationService } from '../../client/common/configuration/service';
import { PipEnvExecutionPath } from '../../client/common/configuration/executionSettings/pipEnvExecution';
import { CryptoUtils } from '../../client/common/crypto';
import { EditorUtils } from '../../client/common/editor';
import {
ExtensionInsidersDailyChannelRule,
Expand Down Expand Up @@ -82,7 +81,6 @@ import {
IAsyncDisposableRegistry,
IBrowserService,
IConfigurationService,
ICryptoUtils,
ICurrentProcess,
IEditorUtils,
IExtensions,
Expand Down Expand Up @@ -130,7 +128,6 @@ suite('Common - Service Registry', () => {
[INugetService, NugetService],
[ITerminalActivator, TerminalActivator],
[ITerminalActivationHandler, PowershellTerminalActivationFailedHandler],
[ICryptoUtils, CryptoUtils],
[ITerminalHelper, TerminalHelper],
[ITerminalActivationCommandProvider, PyEnvActivationCommandProvider, TerminalActivationProviders.pyenv],
[ITerminalActivationCommandProvider, Bash, TerminalActivationProviders.bashCShellFish],
Expand Down