Skip to content

Commit c942cf1

Browse files
committed
switch up the hash algos used
fixes #38 mutes some security warnings, as md5 is deprecated and sha1 is considered less secure. this implementation uses them purely for change tracking, so no security concerns. updating the code should silence any warnings on this
1 parent bf28c64 commit c942cf1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Direct_Framework/Stored Procedures/omd.RegisterBatch.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ BEGIN TRY
150150
-- Evaluate the incoming values to see if the Batch should be updated.
151151
-- Note that the active indicator is excluded here, to allow it to be managed separately.
152152
DECLARE @NewChecksum BINARY(20) =
153-
HASHBYTES('SHA1',
153+
HASHBYTES('SHA2_512',
154154
@BatchType + '!' +
155155
@BatchFrequency + '!' +
156156
@BatchDescription
@@ -163,7 +163,7 @@ BEGIN TRY
163163
-- Evaluate the existing values to see if the Module requires to be updated.
164164
DECLARE @ExistingChecksum BINARY(20);
165165
SELECT @ExistingChecksum =
166-
HASHBYTES('SHA1',
166+
HASHBYTES('SHA2_512',
167167
COALESCE([BATCH_TYPE], 'N/A') + '!' +
168168
COALESCE([FREQUENCY_CODE], 'N/A') + '!' +
169169
COALESCE([BATCH_DESCRIPTION], 'N/A'))

Direct_Framework/Stored Procedures/omd.RegisterModule.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ BEGIN TRY
187187
-- Note that the active indicator is excluded here,
188188
-- to allow it to be managed separately.
189189
DECLARE @NewChecksum BINARY(20) =
190-
HASHBYTES('SHA1',
190+
HASHBYTES('SHA2_512',
191191
@ModuleType + '!' +
192192
@ModuleSourceDataObject + '!' +
193193
@ModuleTargetDataObject + '!' +
@@ -203,7 +203,7 @@ BEGIN TRY
203203
-- Evaluate the existing values to see if the Module requires to be updated.
204204
DECLARE @ExistingChecksum BINARY(20);
205205
SELECT @ExistingChecksum =
206-
HASHBYTES('SHA1',
206+
HASHBYTES('SHA2_512',
207207
COALESCE([MODULE_TYPE], 'N/A') + '!' +
208208
COALESCE([DATA_OBJECT_SOURCE], 'N/A') + '!' +
209209
COALESCE([DATA_OBJECT_TARGET], 'N/A') + '!' +

Direct_Framework/Stored Procedures/omd.TableCondensing.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ BEGIN TRY
216216
SET @FinalQuery = 'WITH CondensingCTE AS' + CHAR(10);
217217
SET @FinalQuery = @FinalQuery + '(' + CHAR(10);
218218
SET @FinalQuery = @FinalQuery + 'SELECT' + CHAR(10);
219-
SET @FinalQuery = @FinalQuery + ' HASHBYTES(''MD5'',' + CHAR(10);
219+
SET @FinalQuery = @FinalQuery + ' HASHBYTES(''SHA2_512'',' + CHAR(10);
220220
SET @FinalQuery = @FinalQuery + @HashSnippet;
221221
SET @FinalQuery = @FinalQuery + ' ) AS FULL_ROW_CHECKSUM,' + CHAR(10);
222222
SET @FinalQuery = @FinalQuery + ' *' + CHAR(10);

0 commit comments

Comments
 (0)