IOSAD-92 merge in default IOSAD-92
authorDirk Zimmermann <dirk@pep-project.org>
Thu, 26 Apr 2018 14:02:23 +0200
branchIOSAD-92
changeset 6039b4e42283f66
parent 600 303218b831ae
parent 602 9a560dd0fd0c
child 604 1af0cfd35a84
child 641 78f938d89d23
IOSAD-92 merge in default
pEpObjCAdapter/NSError+PEP.m
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapter/PEPSession.m
pEpObjCAdapter/PEPSessionProtocol.h
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.h	Wed Apr 25 09:20:30 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.h	Thu Apr 26 14:02:23 2018 +0200
     1.3 @@ -28,6 +28,6 @@
     1.4  
     1.5   @param enabled Whether or not mail subjects should be encrypted when using this session
     1.6   */
     1.7 -- (void)configUnencryptedSubjectEnabled:(BOOL)enabled;
     1.8 +- (void)configUnEncryptedSubjectEnabled:(BOOL)enabled;
     1.9  
    1.10  @end
     2.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Wed Apr 25 09:20:30 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Thu Apr 26 14:02:23 2018 +0200
     2.3 @@ -53,7 +53,7 @@
     2.4  
     2.5  #pragma mark - CONFIG
     2.6  
     2.7 -- (void)configUnencryptedSubjectEnabled:(BOOL)enabled;
     2.8 +- (void)configUnEncryptedSubjectEnabled:(BOOL)enabled;
     2.9  {
    2.10      config_unencrypted_subject(self.session, enabled);
    2.11  }
     3.1 --- a/pEpObjCAdapter/PEPObjCAdapter+Internal.h	Wed Apr 25 09:20:30 2018 +0200
     3.2 +++ b/pEpObjCAdapter/PEPObjCAdapter+Internal.h	Thu Apr 26 14:02:23 2018 +0200
     3.3 @@ -21,7 +21,7 @@
     3.4  
     3.5   @return Whether or not mail subjects should be encrypted
     3.6   */
     3.7 -+ (BOOL)unecryptedSubjectEnabled;
     3.8 ++ (BOOL)unEncryptedSubjectEnabled;
     3.9  
    3.10  // this messages are for internal use only; do not call
    3.11  
     4.1 --- a/pEpObjCAdapter/PEPObjCAdapter.h	Wed Apr 25 09:20:30 2018 +0200
     4.2 +++ b/pEpObjCAdapter/PEPObjCAdapter.h	Thu Apr 26 14:02:23 2018 +0200
     4.3 @@ -36,7 +36,7 @@
     4.4  
     4.5   @param enabled Whether or not mail subjects should be encrypted
     4.6   */
     4.7 -+ (void)setUnecryptedSubjectEnabled:(BOOL)enabled;
     4.8 ++ (void)setUnEncryptedSubjectEnabled:(BOOL)enabled;
     4.9  
    4.10  /**
    4.11   The HOME URL, where all pEp related files will be stored.
     5.1 --- a/pEpObjCAdapter/PEPObjCAdapter.m	Wed Apr 25 09:20:30 2018 +0200
     5.2 +++ b/pEpObjCAdapter/PEPObjCAdapter.m	Thu Apr 26 14:02:23 2018 +0200
     5.3 @@ -104,20 +104,20 @@
     5.4  const char* _Nullable SystemDB = NULL;
     5.5  NSURL *s_homeURL;
     5.6  static NSLock *s_writeLock;
     5.7 -static BOOL s_unecryptedSubjectEnabled = NO;
     5.8 +static BOOL s_unEncryptedSubjectEnabled = NO;
     5.9  
    5.10  @implementation PEPObjCAdapter
    5.11  
    5.12  #pragma mark - SUBJECT PROTECTION
    5.13  
    5.14 -+ (BOOL)unecryptedSubjectEnabled;
    5.15 ++ (BOOL)unEncryptedSubjectEnabled;
    5.16  {
    5.17 -    return s_unecryptedSubjectEnabled;
    5.18 +    return s_unEncryptedSubjectEnabled;
    5.19  }
    5.20  
    5.21 -+ (void)setUnecryptedSubjectEnabled:(BOOL)enabled;
    5.22 ++ (void)setUnEncryptedSubjectEnabled:(BOOL)enabled;
    5.23  {
    5.24 -    s_unecryptedSubjectEnabled = enabled;
    5.25 +    s_unEncryptedSubjectEnabled = enabled;
    5.26  }
    5.27  
    5.28  #pragma mark - DB PATHS
     6.1 --- a/pEpObjCAdapter/PEPSessionProvider.m	Wed Apr 25 09:20:30 2018 +0200
     6.2 +++ b/pEpObjCAdapter/PEPSessionProvider.m	Thu Apr 26 14:02:23 2018 +0200
     6.3 @@ -44,7 +44,7 @@
     6.4          newOrExistingSession = [PEPInternalSession new];
     6.5          dict[currentThread] = newOrExistingSession;
     6.6      }
     6.7 -    [self setConfigUnencryptedSubjectOnSession:newOrExistingSession];
     6.8 +    [self setConfigUnEncryptedSubjectOnSession:newOrExistingSession];
     6.9      [self nullifySessionsOfFinishedThreads];
    6.10  
    6.11      [[self sessionForThreadLock] unlock];
    6.12 @@ -83,10 +83,10 @@
    6.13  
    6.14  #pragma mark -
    6.15  
    6.16 -+ (void)setConfigUnencryptedSubjectOnSession:(PEPInternalSession *)session
    6.17 ++ (void)setConfigUnEncryptedSubjectOnSession:(PEPInternalSession *)session
    6.18  {
    6.19 -    BOOL unencryptedSubjectEnabled = [PEPObjCAdapter unecryptedSubjectEnabled];
    6.20 -    [session configUnencryptedSubjectEnabled:unencryptedSubjectEnabled];
    6.21 +    BOOL unEncryptedSubjectEnabled = [PEPObjCAdapter unEncryptedSubjectEnabled];
    6.22 +    [session configUnEncryptedSubjectEnabled:unEncryptedSubjectEnabled];
    6.23  }
    6.24  
    6.25  /**
    6.26 @@ -103,7 +103,7 @@
    6.27              return;
    6.28          }
    6.29          s_sessionForMainThread = [PEPInternalSession new];
    6.30 -        [self setConfigUnencryptedSubjectOnSession:s_sessionForMainThread];
    6.31 +        [self setConfigUnEncryptedSubjectOnSession:s_sessionForMainThread];
    6.32      };
    6.33  
    6.34  
     7.1 --- a/pEpObjCTests/PEPSessionTest.m	Wed Apr 25 09:20:30 2018 +0200
     7.2 +++ b/pEpObjCTests/PEPSessionTest.m	Thu Apr 26 14:02:23 2018 +0200
     7.3 @@ -24,7 +24,7 @@
     7.4  - (void)setUp
     7.5  {
     7.6      [super setUp];
     7.7 -    [PEPObjCAdapter setUnecryptedSubjectEnabled:NO];
     7.8 +    [PEPObjCAdapter setUnEncryptedSubjectEnabled:NO];
     7.9  
    7.10      [self pEpCleanUp];
    7.11  }
    7.12 @@ -1184,7 +1184,7 @@
    7.13  - (void)testConfigUnencryptedSubject
    7.14  {
    7.15      // Setup Config to encrypt subject
    7.16 -    [PEPObjCAdapter setUnecryptedSubjectEnabled:NO];
    7.17 +    [PEPObjCAdapter setUnEncryptedSubjectEnabled:NO];
    7.18  
    7.19      // Write mail to yourself ...
    7.20      PEPMessage *encMessage = [self mailWrittenToMySelf];
    7.21 @@ -1193,16 +1193,16 @@
    7.22      XCTAssertEqualObjects(encMessage.shortMessage, @"p≡p", @"Subject should be encrypted");
    7.23  }
    7.24  
    7.25 -- (void)testConfigUnencryptedSubject_encryptedSubjectDisabled
    7.26 +- (void)testConfigUnencryptedSubjectEncryptedSubjectDisabled
    7.27  {
    7.28      // Setup Config to not encrypt subject
    7.29 -    [PEPObjCAdapter setUnecryptedSubjectEnabled:YES];
    7.30 +    [PEPObjCAdapter setUnEncryptedSubjectEnabled:YES];
    7.31  
    7.32      // Write mail to yourself ...
    7.33      PEPMessage *encMessage = [self mailWrittenToMySelf];
    7.34  
    7.35 -    // ... and assert the subject is not encrypted
    7.36 -    XCTAssertNotEqualObjects(encMessage.shortMessage, @"p≡p", @"Subject should not be encrypted");
    7.37 +    // pEp to pEp uses message 2.0, which always encrypts subjects (ENGINE-429)
    7.38 +    XCTAssertEqualObjects(encMessage.shortMessage, @"p≡p", @"Subject should be encrypted");
    7.39  }
    7.40  
    7.41  #pragma mark - Helpers