Prechádzať zdrojové kódy

change name EndToEndPrivateKey - EndToEndPrivateKeyChiper

Marino Faggiana 7 rokov pred
rodič
commit
0b4c9d1fca

+ 2 - 2
iOSClient/CCGlobal.h

@@ -200,9 +200,9 @@ extern NSString *const dav;
 #define actionUpdateShare                               @"updateShare"
 
 #define actionGetEndToEndPublicKeys                     @"getEndToEndPublicKeys"
-#define actionGetEndToEndPrivateKey                     @"getEndToEndPrivateKey"
+#define actionGetEndToEndPrivateKeyCipher               @"getEndToEndPrivateKeyCipher"
 #define actionSignEndToEndPublicKey                     @"signEndToEndPublicKey"
-#define actionStoreEndToEndPrivateKey                   @"storeEndToEndPrivateKey"
+#define actionStoreEndToEndPrivateKeyCipher             @"storeEndToEndPrivateKeyCipher"
 #define actionDeleteEndToEndPublicKey                   @"deleteEndToEndPublicKey"
 #define actionDeleteEndToEndPrivateKey                  @"deleteEndToEndPrivateKey"
 #define actionGetEndToEndServerPublicKey                @"getEndToEndServerPublicKey"

+ 2 - 2
iOSClient/Library/OCCommunicationLib/OCCommunication.h

@@ -904,14 +904,14 @@ typedef enum {
 
 - (void)getEndToEndPublicKeys:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *publicKey, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
-- (void)getEndToEndPrivateKey:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *privateKey, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
+- (void)getEndToEndPrivateKeyCipher:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *privateKey, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
 - (void)getEndToEndServerPublicKey:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *publicKey, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
 
 - (void)signEndToEndPublicKey:(NSString*)serverPath publicKey:(NSString *)publicKey onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
-- (void)storeEndToEndPrivateKey:(NSString*)serverPath privateKey:(NSString *)privateKey onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
+- (void)storeEndToEndPrivateKeyCipher:(NSString*)serverPath privateKeyChiper:(NSString *)privateKeyChiper onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
 
 - (void)deleteEndToEndPublicKey:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;

+ 4 - 4
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -2012,7 +2012,7 @@
     }];
 }
 
-- (void)getEndToEndPrivateKey:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *privateKey, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
+- (void)getEndToEndPrivateKeyCipher:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *privateKey, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
     
     serverPath = [serverPath stringByAppendingString:k_url_client_side_encryption];
     serverPath = [serverPath stringByAppendingString:@"/private-key"];
@@ -2021,7 +2021,7 @@
     OCWebDAVClient *request = [OCWebDAVClient new];
     request = [self getRequestWithCredentials:request];
     
-    [request getEndToEndPrivateKey:serverPath onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
+    [request getEndToEndPrivateKeyCipher:serverPath onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
         
         NSData *responseData = (NSData*) responseObject;
         NSString *privateKey;
@@ -2145,7 +2145,7 @@
     }];
 }
 
-- (void)storeEndToEndPrivateKey:(NSString*)serverPath privateKey:(NSString *)privateKey onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer))successRequest  failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
+- (void)storeEndToEndPrivateKeyCipher:(NSString*)serverPath privateKeyChiper:(NSString *)privateKeyChiper onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer))successRequest  failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
     
     serverPath = [serverPath stringByAppendingString:k_url_client_side_encryption];
     serverPath = [serverPath stringByAppendingString:@"/private-key"];
@@ -2154,7 +2154,7 @@
     OCWebDAVClient *request = [[OCWebDAVClient alloc] init];
     request = [self getRequestWithCredentials:request];
     
