瀏覽代碼

Update NCEndToEndMetadataV20.swift

Marino Faggiana 1 年之前
父節點
當前提交
92ab9099b0
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      iOSClient/Networking/E2EE/NCEndToEndMetadataV20.swift

+ 6 - 0
iOSClient/Networking/E2EE/NCEndToEndMetadataV20.swift

@@ -98,13 +98,19 @@ extension NCEndToEndMetadata {
 
         do {
             let json = try JSONEncoder().encode(ciphertext)
+
             let dataCiphertext = try json.gzipped()
+
             let base64Ciphertext = dataCiphertext.base64EncodedString()
+
             let ciphertext = NCEndToEndEncryption.sharedManager().encryptPayloadFile(base64Ciphertext, key: encryptedMetadataKey, initializationVector: &initializationVector, authenticationTag: &authenticationTag)
+
             guard let ciphertext, let initializationVector = initializationVector as? String, let authenticationTag = authenticationTag as? String else {
                 return (nil, nil)
             }
+
             let metadataCodable = E2eeV20.Metadata(ciphertext: ciphertext, nonce: initializationVector, authenticationTag: authenticationTag)
+
             let e2eeCodable = E2eeV20(metadata: metadataCodable, users: usersCodable, filedrop: filedropCodable, version: "2.0")
             let e2eeData = try JSONEncoder().encode(e2eeCodable)
             e2eeData.printJson()