Marino Faggiana 7 năm trước cách đây
mục cha
commit
e97701d886

+ 1 - 1
iOSClient/Security/NCEndToEndEncryption.m

@@ -436,7 +436,7 @@ cleanup:
     if (rsa == NULL)
         return nil;
 
-    unsigned char *output = (unsigned char *) malloc([plainData length]);
+    unsigned char *output = (unsigned char *) malloc(1000);
     
     int encrypted_length = RSA_public_encrypt((int)[plainData length], [plainData bytes], output, rsa, RSA_CIPHER);
     if(encrypted_length == -1) {

+ 1 - 4
iOSClient/Security/NCEntoToEndInterface.swift

@@ -160,9 +160,7 @@ class NCEntoToEndInterface : NSObject, OCNetworkingDelegate  {
         let alertController = UIAlertController(title: NSLocalizedString("_e2e_passphrase_request_title_", comment: ""), message: NSLocalizedString("_e2e_passphrase_request_message_", comment: ""), preferredStyle: .alert)
         
         let ok = UIAlertAction(title: "OK", style: .default, handler: { (action) -> Void in
-            
-            DispatchQueue.main.async(execute: {
-                
+                            
             let passphrase = passphraseTextField?.text
             
             guard let privateKey = (NCEndToEndEncryption.sharedManager().decryptPrivateKey(metadataNet.key, passphrase: passphrase)) else {
@@ -212,7 +210,6 @@ class NCEntoToEndInterface : NSObject, OCNetworkingDelegate  {
             self.getPublicKeyServer()
             
             NCManageDatabase.sharedInstance.addActivityClient("", fileID: "", action: k_activityDebugActionEndToEndEncryption, selector: actionGetEndToEndPrivateKeyCipher, note: "E2E PrivateKey present on Server and stored to keychain", type: k_activityTypeSuccess, verbose: false, activeUrl: "")
-            })
         })
         
         let cancel = UIAlertAction(title: "Cancel", style: .cancel) { (action) -> Void in