Browse Source

merge default

IOSAD-12
Dirk Zimmermann 2 years ago
parent
commit
c5aa284900
10 changed files with 70 additions and 28 deletions
  1. +8
    -0
      pEpObjCAdapter.xcodeproj/project.pbxproj
  2. +22
    -0
      pEpObjCAdapter/Extensions/PEPIdentity+Reset.h
  3. +28
    -0
      pEpObjCAdapter/Extensions/PEPIdentity+Reset.m
  4. +0
    -11
      pEpObjCAdapter/PEPIdentity.m
  5. +1
    -0
      pEpObjCAdapter/PEPInternalSession.m
  6. +5
    -1
      pEpObjCAdapter/PEPSync.m
  7. +2
    -0
      pEpObjCAdapterFramework/PEPEngineTypes.h
  8. +0
    -5
      pEpObjCAdapterFramework/PEPIdentity.h
  9. +1
    -5
      pEpObjCAdapterFramework/PEPNotifyHandshakeDelegate.h
  10. +3
    -6
      pEpObjCTests/TestUtils/PEPInternalSessionTestNotifyHandshakeDelegate.m

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

@ -15,6 +15,8 @@
430CD9B12292AC4900AAC37F /* PEPSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 430CD9B02292AC4900AAC37F /* PEPSync.h */; settings = {ATTRIBUTES = (Public, ); }; };
430CD9B62292ADAC00AAC37F /* PEPSendMessageDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 430CD9B52292ADAC00AAC37F /* PEPSendMessageDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
430CD9BB2292AEDD00AAC37F /* PEPNotifyHandshakeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 430CD9BA2292AEDD00AAC37F /* PEPNotifyHandshakeDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
4326A0AE2553F882001E18C6 /* PEPIdentity+Reset.m in Sources */ = {isa = PBXBuildFile; fileRef = 4326A0AC2553F882001E18C6 /* PEPIdentity+Reset.m */; };
4326A0AF2553F882001E18C6 /* PEPIdentity+Reset.h in Headers */ = {isa = PBXBuildFile; fileRef = 4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */; };
432EF60C1C58B77900B6782A /* 0xB623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF6091C58B77900B6782A /* 0xB623F674.asc */; };
432EF60E1C58B77900B6782A /* msg_to_B623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF60B1C58B77900B6782A /* msg_to_B623F674.asc */; };
432FA2D21C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_pub.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2CF1C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_pub.asc */; };
@ -171,6 +173,8 @@
43209B321ECC2ACD007E7E2E /* PEPQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPQueue.m; sourceTree = "<group>"; };
43209B341ECC2ACD007E7E2E /* PEPInternalSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPInternalSession.h; sourceTree = "<group>"; };
43209B351ECC2ACD007E7E2E /* PEPInternalSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPInternalSession.m; sourceTree = "<group>"; };
4326A0AC2553F882001E18C6 /* PEPIdentity+Reset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "PEPIdentity+Reset.m"; sourceTree = "<group>"; };
4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PEPIdentity+Reset.h"; sourceTree = "<group>"; };
432EF6091C58B77900B6782A /* 0xB623F674.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 0xB623F674.asc; sourceTree = "<group>"; };
432EF60A1C58B77900B6782A /* B623F674_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = B623F674_sec.asc; sourceTree = "<group>"; };
432EF60B1C58B77900B6782A /* msg_to_B623F674.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = msg_to_B623F674.asc; sourceTree = "<group>"; };
@ -415,6 +419,8 @@
438C0ECB254020F000337922 /* NSArray+Engine.m */,
438C0F1125402D6400337922 /* PEPIdentity+Engine.h */,
438C0F1225402D6400337922 /* PEPIdentity+Engine.m */,
4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */,
4326A0AC2553F882001E18C6 /* PEPIdentity+Reset.m */,
43ECE9C825407FF3005F1925 /* PEPMessage+Engine.h */,
43ECE9C725407FF2005F1925 /* PEPMessage+Engine.m */,
43DED784203C25E200D45CD6 /* NSError+PEP.h */,
@ -507,6 +513,7 @@
435C0CAC222930340025C6B5 /* PEPConstants.h in Headers */,
4349CD6F24AC73FC00A22A13 /* NSString+NormalizePassphrase.h in Headers */,
434707F624C210CA00E05485 /* PEPSession.h in Headers */,
4326A0AF2553F882001E18C6 /* PEPIdentity+Reset.h in Headers */,
43FF2ED12226AFE9000D9567 /* PEPEngineTypes.h in Headers */,
438C0F1325402D6400337922 /* PEPIdentity+Engine.h in Headers */,
430CD9B12292AC4900AAC37F /* PEPSync.h in Headers */,
@ -691,6 +698,7 @@
435F5178222046C2006EB11F /* PEPAutoPointer.m in Sources */,
435F516C222046C2006EB11F /* PEPObjCAdapter.m in Sources */,
435F5177222046C2006EB11F /* NSError+PEP.m in Sources */,
4326A0AE2553F882001E18C6 /* PEPIdentity+Reset.m in Sources */,
435F516A222046C2006EB11F /* PEPLanguage.m in Sources */,
435F5168222046C2006EB11F /* NSArray+Take.m in Sources */,
435F516E222046C2006EB11F /* PEPInternalSession.m in Sources */,


