Marino Faggiana hace 7 años
padre
commit
f6faa17511
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      iOSClient/Security/NCEndToEndEncryption.m

+ 5 - 2
iOSClient/Security/NCEndToEndEncryption.m

@@ -414,7 +414,9 @@ cleanup:
     
     if (result && privateKeyData) {
         
-        NSString *privateKey = [privateKeyData base64EncodedStringWithOptions:0];
+        NSString *privateKey;
+        
+        privateKey = [privateKeyData base64EncodedStringWithOptions:0];
         
         NSData *encryptData = [self encryptAsymmetricString:ASYMMETRIC_STRING_TEST publicKey:publicKey];
         if (!encryptData)
@@ -673,7 +675,8 @@ cleanup:
         return NO;
     
     //Finalise the encryption
-    EVP_DecryptFinal_ex (ctx, NULL, &numberOfBytes);
+    len = numberOfBytes;
+    status = EVP_DecryptFinal_ex (ctx, ctBytes + numberOfBytes, &len);
     
     // Free
     EVP_CIPHER_CTX_free(ctx);