Skip to content

Commit

Permalink
Using modern crypto, changed file bookmarks access hash to SHA256
Browse files Browse the repository at this point in the history
  • Loading branch information
vashpan committed May 29, 2021
1 parent 0ec230a commit 3f0072a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 49 deletions.
4 changes: 0 additions & 4 deletions DevCleaner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
71C8ACE020A62B8000E7A13B /* ScanReminders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71C8ACDF20A62B8000E7A13B /* ScanReminders.swift */; };
71E7F836214E8D4400A11601 /* URL+AcquireAccessFromSandbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71E7F835214E8D4400A11601 /* URL+AcquireAccessFromSandbox.swift */; };
71E7F838214E930500A11601 /* Alerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71E7F837214E930500A11601 /* Alerts.swift */; };
71E7F83A214E9A4300A11601 /* String+MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71E7F839214E9A4300A11601 /* String+MD5.swift */; };
71FD37D7206AD6BE0042812D /* ArchiveFileEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71FD37D6206AD6BE0042812D /* ArchiveFileEntry.swift */; };
71FD37D9206AD72C0042812D /* DeviceSupportFileEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71FD37D8206AD72C0042812D /* DeviceSupportFileEntry.swift */; };
71FD37DD206AD76D0042812D /* DerivedDataFileEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71FD37DC206AD76D0042812D /* DerivedDataFileEntry.swift */; };
Expand Down Expand Up @@ -105,7 +104,6 @@
71C8ACDF20A62B8000E7A13B /* ScanReminders.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanReminders.swift; sourceTree = "<group>"; };
71E7F835214E8D4400A11601 /* URL+AcquireAccessFromSandbox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+AcquireAccessFromSandbox.swift"; sourceTree = "<group>"; };
71E7F837214E930500A11601 /* Alerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alerts.swift; sourceTree = "<group>"; };
71E7F839214E9A4300A11601 /* String+MD5.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+MD5.swift"; sourceTree = "<group>"; };
71FD37D6206AD6BE0042812D /* ArchiveFileEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveFileEntry.swift; sourceTree = "<group>"; };
71FD37D8206AD72C0042812D /* DeviceSupportFileEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceSupportFileEntry.swift; sourceTree = "<group>"; };
71FD37DC206AD76D0042812D /* DerivedDataFileEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DerivedDataFileEntry.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -281,7 +279,6 @@
716667CF221A26BA004D4FC4 /* FileManager+HomeFolder.swift */,
71AE37EE23776AFB009C03BB /* FileManager+DateProperties.swift */,
71E7F835214E8D4400A11601 /* URL+AcquireAccessFromSandbox.swift */,
71E7F839214E9A4300A11601 /* String+MD5.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -437,7 +434,6 @@
71B01E8E20824F2A00940041 /* XcodeEntryCellView.swift in Sources */,
715E8C3D216566FD0059A2E5 /* Weak.swift in Sources */,
717A9F1B22DBAF9300682A0A /* OldDocumentationFileEntry.swift in Sources */,
71E7F83A214E9A4300A11601 /* String+MD5.swift in Sources */,
71FD37DD206AD76D0042812D /* DerivedDataFileEntry.swift in Sources */,
71012FA9230C8A9E00FDF8ED /* main.swift in Sources */,
7162E12D209905BC00081E4E /* Preferences.swift in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion DevCleaner/Managers/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public final class Preferences {
public static let appFolder = "DCAppFolder"

fileprivate static func folderBookmarkKey(for url: URL) -> String {
return "DCFolderBookmark_\(url.absoluteString.md5)"
let urlStringData = Data(url.path.utf8)
let sha256hash = SHA256.hash(data: urlStringData)
return "DCFolderBookmark_\(sha256hash.description)"
}
}

Expand Down
44 changes: 0 additions & 44 deletions DevCleaner/Utilities/Extensions/String+MD5.swift

This file was deleted.

0 comments on commit 3f0072a

Please sign in to comment.