+ 22
- 0
pEpObjCAdapter/Extensions/PEPIdentity+Reset.h View File

@ -0,0 +1,22 @@
//
// PEPIdentity+Reset.h
// pEpiOSAdapter
//
// Created by Dirk Zimmermann on 05.11.20.
// Copyright © 2020 pp. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PEPIdentity.h"
NS_ASSUME_NONNULL_BEGIN
@interface PEPIdentity (Reset)
/// Puts all properties into a default/nil state.
- (void)reset;
@end
NS_ASSUME_NONNULL_END

+ 28
- 0
pEpObjCAdapter/Extensions/PEPIdentity+Reset.m View File

@ -0,0 +1,28 @@
//
// PEPIdentity+Reset.m
// pEpiOSAdapter
//
// Created by Dirk Zimmermann on 05.11.20.
// Copyright © 2020 pp. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PEPIdentity+Reset.h"
#import "pEpEngine.h"
@implementation PEPIdentity (Reset)
- (void)reset
{
self.commType = PEP_ct_unknown;
self.language = nil;
self.fingerPrint = nil;
self.userID = @"";
self.userName = nil;
self.isOwn = NO;
self.flags = 0;
}
@end

+ 0
- 11
pEpObjCAdapter/PEPIdentity.m View File

@ -104,17 +104,6 @@ static NSArray *s_keys;
return [self isEqualToPEPIdentity:object];
}
- (void)reset
{
self.commType = PEP_ct_unknown;
self.language = nil;
self.fingerPrint = nil;
self.userID = @"";
self.userName = nil;
self.isOwn = NO;
self.flags = 0;
}
// MARK: - NSMutableCopying
- (id)mutableCopyWithZone:(nullable NSZone *)zone


+ 1
- 0
pEpObjCAdapter/PEPInternalSession.m View File

@ -29,6 +29,7 @@
#import "NSArray+Engine.h"
#import "PEPIdentity+Engine.h"
#import "PEPMessage+Engine.h"
#import "PEPIdentity+Reset.h"
#import "key_reset.h"


+ 5
- 1
pEpObjCAdapter/PEPSync.m View File

@ -350,7 +350,11 @@ static __weak PEPSync *s_pEpSync;
}
if (!isFromShutdown) {
// Only inform the delegate if the shutdown came from the engine
[self.notifyHandshakeDelegate engineShutdownKeySync];
[self.notifyHandshakeDelegate
notifyHandshake:NULL
me:nil
partner:nil
signal:PEPSyncHandshakeSignalStop];
}
}


+ 2
- 0
pEpObjCAdapterFramework/PEPEngineTypes.h View File

@ -175,6 +175,8 @@ typedef NS_CLOSED_ENUM(int, PEPSyncHandshakeSignal) {
PEPSyncHandshakeSignalAcceptedDeviceAccepted = 8, // SYNC_NOTIFY_ACCEPTED_DEVICE_ACCEPTED
PEPSyncHandshakeSignalStop = 127, // SYNC_NOTIFY_STOP
PEPSyncHandshakeSignalPassphraseRequired = 128, // SYNC_PASSPHRASE_REQUIRED
PEPSyncHandshakeSignalSole = 254, // SYNC_NOTIFY_SOLE


+ 0
- 5
pEpObjCAdapterFramework/PEPIdentity.h View File

@ -85,9 +85,4 @@
*/
- (nonnull instancetype)initWithIdentity:(PEPIdentity * _Nonnull)identity;
/**
Puts all properties into a default/nil state.
*/
- (void)reset;
@end

+ 1
- 5
pEpObjCAdapterFramework/PEPNotifyHandshakeDelegate.h View File

@ -35,12 +35,8 @@
/// The (delayed) response from the user are communicated to the engine
/// via separate method calls, as noted in the discussion.
- (PEPStatus)notifyHandshake:(void * _Nullable)object
me:(PEPIdentity * _Nonnull)me
me:(PEPIdentity * _Nullable)me
partner:(PEPIdentity * _Nullable)partner
signal:(PEPSyncHandshakeSignal)signal;
/// Sent when the sync loop was shut down by the engine,
/// e.g. in response to leving the device group
- (void)engineShutdownKeySync;
@end

+ 3
- 6
pEpObjCTests/TestUtils/PEPInternalSessionTestNotifyHandshakeDelegate.m View File

@ -11,20 +11,17 @@
@implementation PEPInternalSessionTestNotifyHandshakeDelegate
- (PEPStatus)notifyHandshake:(void * _Nullable)object
me:(PEPIdentity * _Nonnull)me
me:(PEPIdentity * _Nullable)me
partner:(PEPIdentity * _Nullable)partner
signal:(PEPSyncHandshakeSignal)signal
{
if (partner == nil && signal == PEPSyncHandshakeSignalPassphraseRequired) {
self.notifyHandshakePassphraseRequired = YES;
} else if (signal == PEPSyncHandshakeSignalStop) {
self.engineDidShutdownKeySync = YES;
}
return PEPStatusOK;
}
- (void)engineShutdownKeySync
{
self.engineDidShutdownKeySync = YES;
}
@end

Loading…
Cancel
Save