Marino Faggiana 1 жил өмнө
parent
commit
1a93aa4c34

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

@@ -66,7 +66,7 @@
 - (void)Encodedkey:(NSString **)key initializationVector:(NSString **)initializationVector;
 - (NSData *)generateKey;
 - (NSString *)createSHA512:(NSString *)string;
-- (NSString *)createSHA256:(NSString *)string;
+- (NSString *)createSHA256FromString:(NSString *)string;
 - (NSString *)createSHA256FromData:(NSData *)data;
 - (NSString *)extractPublicKeyFromCertificate:(NSString *)pemCertificate;
 

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

@@ -1232,7 +1232,7 @@
     *initializationVector = [ivData base64EncodedStringWithOptions:0];
 }
 
-- (NSString *)createSHA256:(NSString *)string
+- (NSString *)createSHA256FromString:(NSString *)string
 {
     const char *cstr = [string cStringUsingEncoding:NSASCIIStringEncoding];
     NSData *data = [NSData dataWithBytes:cstr length:string.length];
@@ -1247,8 +1247,6 @@
 
 - (NSString *)createSHA256FromData:(NSData *)data
 {
-    //const char *cstr = [string cStringUsingEncoding:NSASCIIStringEncoding];
-    //NSData *data = [NSData dataWithBytes:cstr length:string.length];
     uint8_t digest[CC_SHA256_DIGEST_LENGTH];
     CC_SHA256(data.bytes, (unsigned int)data.length, digest);
     NSMutableString* output = [NSMutableString  stringWithCapacity:CC_SHA256_DIGEST_LENGTH * 2];

+ 2 - 2
iOSClient/Networking/E2EE/NCEndToEndMetadataV1.swift

@@ -111,7 +111,7 @@ extension NCEndToEndMetadata {
 
         // Create checksum
         let passphrase = CCUtility.getEndToEndPassphrase(account).replacingOccurrences(of: " ", with: "")
-        let checksum = NCEndToEndEncryption.sharedManager().createSHA256(passphrase + fileNameIdentifiers.sorted().joined() + metadataKey)
+        let checksum = NCEndToEndEncryption.sharedManager().createSHA256(from: passphrase + fileNameIdentifiers.sorted().joined() + metadataKey)
 
         // Create Json
         let metadata = E2eeV12.Metadata(metadataKey: metadataKey, version: metadataVersion, checksum: checksum)
@@ -296,7 +296,7 @@ extension NCEndToEndMetadata {
 
             // verify checksum
             let passphrase = CCUtility.getEndToEndPassphrase(account).replacingOccurrences(of: " ", with: "")
-            let checksum = NCEndToEndEncryption.sharedManager().createSHA256(passphrase + fileNameIdentifiers.sorted().joined() + metadata.metadataKey)
+            let checksum = NCEndToEndEncryption.sharedManager().createSHA256(from: passphrase + fileNameIdentifiers.sorted().joined() + metadata.metadataKey)
             if metadata.checksum != checksum {
                 return NKError(errorCode: NCGlobal.shared.errorE2EE, errorDescription: "Error checksum")
             }

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 11 - 11
iOSClient/Networking/E2EE/NCEndToEndMetadataV20.swift


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

@@ -952,7 +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";
-"_e2ee_signature_error_"    = "The signature result incorrrect, it's impossible the decryption the files";
+"_e2ee_checksums_error_"    = "The checksums result incorrrect, it's impossible the decryption the files";
 
 // Video
 "_select_trace_"            = "Select the trace";

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно