diff --git a/pEpObjCAdapter.xcodeproj/project.pbxproj b/pEpObjCAdapter.xcodeproj/project.pbxproj index 8460650..b4edc82 100644 --- a/pEpObjCAdapter.xcodeproj/project.pbxproj +++ b/pEpObjCAdapter.xcodeproj/project.pbxproj @@ -83,8 +83,6 @@ 43BCEFF7222FBA2400148303 /* NSDictionary+CommType.h in Headers */ = {isa = PBXBuildFile; fileRef = 43D27DE41F5DA78700795687 /* NSDictionary+CommType.h */; settings = {ATTRIBUTES = (Public, ); }; }; 43E02A201C71F65B008F05E9 /* A3FC7F0A_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */; }; 43E02A211C71F65B008F05E9 /* A3FC7F0A.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */; }; - 43E02A221C71F65B008F05E9 /* account_A3FC7F0A.ser in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1E1C71F65B008F05E9 /* account_A3FC7F0A.ser */; }; - 43E02A231C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1F1C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser */; }; 43E1A7A7252B41B300307A7D /* pEpIOSToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43E1A7A6252B41B300307A7D /* pEpIOSToolbox.framework */; }; 43E3985F221D7E56008E7983 /* PEPObjCAdapterFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 43E3985D221D7E56008E7983 /* PEPObjCAdapterFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 43E39867221D7EB1008E7983 /* libpEpEngine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64289E561B8B70E800FC617B /* libpEpEngine.a */; }; @@ -244,8 +242,6 @@ 43DED785203C25E200D45CD6 /* NSError+PEP.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSError+PEP.m"; sourceTree = ""; }; 43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = A3FC7F0A_sec.asc; sourceTree = ""; }; 43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = A3FC7F0A.asc; sourceTree = ""; }; - 43E02A1E1C71F65B008F05E9 /* account_A3FC7F0A.ser */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = account_A3FC7F0A.ser; sourceTree = ""; }; - 43E02A1F1C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = msg_to_A3FC7F0A_from_mutt.ser; sourceTree = ""; }; 43E1A7A6252B41B300307A7D /* pEpIOSToolbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = pEpIOSToolbox.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43E1A7AB252B421D00307A7D /* Logger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = ""; }; 43E3985B221D7E56008E7983 /* PEPObjCAdapterFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PEPObjCAdapterFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -324,8 +320,6 @@ 432FA2D11C884C5F00DDF874 /* partner2_F9D9CCD0A401311F_pub.asc */, 43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */, 43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */, - 43E02A1E1C71F65B008F05E9 /* account_A3FC7F0A.ser */, - 43E02A1F1C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser */, 43676B631C57EA1A00233933 /* 0xB623F674.asc */, 43676B641C57EA1A00233933 /* B623F674_sec.asc */, 432EF60B1C58B77900B6782A /* msg_to_B623F674.asc */, @@ -644,7 +638,6 @@ 43E02A201C71F65B008F05E9 /* A3FC7F0A_sec.asc in Resources */, 432FA2D31C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_sec.asc in Resources */, 64415E4D1BEA523300F6CBB2 /* C9C2EE39_sec.asc in Resources */, - 43E02A221C71F65B008F05E9 /* account_A3FC7F0A.ser in Resources */, 64415E4A1BEA523300F6CBB2 /* 0x70DCF575.asc in Resources */, 64415E4B1BEA523300F6CBB2 /* 70DCF575_sec.asc in Resources */, 640F79241C9B517C00DBEC4E /* 5CB2C182.asc in Resources */, @@ -652,7 +645,6 @@ 432FA2D71C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_pub.asc in Resources */, 436E917224B714A2000296FF /* Rick Deckard (43F270EC) – Secret.asc in Resources */, 432EF60C1C58B77900B6782A /* 0xB623F674.asc in Resources */, - 43E02A231C71F65B008F05E9 /* msg_to_A3FC7F0A_from_mutt.ser in Resources */, 64415E491BEA523300F6CBB2 /* 6FF00E97_sec.asc in Resources */, 432FA2D81C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_sec.asc in Resources */, 64415E481BEA523300F6CBB2 /* 6FF00E97.asc in Resources */, diff --git a/pEpObjCTests/PEPInternalSessionTest.m b/pEpObjCTests/PEPInternalSessionTest.m index 38ceddd..fbab37d 100644 --- a/pEpObjCTests/PEPInternalSessionTest.m +++ b/pEpObjCTests/PEPInternalSessionTest.m @@ -678,68 +678,6 @@ XCTAssertEqual(rating, PEPRatingTrustedAndAnonymized); } -- (void)testEncryptedMailFromMuttWithReencryption -{ - PEPInternalSession *session = [PEPSessionProvider session]; - - // This is the public key for test001@peptest.ch - XCTAssertTrue([PEPTestUtils importBundledKey:@"A3FC7F0A.asc" session:session]); - - // This is the secret key for test001@peptest.ch - XCTAssertTrue([PEPTestUtils importBundledKey:@"A3FC7F0A_sec.asc" session:session]); - - // Mail from mutt, already processed into message dict by the app. - NSMutableDictionary *msgDict = [[PEPTestUtils - unarchiveDictionary:@"msg_to_A3FC7F0A_from_mutt.ser"] - mutableCopy]; - [PEPTestUtils migrateUnarchivedMessageDictionary:msgDict]; - [msgDict removeObjectForKey:kPepLongMessage]; - [msgDict removeObjectForKey:kPepLongMessageFormatted]; - - // Also extracted "live" from the app. - NSMutableDictionary *accountDict = [[PEPTestUtils - unarchiveDictionary:@"account_A3FC7F0A.ser"] - mutableCopy]; - [accountDict removeObjectForKey:kPepCommType]; - [accountDict removeObjectForKey:kPepFingerprint]; - PEPIdentity *identMe = [[PEPIdentity alloc] initWithDictionary:accountDict]; - - NSError *error = nil; - XCTAssertTrue([session mySelf:identMe error:&error]); - XCTAssertNil(error); - - XCTAssertNotNil(identMe.fingerPrint); - - NSArray* keys; - PEPMessage *msg = [PEPMessage new]; - [msg setValuesForKeysWithDictionary:msgDict]; - PEPMessage *msgOriginal = [PEPMessage new]; - [msgOriginal setValuesForKeysWithDictionary:msgDict]; - - XCTAssertEqualObjects(msg, msgOriginal); - - PEPRating rating = PEPRatingUndefined; - PEPDecryptFlags flags = PEPDecryptFlagsUntrustedServer; - - PEPMessage *pepDecryptedMail = [session - decryptMessage:msg - flags:&flags - rating:&rating - extraKeys:&keys - status:nil - error:&error]; - XCTAssertNotNil(pepDecryptedMail); - XCTAssertNil(error); - - // Technically, the mail is encrypted, but the signatures don't match - XCTAssertEqual(rating, PEPRatingUnreliable); - - // Since we're requesting re-encryption, src should have been changed - XCTAssertNotEqualObjects(msg, msgOriginal); - - XCTAssertNotNil(pepDecryptedMail.longMessage); -} - - (void)testOutgoingContactColor { PEPInternalSession *session = [PEPSessionProvider session]; diff --git a/pEpObjCTests/Recources/account_A3FC7F0A.ser b/pEpObjCTests/Recources/account_A3FC7F0A.ser deleted file mode 100644 index afc8968..0000000 Binary files a/pEpObjCTests/Recources/account_A3FC7F0A.ser and /dev/null differ diff --git a/pEpObjCTests/Recources/msg_to_A3FC7F0A_from_mutt.ser b/pEpObjCTests/Recources/msg_to_A3FC7F0A_from_mutt.ser deleted file mode 100644 index 9242ca5..0000000 Binary files a/pEpObjCTests/Recources/msg_to_A3FC7F0A_from_mutt.ser and /dev/null differ diff --git a/pEpObjCTests/TestUtils/PEPTestUtils.h b/pEpObjCTests/TestUtils/PEPTestUtils.h index 156aa76..4ba0df6 100644 --- a/pEpObjCTests/TestUtils/PEPTestUtils.h +++ b/pEpObjCTests/TestUtils/PEPTestUtils.h @@ -34,8 +34,6 @@ extern const NSInteger PEPTestInternalSyncTimeout; + (NSString *)loadStringFromFileName:(NSString *)fileName; -+ (NSDictionary *)unarchiveDictionary:(NSString *)fileName; - + (void)migrateUnarchivedMessageDictionary:(NSMutableDictionary *)message; + (PEPMessage * _Nonnull) mailFrom:(PEPIdentity * _Nullable) fromIdent diff --git a/pEpObjCTests/TestUtils/PEPTestUtils.m b/pEpObjCTests/TestUtils/PEPTestUtils.m index 6d37ef8..cbead25 100644 --- a/pEpObjCTests/TestUtils/PEPTestUtils.m +++ b/pEpObjCTests/TestUtils/PEPTestUtils.m @@ -59,18 +59,6 @@ const NSInteger PEPTestInternalSyncTimeout = 20; return txtFileContents; } -+ (NSDictionary *)unarchiveDictionary:(NSString *)fileName -{ - NSString *filePath = [[[NSBundle bundleForClass:[self class]] - resourcePath] stringByAppendingPathComponent:fileName]; - NSMutableData *data = [NSMutableData dataWithContentsOfFile:filePath]; - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data - error:nil]; - NSDictionary *dict = [unarchiver decodeObject]; - [unarchiver finishDecoding]; - return dict; -} - /** Converts a given message dict to a version with correct attachments, using PEPAttachment. Using unarchiveDirectory for a message object will yield the old attachment format,