Browse Source

Merge branch 'IPS-91'

master
Dirk Zimmermann 6 months ago
parent
commit
fa35d65c5e
13 changed files with 335 additions and 86 deletions
  1. +2
    -2
      Subprojects/PEPObjCTypes/PEPObjCTypes.xcodeproj/project.pbxproj
  2. +191
    -0
      pEpObjCAdapter.xcodeproj/project.pbxproj
  3. +11
    -1
      pEpObjCAdapter.xcodeproj/xcshareddata/xcschemes/PEPObjCAdapter_4ipsec_macOS.xcscheme
  4. +51
    -3
      pEpObjCAdapter/PEPObjCAdapter.m
  5. +24
    -0
      pEpObjCAdapterTests_4ipsec_macOS.plist
  6. +43
    -68
      pEpObjCTests/PEPInternalSessionTest.m
  7. +2
    -2
      pEpObjCTests/PEPSessionTest.m
  8. +1
    -1
      pEpObjCTests/PEPSizeTest.m
  9. +1
    -1
      pEpObjCTests/TestUtils/PEPIdentity+isPEPUser.h
  10. +4
    -3
      pEpObjCTests/TestUtils/PEPInternalSession+SetIdentity.m
  11. +0
    -2
      pEpObjCTests/TestUtils/PEPPassphraseProviderMock.h
  12. +4
    -2
      pEpObjCTests/TestUtils/PEPTestUtils.m
  13. +1
    -1
      pEpObjCTests/TestUtils/XCTestCase+PEPSession.h

+ 2
- 2
Subprojects/PEPObjCTypes/PEPObjCTypes.xcodeproj/project.pbxproj View File

@ -21,8 +21,8 @@
15BD2F9B27342A2400B1B1F5 /* PEPEqualableTools.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD2F9827342A2400B1B1F5 /* PEPEqualableTools.h */; };
15BD2F9C27342A2400B1B1F5 /* PEPEqualableTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD2F9927342A2400B1B1F5 /* PEPEqualableTools.m */; };
15BD2F9D27342A2400B1B1F5 /* PEPEqualableTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD2F9927342A2400B1B1F5 /* PEPEqualableTools.m */; };
15BD319C2742A1B500B1B1F5 /* PEPErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD319A2742A1B500B1B1F5 /* PEPErrors.h */; };
15BD319D2742A1B500B1B1F5 /* PEPErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD319A2742A1B500B1B1F5 /* PEPErrors.h */; };
15BD319C2742A1B500B1B1F5 /* PEPErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD319A2742A1B500B1B1F5 /* PEPErrors.h */; settings = {ATTRIBUTES = (Public, ); }; };
15BD319D2742A1B500B1B1F5 /* PEPErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD319A2742A1B500B1B1F5 /* PEPErrors.h */; settings = {ATTRIBUTES = (Public, ); }; };
15BD319E2742A1B500B1B1F5 /* PEPErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD319B2742A1B500B1B1F5 /* PEPErrors.m */; };
15BD319F2742A1B500B1B1F5 /* PEPErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD319B2742A1B500B1B1F5 /* PEPErrors.m */; };
43D44C822685BB3600638D1C /* PEPObjCTypes_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E575867268329A20084F02D /* PEPObjCTypes_iOS.h */; platformFilter = ios; settings = {ATTRIBUTES = (Public, ); }; };


+ 191
- 0
pEpObjCAdapter.xcodeproj/project.pbxproj View File

