Skip to content

Commit 125dc02

Browse files
committed
Disallow CRC-32 variants
1 parent 5bce481 commit 125dc02

File tree

4 files changed

+0
-72
lines changed

4 files changed

+0
-72
lines changed

SabreTools.Serialization.Test/MetadataDeserializationTests.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,6 @@ public void EverdriveSMDBDeserializeTest(string path, long count)
235235

236236
[Theory]
237237
[InlineData("test-sfv-files.sfv", HashType.CRC32, 100)]
238-
[InlineData("test-sfv-files.sfv", HashType.CRC32_AIXM, 100)] // Not technically the same as normal CRC-32
239-
[InlineData("test-sfv-files.sfv", HashType.CRC32_AUTOSAR, 100)] // Not technically the same as normal CRC-32
240-
[InlineData("test-sfv-files.sfv", HashType.CRC32_BASE91D, 100)] // Not technically the same as normal CRC-32
241-
[InlineData("test-sfv-files.sfv", HashType.CRC32_BZIP2, 100)] // Not technically the same as normal CRC-32
242-
[InlineData("test-sfv-files.sfv", HashType.CRC32_CDROMEDC, 100)] // Not technically the same as normal CRC-32
243-
[InlineData("test-sfv-files.sfv", HashType.CRC32_CKSUM, 100)] // Not technically the same as normal CRC-32
244-
[InlineData("test-sfv-files.sfv", HashType.CRC32_ISCSI, 100)] // Not technically the same as normal CRC-32
245-
[InlineData("test-sfv-files.sfv", HashType.CRC32_ISOHDLC, 100)]
246-
[InlineData("test-sfv-files.sfv", HashType.CRC32_JAMCRC, 100)] // Not technically the same as normal CRC-32
247-
[InlineData("test-sfv-files.sfv", HashType.CRC32_MEF, 100)] // Not technically the same as normal CRC-32
248-
[InlineData("test-sfv-files.sfv", HashType.CRC32_MPEG2, 100)] // Not technically the same as normal CRC-32
249-
[InlineData("test-sfv-files.sfv", HashType.CRC32_XFER, 100)] // Not technically the same as normal CRC-32
250238
[InlineData("test-md5-files.md5", HashType.MD5, 100)]
251239
[InlineData("test-sha1-files.sha1", HashType.SHA1, 100)]
252240
[InlineData("test-sha256.sha256", HashType.SHA256, 1)]
@@ -267,18 +255,6 @@ public void HashfileDeserializeTest(string path, HashType hash, long count)
267255
switch (hash)
268256
{
269257
case HashType.CRC32:
270-
case HashType.CRC32_AIXM:
271-
case HashType.CRC32_AUTOSAR:
272-
case HashType.CRC32_BASE91D:
273-
case HashType.CRC32_BZIP2:
274-
case HashType.CRC32_CDROMEDC:
275-
case HashType.CRC32_CKSUM:
276-
case HashType.CRC32_ISCSI:
277-
case HashType.CRC32_ISOHDLC:
278-
case HashType.CRC32_JAMCRC:
279-
case HashType.CRC32_MEF:
280-
case HashType.CRC32_MPEG2:
281-
case HashType.CRC32_XFER:
282258
Assert.NotNull(dat.SFV);
283259
Assert.Equal(count, dat.SFV.Length);
284260
break;

SabreTools.Serialization/CrossModel/Hashfile.Deserializer.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,6 @@ private static Models.Hashfile.Hashfile ConvertMachineFromInternalModel(Models.M
103103
return new Models.Hashfile.Hashfile
104104
{
105105
SFV = hash == HashType.CRC32
106-
|| hash == HashType.CRC32_AIXM
107-
|| hash == HashType.CRC32_AUTOSAR
108-
|| hash == HashType.CRC32_BASE91D
109-
|| hash == HashType.CRC32_BZIP2
110-
|| hash == HashType.CRC32_CDROMEDC
111-
|| hash == HashType.CRC32_CKSUM
112-
|| hash == HashType.CRC32_ISCSI
113-
|| hash == HashType.CRC32_ISOHDLC
114-
|| hash == HashType.CRC32_JAMCRC
115-
|| hash == HashType.CRC32_MEF
116-
|| hash == HashType.CRC32_MPEG2
117-
|| hash == HashType.CRC32_XFER
118106
? roms
119107
.Where(r => r != null)
120108
.Select(ConvertToSFV)

SabreTools.Serialization/Deserializers/Hashfile.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,6 @@ public class Hashfile : BaseBinaryDeserializer<Models.Hashfile.Hashfile>
106106
switch (hash)
107107
{
108108
case HashType.CRC32:
109-
case HashType.CRC32_AIXM:
110-
case HashType.CRC32_AUTOSAR:
111-
case HashType.CRC32_BASE91D:
112-
case HashType.CRC32_BZIP2:
113-
case HashType.CRC32_CDROMEDC:
114-
case HashType.CRC32_CKSUM:
115-
case HashType.CRC32_ISCSI:
116-
case HashType.CRC32_ISOHDLC:
117-
case HashType.CRC32_JAMCRC:
118-
case HashType.CRC32_MEF:
119-
case HashType.CRC32_MPEG2:
120-
case HashType.CRC32_XFER:
121109
var sfv = new SFV
122110
{
123111
#if NETFRAMEWORK
@@ -209,18 +197,6 @@ public class Hashfile : BaseBinaryDeserializer<Models.Hashfile.Hashfile>
209197
switch (hash)
210198
{
211199
case HashType.CRC32:
212-
case HashType.CRC32_AIXM:
213-
case HashType.CRC32_AUTOSAR:
214-
case HashType.CRC32_BASE91D:
215-
case HashType.CRC32_BZIP2:
216-
case HashType.CRC32_CDROMEDC:
217-
case HashType.CRC32_CKSUM:
218-
case HashType.CRC32_ISCSI:
219-
case HashType.CRC32_ISOHDLC:
220-
case HashType.CRC32_JAMCRC:
221-
case HashType.CRC32_MEF:
222-
case HashType.CRC32_MPEG2:
223-
case HashType.CRC32_XFER:
224200
dat.SFV = hashes.Cast<SFV>().ToArray();
225201
break;
226202
case HashType.MD5:

SabreTools.Serialization/Serializers/Hashfile.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,6 @@ public bool Serialize(Models.Hashfile.Hashfile? obj, string? path, HashType hash
101101
switch (hash)
102102
{
103103
case HashType.CRC32:
104-
case HashType.CRC32_AIXM:
105-
case HashType.CRC32_AUTOSAR:
106-
case HashType.CRC32_BASE91D:
107-
case HashType.CRC32_BZIP2:
108-
case HashType.CRC32_CDROMEDC:
109-
case HashType.CRC32_CKSUM:
110-
case HashType.CRC32_ISCSI:
111-
case HashType.CRC32_ISOHDLC:
112-
case HashType.CRC32_JAMCRC:
113-
case HashType.CRC32_MEF:
114-
case HashType.CRC32_MPEG2:
115-
case HashType.CRC32_XFER:
116104
WriteSFV(obj.SFV, writer);
117105
break;
118106
case HashType.MD5:

0 commit comments

Comments
 (0)