-    [request storeEndToEndPrivateKey:serverPath privateKey:privateKey onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
+    [request storeEndToEndPrivateKeyCipher:serverPath privateKeyChiper:privateKeyChiper onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
         
         //Return success
         successRequest(response, request.redirectedServer);

+ 2 - 2
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.h

@@ -602,14 +602,14 @@ extern NSString * _Nullable OCWebDAVModificationDateKey;
 
 - (void)getEndToEndPublicKeys:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
 
-- (void)getEndToEndPrivateKey:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
+- (void)getEndToEndPrivateKeyCipher:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
 
 - (void)getEndToEndServerPublicKey:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
 
 
 - (void)signEndToEndPublicKey:(NSString * _Nonnull)serverPath publicKey:(NSString * _Nonnull)publicKey onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
 
-- (void)storeEndToEndPrivateKey:(NSString * _Nonnull)serverPath privateKey:(NSString * _Nonnull)privateKey onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
+- (void)storeEndToEndPrivateKeyCipher:(NSString * _Nonnull)serverPath privateKeyChiper:(NSString * _Nonnull)privateKeyChiper onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
 
 
 - (void)deleteEndToEndPublicKey:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;

+ 4 - 4
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -864,7 +864,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
 }
 
 // curl -X GET http://<user>:<password>@nextcloud/ocs/v2.php/apps/end_to_end_encryption/api/v1/private-key -H "OCS-APIRequest:true"
-- (void)getEndToEndPrivateKey:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
+- (void)getEndToEndPrivateKeyCipher:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
                       failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure{
     
     _requestMethod = @"GET";
@@ -918,15 +918,15 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
 }
 
 // curl -X POST http://<user>:<password>@nextcloud/ocs/v2.php/apps/end_to_end_encryption/api/v1/private-key -d privateKey="<urlencoded-private-key>" -H "OCS-APIRequest:true"
-- (void)storeEndToEndPrivateKey:(NSString*)serverPath privateKey:(NSString *)privateKey onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
+- (void)storeEndToEndPrivateKeyCipher:(NSString*)serverPath privateKeyChiper:(NSString *)privateKeyChiper onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
                        failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure{
     
     NSParameterAssert(success);
     
     _requestMethod = @"POST";
     
-    privateKey = [NSString stringWithFormat:@"?privateKey=%@",privateKey];
-    serverPath = [serverPath stringByAppendingString:privateKey];
+    privateKeyChiper = [NSString stringWithFormat:@"?privateKey=%@",privateKeyChiper];
+    serverPath = [serverPath stringByAppendingString:privateKeyChiper];
     
     NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
     

+ 13 - 25
iOSClient/Main/CCMain.m

@@ -1245,8 +1245,8 @@
     metadataNet.action = actionGetEndToEndPublicKeys;
     [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
-    //metadataNet.action = actionGetEndToEndPrivateKey;
-    //[app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
+    metadataNet.action = actionGetEndToEndPrivateKeyCipher;
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
     metadataNet.action = actionGetEndToEndServerPublicKey;
     [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
@@ -1258,10 +1258,6 @@
 {
     // Activity
     [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionEndToEndEncryption selector:metadataNet.selector note:@"EndToEndPublicKeys present on Server" type:k_activityTypeSuccess verbose:k_activityVerboseHigh activeUrl:app.activeUrl];
-    
-#ifdef DEBUG
-    [app messageNotification:@"Get E2E PublicKeys" description:@"Success" visible:YES delay:1 type:TWMessageBarMessageTypeSuccess errorCode:0];
-#endif
 }
 
 - (void)getEndToEndPublicKeysFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
@@ -1346,20 +1342,16 @@
 
 // ++++++++++++++++++++++ PRIVATE KEY ++++++++++++++++++++++
 
-- (void)getEndToEndPrivateKeySuccess:(CCMetadataNet *)metadataNet
+- (void)getEndToEndPrivateKeyCipherSuccess:(CCMetadataNet *)metadataNet
 {
-    // Remove PrivateKey
+    // Remove PrivateKey to Disk
     [[NCEndToEndEncryption sharedManager] removePrivateKeyToDisk:app.directoryUser];
     
     // Activity
     [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionEndToEndEncryption selector:metadataNet.selector note:@"EndToEndPrivateKey present on Server" type:k_activityTypeSuccess verbose:k_activityVerboseHigh activeUrl:app.activeUrl];
-    
-#ifdef DEBUG
-    [app messageNotification:@"Get E2E PrivateKey" description:@"Success" visible:YES delay:1 type:TWMessageBarMessageTypeSuccess errorCode:0];
-#endif
 }
 
-- (void)getEndToEndPrivateKeyFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
+- (void)getEndToEndPrivateKeyCipherFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 {
     switch (errorCode) {
         case 400:
@@ -1368,19 +1360,19 @@
             break;
         case 404: {
             // remove keychain
-            [CCUtility setEndToEndPrivateKey:app.activeAccount privateKey:nil];
+            [CCUtility setEndToEndPrivateKeyCipher:app.activeAccount privateKeyCipher:nil];
             
             CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
             
             NSString *mnemonic = [[NYMnemonic generateMnemonicString:@128 language:@"english"] stringByReplacingOccurrencesOfString:@" " withString:@""];
             mnemonic = @"moreovertelevisionfactorytendencyindependenceinternationalintellectualimpressinterestvolunteer";
             
-            NSString *privateKeyEncoded = [[NCEndToEndEncryption sharedManager] createEndToEndPrivateKey:app.activeUserID directoryUser:app.directoryUser mnemonic:mnemonic];
+            NSString *privateKeyCipher = [[NCEndToEndEncryption sharedManager] createEndToEndPrivateKey:app.activeUserID directoryUser:app.directoryUser mnemonic:mnemonic];
             
-            if (privateKeyEncoded) {
+            if (privateKeyCipher) {
                 
-                metadataNet.action = actionStoreEndToEndPrivateKey;
-                metadataNet.options = privateKeyEncoded;
+                metadataNet.action = actionStoreEndToEndPrivateKeyCipher;
+                metadataNet.options = privateKeyCipher;
                 metadataNet.password = mnemonic;
                 
                 [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
@@ -1406,13 +1398,13 @@
     [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionEndToEndEncryption selector:metadataNet.selector note:message type:k_activityTypeFailure verbose:k_activityVerboseHigh activeUrl:app.activeUrl];
 }
 
-- (void)storeEndToEndPrivateKeySuccess:(CCMetadataNet *)metadataNet
+- (void)storeEndToEndPrivateKeyCipherSuccess:(CCMetadataNet *)metadataNet
 {
     // Remove PrivateKey
     [[NCEndToEndEncryption sharedManager] removePrivateKeyToDisk:app.directoryUser];
     
     // Store privatekey locally keychain
-    [CCUtility setEndToEndPrivateKey:app.activeAccount privateKey:metadataNet.options];
+    [CCUtility setEndToEndPrivateKeyCipher:app.activeAccount privateKeyCipher:metadataNet.options];
     // Strore mnemonic locally keychain
     [CCUtility setEndToEndMnemonic:app.activeAccount mnemonic:metadataNet.password];
     
@@ -1424,7 +1416,7 @@
 #endif
 }
 
-- (void)storeEndToEndPrivateKeyFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
+- (void)storeEndToEndPrivateKeyCipherFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 {
     [app messageNotification:@"E2E sign private key" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
     
@@ -1451,10 +1443,6 @@
 {
     // Activity
     [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionEndToEndEncryption selector:metadataNet.selector note:@"EndToEndServerPublicKey present on Server" type:k_activityTypeSuccess verbose:k_activityVerboseHigh activeUrl:app.activeUrl];
-    
-#ifdef DEBUG
-    [app messageNotification:@"Get E2E Server PublicKey" description:@"Success" visible:YES delay:1 type:TWMessageBarMessageTypeSuccess errorCode:0];
-#endif
 }
 
 - (void)getEndToEndServerPublicKeyFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode

+ 4 - 4
iOSClient/Networking/OCNetworking.h

@@ -132,10 +132,10 @@
 - (void)deleteEndToEndPublicKeySuccess:(CCMetadataNet *)metadataNet;
 - (void)deleteEndToEndPublicKeyFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
 
-- (void)getEndToEndPrivateKeySuccess:(CCMetadataNet *)metadataNet;
-- (void)getEndToEndPrivateKeyFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
-- (void)storeEndToEndPrivateKeySuccess:(CCMetadataNet *)metadataNet;
-- (void)storeEndToEndPrivateKeyFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
+- (void)getEndToEndPrivateKeyCipherSuccess:(CCMetadataNet *)metadataNet;
+- (void)getEndToEndPrivateKeyCipherFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
+- (void)storeEndToEndPrivateKeyCipherSuccess:(CCMetadataNet *)metadataNet;
+- (void)storeEndToEndPrivateKeyCipherFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
 - (void)deleteEndToEndPrivateKeySuccess:(CCMetadataNet *)metadataNet;
 - (void)deleteEndToEndPrivateKeyFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
 

+ 13 - 13
iOSClient/Networking/OCNetworking.m

@@ -1705,20 +1705,20 @@
     }];
 }
 
-- (void)getEndToEndPrivateKey
+- (void)getEndToEndPrivateKeyCipher
 {
     OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
     
     [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
     [communication setUserAgent:[CCUtility getUserAgent]];
     
-    [communication getEndToEndPrivateKey:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *privateKey, NSString *redirectedServer) {
+    [communication getEndToEndPrivateKeyCipher:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *privateKey, NSString *redirectedServer) {
         
         // 200 ok: body contain the private key
         _metadataNet.options = privateKey;
         
-        if ([self.delegate respondsToSelector:@selector(getEndToEndPrivateKeySuccess:)])
-            [self.delegate getEndToEndPrivateKeySuccess:_metadataNet];
+        if ([self.delegate respondsToSelector:@selector(getEndToEndPrivateKeyCipherSuccess:)])
+            [self.delegate getEndToEndPrivateKeyCipherSuccess:_metadataNet];
         
         [self complete];
         
@@ -1729,8 +1729,8 @@
             errorCode = error.code;
         
         // Error
-        if ([self.delegate respondsToSelector:@selector(getEndToEndPrivateKeyFailure:message:errorCode:)])
-            [self.delegate getEndToEndPrivateKeyFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
+        if ([self.delegate respondsToSelector:@selector(getEndToEndPrivateKeyCipherFailure:message:errorCode:)])
+            [self.delegate getEndToEndPrivateKeyCipherFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
         
         // Request trusted certificated
         if ([error code] == NSURLErrorServerCertificateUntrusted)
@@ -1777,22 +1777,22 @@
     }];
 }
 
-- (void)storeEndToEndPrivateKey
+- (void)storeEndToEndPrivateKeyCipher
 {
     OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
     
     // URL Encode
-    NSString *privateKey = [CCUtility URLEncodeStringFromString:_metadataNet.options];
+    NSString *privateKeyChiper = [CCUtility URLEncodeStringFromString:_metadataNet.options];
     
     [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
     [communication setUserAgent:[CCUtility getUserAgent]];
     
-    [communication storeEndToEndPrivateKey:[_activeUrl stringByAppendingString:@"/"] privateKey:privateKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
+    [communication storeEndToEndPrivateKeyCipher:[_activeUrl stringByAppendingString:@"/"] privateKeyChiper:privateKeyChiper onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
         
         // 200 ok: body contain the public key
         
-        if ([self.delegate respondsToSelector:@selector(storeEndToEndPrivateKeySuccess:)])
-            [self.delegate storeEndToEndPrivateKeySuccess:_metadataNet];
+        if ([self.delegate respondsToSelector:@selector(storeEndToEndPrivateKeyCipherSuccess:)])
+            [self.delegate storeEndToEndPrivateKeyCipherSuccess:_metadataNet];
         
         [self complete];
         
@@ -1803,8 +1803,8 @@
             errorCode = error.code;
         
         // Error
-        if ([self.delegate respondsToSelector:@selector(storeEndToEndPrivateKeyFailure:message:errorCode:)])
-            [self.delegate storeEndToEndPrivateKeyFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
+        if ([self.delegate respondsToSelector:@selector(storeEndToEndPrivateKeyCipherFailure:message:errorCode:)])
+            [self.delegate storeEndToEndPrivateKeyCipherFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
         
         // Request trusted certificated
         if ([error code] == NSURLErrorServerCertificateUntrusted)

+ 2 - 2
iOSClient/Utility/CCUtility.h

@@ -92,7 +92,7 @@
 + (void)setShowHiddenFiles:(BOOL)show;
 
 + (void)setEndToEndPublicKey:(NSString *)account publicKey:(NSString *)publicKey;
-+ (void)setEndToEndPrivateKey:(NSString *)account privateKey:(NSString *)privateKey;
++ (void)setEndToEndPrivateKeyCipher:(NSString *)account privateKeyCipher:(NSString *)privateKeyCipher;
 + (void)setEndToEndMnemonic:(NSString *)account mnemonic:(NSString *)mnemonic;
 + (void)setEndToEndServerPublicKey:(NSString *)account publicKey:(NSString *)publicKey;
 + (void)initEndToEnd:(NSString *)account;
@@ -143,7 +143,7 @@
 + (BOOL)getShowHiddenFiles;
 
 + (NSString *)getEndToEndPublicKey:(NSString *)account;
-+ (NSString *)getEndToEndPrivateKey:(NSString *)account;
++ (NSString *)getEndToEndPrivateKeyCipher:(NSString *)account;
 + (NSString *)getEndToEndMnemonic:(NSString *)account;
 + (NSString *)getEndToEndServerPublicKey:(NSString *)account;
 + (BOOL)isEndToEndEnabled:(NSString *)account;

+ 7 - 7
iOSClient/Utility/CCUtility.m

@@ -230,10 +230,10 @@
     [UICKeyChainStore setString:publicKey forKey:key service:k_serviceShareKeyChain];
 }
 
-+ (void)setEndToEndPrivateKey:(NSString *)account privateKey:(NSString *)privateKey
++ (void)setEndToEndPrivateKeyCipher:(NSString *)account privateKeyCipher:(NSString *)privateKeyCipher
 {
-    NSString *key = [@"EndToEndPrivateKey_" stringByAppendingString:account];
-    [UICKeyChainStore setString:privateKey forKey:key service:k_serviceShareKeyChain];
+    NSString *key = [@"EndToEndPrivateKeyCipher_" stringByAppendingString:account];
+    [UICKeyChainStore setString:privateKeyCipher forKey:key service:k_serviceShareKeyChain];
 }
 
 + (void)setEndToEndMnemonic:(NSString *)account mnemonic:(NSString *)mnemonic
@@ -251,7 +251,7 @@
 + (void)initEndToEnd:(NSString *)account
 {
     [self setEndToEndPublicKey:account publicKey:nil];
-    [self setEndToEndPrivateKey:account privateKey:nil];
+    [self setEndToEndPrivateKeyCipher:account privateKeyCipher:nil];
     [self setEndToEndMnemonic:account mnemonic:nil];
     [self setEndToEndServerPublicKey:account publicKey:nil];
 }
@@ -458,9 +458,9 @@
     return [UICKeyChainStore stringForKey:key service:k_serviceShareKeyChain];
 }
 
-+ (NSString *)getEndToEndPrivateKey:(NSString *)account
++ (NSString *)getEndToEndPrivateKeyCipher:(NSString *)account
 {
-    NSString *key = [@"EndToEndPrivateKey_" stringByAppendingString:account];
+    NSString *key = [@"EndToEndPrivateKeyCipher_" stringByAppendingString:account];
     return [UICKeyChainStore stringForKey:key service:k_serviceShareKeyChain];
 }
 
@@ -479,7 +479,7 @@
 + (BOOL)isEndToEndEnabled:(NSString *)account
 {
     NSString *mnemonic = [self getEndToEndMnemonic:account];
-    NSString *privateKey = [self getEndToEndPrivateKey:account];
+    NSString *privateKey = [self getEndToEndPrivateKeyCipher:account];
     
     if (mnemonic.length > 0 && privateKey.length > 0)
         return YES;