Marino Faggiana 1 rok pred
rodič
commit
6888afcb55

+ 1 - 1
iOSClient/Networking/E2EE/NCEndToEndEncryption.m

@@ -524,7 +524,7 @@
 
     BOOL result = [self decryptData:cipher plain:&plain key:keyData keyLen:AES_KEY_128_LENGTH initializationVector:initializationVectorData authenticationTag:authenticationTagData];
 
-    if (plain != nil && result) {
+    if (plain != nil && result && plain.length > 0) {
         return plain;
     }
 

+ 4 - 2
iOSClient/Networking/E2EE/NCEndToEndMetadata.swift

@@ -419,11 +419,13 @@ class NCEndToEndMetadata: NSObject {
                                 }
                             }
                         } catch let error {
-                            print("Serious internal error in decoding metadata (" + error.localizedDescription + ")")
+                            return NKError(error: error)
                         }
                     } else {
-                        print("Serious internal error in decoding metadata")
+                        return NKError(errorCode: NCGlobal.shared.errorE2EE, errorDescription: "Error unzip ciphertext")
                     }
+                } else {
+                    return NKError(errorCode: NCGlobal.shared.errorE2EE, errorDescription: "Error decrypt ciphertext")
                 }
             }