Browse Source

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 1 year ago
parent
commit
a6b461af5b

+ 2 - 0
iOSClient/NCGlobal.swift

@@ -223,6 +223,8 @@ class NCGlobal: NSObject {
     @objc let errorReadFile: Int                    = -99991
     @objc let errorUnauthorizedFilesPasscode: Int   = -99990
     @objc let errorDisableFilesApp: Int             = -99989
+    @objc let errorE2EEKeyChecksums: Int            = -99988
+
 
     // Constants to identify the different permissions of a file
     //

+ 1 - 1
iOSClient/Networking/E2EE/NCEndToEndMetadata.swift

@@ -383,7 +383,7 @@ class NCEndToEndMetadata: NSObject {
                                 if let keyChecksums,
                                    let hash = NCEndToEndEncryption.sharedManager().createSHA256(from: plainUser.decryptedMetadataKey),
                                    !keyChecksums.contains(hash) {
-                                    print("error")
+                                    return NKError(errorCode: NCGlobal.shared.errorE2EEKeyChecksums, errorDescription: NSLocalizedString("_e3ee_keyChecksum_", comment: ""))
                                 }
 
                                 if let files = json["files"] as? [String: Any] {

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -952,6 +952,7 @@
 "_chunk_create_folder_"     = "The file could not be sent, please check the server log";
 "_chunk_files_null_"        = "The file for sending could not be created";
 "_chunk_move_"              = "The sent file could not be reassembled, please check the server log";
+"_e3ee_keyChecksum_"        = "The key Checksum result incorrrect, it's impossible the decryption the files";
 
 // Video
 "_select_trace_"            = "Select the trace";