@ -196,6 +196,42 @@
43D2D5F12632B0FA00088BDC /* XCTestCase+PEPSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 43D2D5F02632B0FA00088BDC /* XCTestCase+PEPSession.m */; };
43E02A201C71F65B008F05E9 /* A3FC7F0A_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */; };
43E02A211C71F65B008F05E9 /* A3FC7F0A.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */; };
43F29507273E7BE0009611F8 /* PEPSizeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 4331CE93229C2AAF00DDDC65 /* PEPSizeTest.m */; };
43F29508273E7BE0009611F8 /* PEPInternalSessionTestSendMessageDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4396CEC8218721F900FDD398 /* PEPInternalSessionTestSendMessageDelegate.m */; };
43F29509273E7BE0009611F8 /* PEPSessionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 434707F824C30E9700E05485 /* PEPSessionTest.m */; };
43F2950A273E7BE0009611F8 /* XCTestCase+PEPSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 43D2D5F02632B0FA00088BDC /* XCTestCase+PEPSession.m */; };
43F2950B273E7BE0009611F8 /* PEPInternalSessionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 152A9C462010F50400F962ED /* PEPInternalSessionTest.m */; };
43F2950C273E7BE0009611F8 /* PEPInternalSession+SetIdentity.m in Sources */ = {isa = PBXBuildFile; fileRef = 433A03F92627268700758B57 /* PEPInternalSession+SetIdentity.m */; };
43F2950D273E7BE0009611F8 /* PepTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 434226801D4F60000083ED79 /* PepTests.m */; };
43F2950E273E7BE0009611F8 /* PEPTestUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 15D3D77C2010DDC500A0DA20 /* PEPTestUtils.m */; };
43F2950F273E7BE0009611F8 /* PEPPassphraseCache+Reset.m in Sources */ = {isa = PBXBuildFile; fileRef = 4349CD7824ADDB8800A22A13 /* PEPPassphraseCache+Reset.m */; };
43F29510273E7BE0009611F8 /* PEPIdentity+isPEPUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 43062BAC24EEC83400489258 /* PEPIdentity+isPEPUser.m */; };
43F29511273E7BE0009611F8 /* PEPInternalSessionTestNotifyHandshakeDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4396CEB62187190F00FDD398 /* PEPInternalSessionTestNotifyHandshakeDelegate.m */; };
43F29512273E7BE0009611F8 /* PEPSessionProviderTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 15D3D760200F61BB00A0DA20 /* PEPSessionProviderTest.m */; };
43F29513273E7BE0009611F8 /* PEPPassphraseCacheTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 43589EFA24A4ACFC0079BEA2 /* PEPPassphraseCacheTest.m */; };
43F29514273E7BE0009611F8 /* PEPPassphraseProviderMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 436E917624B71E12000296FF /* PEPPassphraseProviderMock.m */; };
43F2951A273E7BE0009611F8 /* partner2_F9D9CCD0A401311F_pub.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2D11C884C5F00DDF874 /* partner2_F9D9CCD0A401311F_pub.asc */; };
43F2951B273E7BE0009611F8 /* system.db in Resources */ = {isa = PBXBuildFile; fileRef = 15921D87261CB474003346B7 /* system.db */; };
43F2951C273E7BE0009611F8 /* 5CB2C182_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */; };
43F2951D273E7BE0009611F8 /* msg_to_B623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF60B1C58B77900B6782A /* msg_to_B623F674.asc */; };
43F2951E273E7BE0009611F8 /* 0xC9C2EE39.asc in Resources */ = {isa = PBXBuildFile; fileRef = 64415E461BEA523300F6CBB2 /* 0xC9C2EE39.asc */; };
43F2951F273E7BE0009611F8 /* B623F674_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43676B641C57EA1A00233933 /* B623F674_sec.asc */; };
43F29520273E7BE0009611F8 /* A3FC7F0A_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */; };
43F29521273E7BE0009611F8 /* partner1_F2D281C2789DD7F6_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2D01C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_sec.asc */; };
43F29522273E7BE0009611F8 /* C9C2EE39_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 64415E471BEA523300F6CBB2 /* C9C2EE39_sec.asc */; };
43F29523273E7BE0009611F8 /* 0x70DCF575.asc in Resources */ = {isa = PBXBuildFile; fileRef = 64415E441BEA523300F6CBB2 /* 0x70DCF575.asc */; };
43F29524273E7BE0009611F8 /* 70DCF575_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 64415E451BEA523300F6CBB2 /* 70DCF575_sec.asc */; };
43F29525273E7BE0009611F8 /* 5CB2C182.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79221C9B517C00DBEC4E /* 5CB2C182.asc */; };
43F29526273E7BE0009611F8 /* A3FC7F0A.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */; };
43F29527273E7BE0009611F8 /* meATdontcare_E3BFBCA9248FC681_pub.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2D51C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_pub.asc */; };
43F29528273E7BE0009611F8 /* Rick Deckard (43F270EC) – Secret.asc in Resources */ = {isa = PBXBuildFile; fileRef = 436E917124B714A1000296FF /* Rick Deckard (43F270EC) – Secret.asc */; };
43F29529273E7BE0009611F8 /* 0xB623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF6091C58B77900B6782A /* 0xB623F674.asc */; };
43F2952A273E7BE0009611F8 /* 6FF00E97_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 64415E431BEA523300F6CBB2 /* 6FF00E97_sec.asc */; };
43F2952B273E7BE0009611F8 /* meATdontcare_E3BFBCA9248FC681_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2D61C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_sec.asc */; };
43F2952C273E7BE0009611F8 /* 6FF00E97.asc in Resources */ = {isa = PBXBuildFile; fileRef = 64415E421BEA523300F6CBB2 /* 6FF00E97.asc */; };
43F2952D273E7BE0009611F8 /* pEpTrustWords.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 64AE6B211BE15E3A000867E4 /* pEpTrustWords.bundle */; };
43F2952E273E7BE0009611F8 /* partner1_F2D281C2789DD7F6_pub.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2CF1C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_pub.asc */; };
43F2958B273E8A8D009611F8 /* libPEPObjCAdapter_4ipsec_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C3089226E8B5030013F39F /* libPEPObjCAdapter_4ipsec_macOS.a */; };
4E51BFA726CBC685007A2164 /* libPEPToolbox_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E51BFA626CBC685007A2164 /* libPEPToolbox_macOS.a */; };
4E57581226821A760084F02D /* libPEPObjCAdapterProtocols_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E23E6F62681C8AF00B8F4C2 /* libPEPObjCAdapterProtocols_macOS.a */; };
640F79231C9B517C00DBEC4E /* 5CB2C182_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */; };
@ -296,6 +332,13 @@
remoteGlobalIDString = 4E23E7032681D5F300B8F4C2;
remoteInfo = PEPObjCAdapterProtocols_iOS;
};
43F29505273E7BE0009611F8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 64DA243B1B833248000BEE80 /* pEpEngine.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 644297BE1BE11C65002BC73B;
remoteInfo = pEpTrustWords;
};
4E23E6F52681C8AF00B8F4C2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4EEB4CC92680E56A00161040 /* PEPObjCAdapterProtocols.xcodeproj */;
@ -463,6 +506,8 @@
43E02A1C1C71F65B008F05E9 /* A3FC7F0A_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = A3FC7F0A_sec.asc; sourceTree = "<group>"; };
43E02A1D1C71F65B008F05E9 /* A3FC7F0A.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = A3FC7F0A.asc; sourceTree = "<group>"; };
43E1A7AB252B421D00307A7D /* Logger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = "<group>"; };
43F29532273E7BE0009611F8 /* pEpObjCAdapterTests_4ipsec_macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = pEpObjCAdapterTests_4ipsec_macOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
43F29533273E7BE0009611F8 /* pEpObjCAdapterTests_4ipsec_macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = pEpObjCAdapterTests_4ipsec_macOS.plist; path = /Users/dirk/projects/pEp/src_pEp4ipsec/pEpObjCAdapter/pEpObjCAdapterTests_4ipsec_macOS.plist; sourceTree = "<absolute>"; };
43F73BE92166248E00AB4524 /* PEPSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSync.m; sourceTree = "<group>"; };
4E51BF3826CA5E5C007A2164 /* PEPObjCTypes.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PEPObjCTypes.xcodeproj; path = Subprojects/PEPObjCTypes/PEPObjCTypes.xcodeproj; sourceTree = "<group>"; };
4E51BFA626CBC685007A2164 /* libPEPToolbox_macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPToolbox_macOS.a; sourceTree = BUILT_PRODUCTS_DIR; };
@ -512,6 +557,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
43F29515273E7BE0009611F8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
43F2958B273E8A8D009611F8 /* libPEPObjCAdapter_4ipsec_macOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
64415E141BE94FCB00F6CBB2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -644,6 +697,7 @@
64415E181BE94FCB00F6CBB2 /* pEpObjCTests */,
352988AB1AEF964100FA7E2E /* Products */,
43447C51221D448500B6323E /* Frameworks */,
43F29533273E7BE0009611F8 /* pEpObjCAdapterTests_4ipsec_macOS.plist */,
);
sourceTree = "<group>";
};
@ -654,6 +708,7 @@
1552D93B2576602D00A92F71 /* libPEPObjCAdapter_macOS.a */,
1543DC66257943CE0041EFB5 /* libPEPObjCAdapter_iOS.a */,
15C3089226E8B5030013F39F /* libPEPObjCAdapter_4ipsec_macOS.a */,
43F29532273E7BE0009611F8 /* pEpObjCAdapterTests_4ipsec_macOS.xctest */,
);
name = Products;
sourceTree = "<group>";
@ -942,6 +997,24 @@
productReference = 15C3089226E8B5030013F39F /* libPEPObjCAdapter_4ipsec_macOS.a */;
productType = "com.apple.product-type.library.static";
};
43F29503273E7BE0009611F8 /* pEpObjCAdapterTests_4ipsec_macOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 43F2952F273E7BE0009611F8 /* Build configuration list for PBXNativeTarget "pEpObjCAdapterTests_4ipsec_macOS" */;
buildPhases = (
43F29506273E7BE0009611F8 /* Sources */,
43F29515273E7BE0009611F8 /* Frameworks */,
43F29519273E7BE0009611F8 /* Resources */,
);
buildRules = (
);
dependencies = (
43F29504273E7BE0009611F8 /* PBXTargetDependency */,
);
name = pEpObjCAdapterTests_4ipsec_macOS;
productName = iOSTests;
productReference = 43F29532273E7BE0009611F8 /* pEpObjCAdapterTests_4ipsec_macOS.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
64415E161BE94FCB00F6CBB2 /* pEpObjCAdapterTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 64415E281BE94FCB00F6CBB2 /* Build configuration list for PBXNativeTarget "pEpObjCAdapterTests" */;
@ -1022,6 +1095,7 @@
1552D93A2576602D00A92F71 /* PEPObjCAdapter_macOS */,
64415E161BE94FCB00F6CBB2 /* pEpObjCAdapterTests */,
15C3084B26E8B5030013F39F /* PEPObjCAdapter_4ipsec_macOS */,
43F29503273E7BE0009611F8 /* pEpObjCAdapterTests_4ipsec_macOS */,
);
};
/* End PBXProject section */
@ -1100,6 +1174,34 @@
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
43F29519273E7BE0009611F8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
43F2951A273E7BE0009611F8 /* partner2_F9D9CCD0A401311F_pub.asc in Resources */,
43F2951B273E7BE0009611F8 /* system.db in Resources */,
43F2951C273E7BE0009611F8 /* 5CB2C182_sec.asc in Resources */,
43F2951D273E7BE0009611F8 /* msg_to_B623F674.asc in Resources */,
43F2951E273E7BE0009611F8 /* 0xC9C2EE39.asc in Resources */,
43F2951F273E7BE0009611F8 /* B623F674_sec.asc in Resources */,
43F29520273E7BE0009611F8 /* A3FC7F0A_sec.asc in Resources */,
43F29521273E7BE0009611F8 /* partner1_F2D281C2789DD7F6_sec.asc in Resources */,
43F29522273E7BE0009611F8 /* C9C2EE39_sec.asc in Resources */,
43F29523273E7BE0009611F8 /* 0x70DCF575.asc in Resources */,
43F29524273E7BE0009611F8 /* 70DCF575_sec.asc in Resources */,
43F29525273E7BE0009611F8 /* 5CB2C182.asc in Resources */,
43F29526273E7BE0009611F8 /* A3FC7F0A.asc in Resources */,
43F29527273E7BE0009611F8 /* meATdontcare_E3BFBCA9248FC681_pub.asc in Resources */,
43F29528273E7BE0009611F8 /* Rick Deckard (43F270EC) – Secret.asc in Resources */,
43F29529273E7BE0009611F8 /* 0xB623F674.asc in Resources */,
43F2952A273E7BE0009611F8 /* 6FF00E97_sec.asc in Resources */,
43F2952B273E7BE0009611F8 /* meATdontcare_E3BFBCA9248FC681_sec.asc in Resources */,
43F2952C273E7BE0009611F8 /* 6FF00E97.asc in Resources */,
43F2952D273E7BE0009611F8 /* pEpTrustWords.bundle in Resources */,
43F2952E273E7BE0009611F8 /* partner1_F2D281C2789DD7F6_pub.asc in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
64415E151BE94FCB00F6CBB2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@ -1275,6 +1377,27 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
43F29506273E7BE0009611F8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
43F29507273E7BE0009611F8 /* PEPSizeTest.m in Sources */,
43F29508273E7BE0009611F8 /* PEPInternalSessionTestSendMessageDelegate.m in Sources */,
43F29509273E7BE0009611F8 /* PEPSessionTest.m in Sources */,
43F2950A273E7BE0009611F8 /* XCTestCase+PEPSession.m in Sources */,
43F2950B273E7BE0009611F8 /* PEPInternalSessionTest.m in Sources */,
43F2950C273E7BE0009611F8 /* PEPInternalSession+SetIdentity.m in Sources */,
43F2950D273E7BE0009611F8 /* PepTests.m in Sources */,
43F2950E273E7BE0009611F8 /* PEPTestUtils.m in Sources */,
43F2950F273E7BE0009611F8 /* PEPPassphraseCache+Reset.m in Sources */,
43F29510273E7BE0009611F8 /* PEPIdentity+isPEPUser.m in Sources */,
43F29511273E7BE0009611F8 /* PEPInternalSessionTestNotifyHandshakeDelegate.m in Sources */,
43F29512273E7BE0009611F8 /* PEPSessionProviderTest.m in Sources */,
43F29513273E7BE0009611F8 /* PEPPassphraseCacheTest.m in Sources */,
43F29514273E7BE0009611F8 /* PEPPassphraseProviderMock.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
64415E131BE94FCB00F6CBB2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -1339,6 +1462,11 @@
name = PEPObjCAdapterProtocols_iOS;
targetProxy = 430D78E12681E1CF00B12650 /* PBXContainerItemProxy */;
};
43F29504273E7BE0009611F8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = pEpTrustWords;
targetProxy = 43F29505273E7BE0009611F8 /* PBXContainerItemProxy */;
};
4E57580F26821A660084F02D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = PEPObjCAdapterProtocols_macOS;
@ -1597,6 +1725,7 @@
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
@ -1656,6 +1785,7 @@
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC";
@ -1666,6 +1796,58 @@
};
name = Release;
};
43F29530273E7BE0009611F8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = NQLYU6MGPN;
ENABLE_TESTABILITY = YES;
GCC_DYNAMIC_NO_PIC = NO;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = pEpObjCAdapterTests_4ipsec_macOS.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.pep.iOSTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "";
};
name = Debug;
};
43F29531273E7BE0009611F8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = NQLYU6MGPN;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = pEpObjCAdapterTests_4ipsec_macOS.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.pep.iOSTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "";
};
name = Release;
};
64415E1F1BE94FCB00F6CBB2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -1763,6 +1945,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
43F2952F273E7BE0009611F8 /* Build configuration list for PBXNativeTarget "pEpObjCAdapterTests_4ipsec_macOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
43F29530273E7BE0009611F8 /* Debug */,
43F29531273E7BE0009611F8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
64415E281BE94FCB00F6CBB2 /* Build configuration list for PBXNativeTarget "pEpObjCAdapterTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (


+ 11
- 1
pEpObjCAdapter.xcodeproj/xcshareddata/xcschemes/PEPObjCAdapter_4ipsec_macOS.xcscheme View File

@ -3,7 +3,7 @@
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
@ -28,6 +28,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "43F29503273E7BE0009611F8"
BuildableName = "pEpObjCAdapterTests_4ipsec_macOS.xctest"
BlueprintName = "pEpObjCAdapterTests_4ipsec_macOS"
ReferencedContainer = "container:pEpObjCAdapter.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction


+ 51
- 3
pEpObjCAdapter/PEPObjCAdapter.m View File

@ -121,13 +121,18 @@ static id<PEPPassphraseProviderProtocol> s_passphraseProvider = nil;
}
+ (void)setupPerUserDirectory {
// The Engine uses the home env as per-user-directory. We hijack that on iOS.
// The Engine uses the home env as per-user-directory. We hijack that on iOS,
// or when running XCTests on macOS.
#if TARGET_OS_IPHONE
s_homeURL = [self createApplicationDirectory];
// The engine will put its per_user_directory under this directory.
setenv("HOME", [[s_homeURL path] cStringUsingEncoding:NSUTF8StringEncoding], 1);
#else
// For macOS there is nothing toDo. The defaults in Engine platform_unix.h should do.
if ([self isXCTestRunning]) {
s_homeURL = [self createTestDataDirectoryMacOS];
setenv("HOME", [[s_homeURL path] cStringUsingEncoding:NSUTF8StringEncoding], 1);
} else {
// For macOS there is nothing toDo. The defaults in Engine platform_unix.h should do.
}
#endif
}
@ -263,4 +268,47 @@ static id<PEPPassphraseProviderProtocol> s_passphraseProvider = nil;
return [NSString stringWithCString:per_machine_directory() encoding:NSUTF8StringEncoding];
}
#pragma mark - DB PATHS Helpers for macOS
/// Determines whether the adapter is running under a XCTest.
///
/// This is only used under macOS, although it should work on iOS as well.
+ (BOOL)isXCTestRunning
{
BOOL isTesting = NO;
Class testProbeClass = NSClassFromString(@"XCTestProbe");
if (testProbeClass) {
NSNumber *numberValue = [testProbeClass valueForKey:@"isTesting"];
isTesting = [numberValue boolValue];
}
id configFp = [[[NSProcessInfo processInfo] environment]
valueForKey:@"XCTestConfigurationFilePath"];
return isTesting || configFp != nil;
}
/// Creates a pEp directory for use by the engine that is nowhere in a production data area, for use by XCTests.
+ (NSURL *)createTestDataDirectoryMacOS
{
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *appSupportDir = [fm URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask];
NSURL *containerUrl = containerUrl = [appSupportDir lastObject];
if (containerUrl == nil) {
LogErrorAndCrash(@"No app container, no application support directory.");
}
NSURL *dirPath = [containerUrl URLByAppendingPathComponent:s_pEpHomeComponent];
// If the directory does not exist, this method creates it.
NSError *theError = nil;
if (![fm createDirectoryAtURL:dirPath withIntermediateDirectories:YES
attributes:nil error:&theError]) {
LogErrorAndCrash(@"Could not create pEp home directory, directly writing to app container instead.");
}
return dirPath;
}
@end

+ 24
- 0
pEpObjCAdapterTests_4ipsec_macOS.plist View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

+ 43
- 68
pEpObjCTests/PEPInternalSessionTest.m View File

@ -8,7 +8,7 @@
#import <XCTest/XCTest.h>
#import "PEPObjCTypes_iOS.h"
#import "PEPObjCTypes.h"
#import "PEPObjCAdapter_iOS.h"
#import "NSNumber+PEPRating.h"
@ -271,14 +271,12 @@
XCTAssertTrue([session keyResetTrust:alice error:&error]);
XCTAssertNil(error);
XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
XCTAssertTrue([session keyMistrusted:alice error:&error]);
XCTAssertNil(error);
// key_reset_trust makes the key not being elected anymore
XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingHaveNoKey);
}
/** ENGINE-384 */
/// This was once crashing, for historical details, see ENGINE-384.
- (void)testIdentityRatingCrash
{
PEPInternalSession *session = [PEPSessionProvider session];
@ -310,10 +308,8 @@
XCTAssertTrue([session keyResetTrust:alice error:&error]);
XCTAssertNil(error);
XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingReliable);
XCTAssertTrue([session keyMistrusted:alice error:&error]);
XCTAssertNil(error);
// key_reset_trust makes the key not being elected anymore
XCTAssertEqual([self ratingForIdentity:alice session:session], PEPRatingHaveNoKey);
}
@ -408,22 +404,8 @@
numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
XCTAssertNotNil(numRating);
XCTAssertNil(error);
XCTAssertEqual(numRating.pEpRating, PEPRatingReliable);
// mistrust Bob
XCTAssertTrue([session keyMistrusted:identBob error:&error]);
XCTAssertNil(error);
identBob.fingerPrint = nil;
XCTAssertFalse([session updateIdentity:identBob error:&error]);
XCTAssertNotNil(error);
XCTAssertEqual(error.code, PEP_KEY_UNSUITABLE);
XCTAssertNil(identBob.fingerPrint);
// Gray == PEPRatingUnencrypted
numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
XCTAssertNotNil(numRating);
XCTAssertNil(error);
// key_reset_trust makes the key not being elected anymore
XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
}
@ -476,15 +458,15 @@
XCTAssertTrue([session updateIdentity:identBob error:&error]);
XCTAssertNil(error);
// No key election, outgoing messages are unencrypted (after setIdentity)
// setIdentity has already been called by the import, so reliable
numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
XCTAssertNotNil(numRating);
XCTAssertNil(error);
XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
XCTAssertEqual(numRating.pEpRating, PEPRatingReliable);
// No key election, there is no key (after setIdentity)
// Rating is also already reliable, since setIdentity has been called already
rating = [self ratingForIdentity:identBob session:session];
XCTAssertEqual(rating, PEPRatingHaveNoKey);
XCTAssertEqual(rating, PEPRatingReliable);
// Let' say we got that handshake, set PEP_ct_confirmed in Bob's identity
XCTAssertTrue([session trustPersonalKey:identBob error:&error]);
@ -500,23 +482,22 @@
XCTAssertEqual(rating, PEPRatingTrusted);
// Now let see if it turns back yellow if we add an unconfirmed folk.
// pEp Test John (test key, don't use) <pep.test.john@pep-project.org>
// AA2E4BEB93E5FE33DEFD8BE1135CD6D170DCF575
XCTAssertTrue([PEPTestUtils importBundledKey:@"0x70DCF575.asc" session:session]);
PEPIdentity *identJohn = [[PEPIdentity alloc]
initWithAddress:@"pep.test.john@pep-project.org"
userID:@"101" userName:@"pEp Test John"
isOwn:NO
fingerPrint:@"AA2E4BEB93E5FE33DEFD8BE1135CD6D170DCF575"];
XCTAssertTrue([session updateIdentity:identJohn error:&error]);
XCTAssertNil(error);
msg.bcc = @[[[PEPIdentity alloc] initWithAddress:@"pep.test.john@pep-project.org"
userID:@"101" userName:@"pEp Test John" isOwn:NO]];
PEPIdentity *identJohn = [self checkImportingKeyFilePath:@"0x70DCF575.asc"
address:@"pep.test.john@pep-project.org"
userID:@"This Is John"
fingerPrint:@"BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39"
session: session];
XCTAssertNotNil(identJohn);
// check john's rating
rating = [self ratingForIdentity:identJohn session:session];
XCTAssertEqual(rating, PEPRatingReliable);
// Yellow ?
// Adding bcc is still reliable
msg.bcc = @[identJohn];
numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
XCTAssertNotNil(numRating);
XCTAssertNil(error);
@ -557,13 +538,12 @@
// pEp Test Bob (test key, don't use) <pep.test.bob@pep-project.org>
// BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39
XCTAssertTrue([PEPTestUtils importBundledKey:@"0xC9C2EE39.asc" session:session]);
PEPIdentity *identBob = [[PEPIdentity alloc]
initWithAddress:@"pep.test.bob@pep-project.org"
userID:@"42" userName:@"pEp Test Bob"
isOwn:NO
fingerPrint:@"BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39"];
PEPIdentity *identBob = [self checkImportingKeyFilePath:@"0xC9C2EE39.asc"
address:@"pep.test.bob@pep-project.org"
userID:@"This Is Bob"
fingerPrint:@"BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39"
session: session];
XCTAssertNotNil(identBob);
XCTAssertTrue([session updateIdentity:identBob error:&error]);
XCTAssertNil(error);
@ -690,14 +670,12 @@
{
PEPInternalSession *session = [PEPSessionProvider session];
PEPIdentity *partner1Orig = [PEPTestUtils foreignPepIdentityWithAddress:@"partner1@dontcare.me"
userName:@"Partner 1"];
NSString *pubKeyPartner1 = [PEPTestUtils loadResourceByName:@"partner1_F2D281C2789DD7F6_pub.asc"];
XCTAssertNotNil(pubKeyPartner1);
NSError *error = nil;
XCTAssertTrue([session importKey:pubKeyPartner1 error:&error]);
XCTAssertNil(error);
PEPIdentity *partner1Orig = [self checkImportingKeyFilePath:@"partner1_F2D281C2789DD7F6_pub.asc"
address:@"partner1@dontcare.me"
userID:@"partner1"
fingerPrint:@"F0CD3F7B422E5D587ABD885BF2D281C2789DD7F6"
session:session];
XCTAssertNotNil(partner1Orig);
PEPRating color = [self ratingForIdentity:partner1Orig session:session];
XCTAssertEqual(color, PEPRatingReliable);
@ -1309,7 +1287,7 @@
error:&error]);
XCTAssertNotNil(error);
XCTAssertEqualObjects(error.domain, PEPObjCAdapterEngineStatusErrorDomain);
XCTAssertEqualObjects(error.domain, PEPObjCEngineStatusErrorDomain);
XCTAssertEqual(error.code, PEPStatusPassphraseRequired);
}
@ -1338,7 +1316,7 @@
error:&error]);
XCTAssertNotNil(error);
XCTAssertEqualObjects(error.domain, PEPObjCAdapterEngineStatusErrorDomain);
XCTAssertEqualObjects(error.domain, PEPObjCEngineStatusErrorDomain);
XCTAssertEqual(error.code, PEPStatusPassphraseRequired);
}
@ -1368,7 +1346,7 @@
error:&error]);
XCTAssertNotNil(error);
XCTAssertEqualObjects(error.domain, PEPObjCAdapterEngineStatusErrorDomain);
XCTAssertEqualObjects(error.domain, PEPObjCEngineStatusErrorDomain);
XCTAssertEqual(error.code, PEPStatusWrongPassphrase);
}
@ -1406,7 +1384,7 @@
error:&error]);
XCTAssertNotNil(error);
XCTAssertEqualObjects(error.domain, PEPObjCAdapterEngineStatusErrorDomain);
XCTAssertEqualObjects(error.domain, PEPObjCEngineStatusErrorDomain);
XCTAssertEqual(error.code, PEPStatusWrongPassphrase);
XCTAssertTrue(passphraseProviderMock1.passphraseTooLongWasCalled);
}
@ -1803,14 +1781,11 @@
// Partner pubkey for the test:
// pEp Test Alice (test key don't use) <pep.test.alice@pep-project.org>
// 4ABE3AAF59AC32CFE4F86500A9411D176FF00E97
XCTAssertTrue([PEPTestUtils importBundledKey:@"6FF00E97.asc" session:session]);
PEPIdentity *identAlice = [[PEPIdentity alloc]
initWithAddress:@"pep.test.alice@pep-project.org"
userID:ownUserId
userName:@"pEp Test Alice"
isOwn:NO
fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"];
PEPIdentity *identAlice = [self checkImportingKeyFilePath:@"6FF00E97.asc"
address:@"pep.test.alice@pep-project.org"
userID:ownUserId
fingerPrint:@"4ABE3AAF59AC32CFE4F86500A9411D176FF00E97"
session:session];
[self updateAndVerifyPartnerIdentity:identAlice session:session];
PEPIdentity *identMe = [[PEPIdentity alloc]


+ 2
- 2
pEpObjCTests/PEPSessionTest.m View File

@ -8,7 +8,7 @@
#import <XCTest/XCTest.h>
#import "PEPObjCTypes_iOS.h"
#import "PEPObjCTypes.h"
#import "PEPObjCAdapter_iOS.h"
#import "NSNumber+PEPRating.h"
@ -249,7 +249,7 @@
XCTAssertTrue([self keyResetTrust:alice error:&error]);
XCTAssertNil(error);
XCTAssertEqual([self ratingForIdentity:alice], PEPRatingReliable);
XCTAssertEqual([self ratingForIdentity:alice], PEPRatingHaveNoKey);
XCTAssertTrue([self keyMistrusted:alice error:&error]);
XCTAssertNil(error);


+ 1
- 1
pEpObjCTests/PEPSizeTest.m View File

@ -8,7 +8,7 @@
#import <XCTest/XCTest.h>
#import "PEPObjCTypes_iOS.h"
#import "PEPObjCTypes.h"
#import "PEPObjCAdapter_iOS.h"
#import "pEpEngine.h"


+ 1
- 1
pEpObjCTests/TestUtils/PEPIdentity+isPEPUser.h View File

@ -7,7 +7,7 @@
//
#import "PEPObjCAdapter.h"
#import "PEPObjCTypes_iOS.h"
#import "PEPObjCTypes.h"
NS_ASSUME_NONNULL_BEGIN


+ 4
- 3
pEpObjCTests/TestUtils/PEPInternalSession+SetIdentity.m View File

@ -8,11 +8,12 @@
#import "PEPInternalSession+SetIdentity.h"
#import "PEPObjCTypes.h"
#import "PEPObjCTypeUtils.h"
#import "PEPTypes.h"
#import "PEPInternalSession.h"
#import "PEPInternalSession+PassphraseCache.h"
#import "NSError+PEP+Internal.h"
#import "PEPIdentity"
#import "pEpEngine.h"
@ -20,7 +21,7 @@
- (BOOL)setIdentity:(PEPIdentity *)identity error:(NSError * _Nullable * _Nullable)error
{
pEp_identity *ident = [identity toStruct];
pEp_identity *ident = [PEPObjCTypeConversionUtil structFromPEPIdentity:identity];
PEPStatus status = (PEPStatus) [self runWithPasswords:^PEP_STATUS(PEP_SESSION session) {
return set_identity(self.session, ident);


+ 0
- 2
pEpObjCTests/TestUtils/PEPPassphraseProviderMock.h View File

@ -6,8 +6,6 @@
// Copyright © 2020 pp. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PEPPassphraseProviderProtocol.h"
NS_ASSUME_NONNULL_BEGIN


+ 4
- 2
pEpObjCTests/TestUtils/PEPTestUtils.m View File

@ -10,7 +10,7 @@
#import "PEPTestUtils.h"
#import "PEPObjCTypes_iOS.h"
#import "PEPObjCTypes.h"
#import "PEPObjCAdapter_iOS.h"
#import "PEPInternalSession.h"
@ -71,7 +71,9 @@ const NSInteger PEPTestInternalSyncTimeout = 20;
if (!txtFileContents) {
return NO;
} else {
return [session importKey:txtFileContents error:nil];
NSError *error = nil;
NSArray<PEPIdentity *> *identities = [session importKey:txtFileContents error:&error];
return (identities != nil);
}
}


+ 1
- 1
pEpObjCTests/TestUtils/XCTestCase+PEPSession.h View File

@ -9,7 +9,7 @@
#import <Foundation/Foundation.h>
#import <XCTest/XCTest.h>
#import "PEPObjCTypes_iOS.h"
#import "PEPObjCTypes.h"
NS_ASSUME_NONNULL_BEGIN


Loading…
Cancel
Save