Browse Source

IPS-85 PEP_STATUS<->NSError convertion to PEPObjCTypeUtils

IPS-85
Andreas Buff 3 weeks ago
parent
commit
e0cb4b2696
20 changed files with 181 additions and 193 deletions
  1. +0
    -2
      Subprojects/PEPObjCAdapterProtocols/PEPObjCAdapterProtocols/PEPSessionProtocol.m
  2. +0
    -3
      Subprojects/PEPObjCAdapterProtocols/PEPObjCAdapterProtocols/PublicHeaders/PEPSessionProtocol.h
  3. +12
    -0
      Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils.xcodeproj/project.pbxproj
  4. +0
    -12
      Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PEPObjCTypeConversionUtil.m
  5. +47
    -45
      Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PEPStatusNSErrorUtil.m
  6. +0
    -8
      Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PublicHeaders/PEPObjCTypeConversionUtil.h
  7. +1
    -0
      Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PublicHeaders/PEPObjCTypeUtils.h
  8. +35
    -0
      Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PublicHeaders/PEPStatusNSErrorUtil.h
  9. +13
    -1
      Subprojects/PEPObjCTypes/PEPObjCTypes.xcodeproj/project.pbxproj
  10. +18
    -0
      Subprojects/PEPObjCTypes/PEPObjCTypes/PublicHeaders/PEPErrors.h
  11. +1
    -0
      Subprojects/PEPObjCTypes/PEPObjCTypes/PublicHeaders/PEPObjCTypes.h
  12. +14
    -0
      Subprojects/PEPObjCTypes/PEPObjCTypes/src/PEPErrors.m
  13. +0
    -24
      pEpObjCAdapter.xcodeproj/project.pbxproj
  14. +0
    -31
      pEpObjCAdapter/Extensions/NSError+PEP+Internal.h
  15. +0
    -24
      pEpObjCAdapter/Extensions/NSError+PEP.h
  16. +35
    -36
      pEpObjCAdapter/PEPInternalSession.m
  17. +0
    -1
      pEpObjCAdapter/PEPObjCAdapter.m
  18. +3
    -3
      pEpObjCAdapter/PEPSession.m
  19. +1
    -2
      pEpObjCAdapter/PEPSync.m
  20. +1
    -1
      pEpObjCTests/TestUtils/PEPInternalSession+SetIdentity.m

+ 0
- 2
Subprojects/PEPObjCAdapterProtocols/PEPObjCAdapterProtocols/PEPSessionProtocol.m View File

@ -8,6 +8,4 @@
#import <Foundation/Foundation.h>
NSString * _Nonnull const PEPObjCAdapterEngineStatusErrorDomain = @"PEPObjCAdapterEngineStatusErrorDomain";
NSString * _Nonnull const PEPObjCAdapterErrorDomain = @"PEPObjCAdapterErrorDomain";

+ 0
- 3
Subprojects/PEPObjCAdapterProtocols/PEPObjCAdapterProtocols/PublicHeaders/PEPSessionProtocol.h View File

@ -17,9 +17,6 @@
NS_ASSUME_NONNULL_BEGIN
/// Domain for errors indicated by the pEp engine.
extern NSString *const _Nonnull PEPObjCAdapterEngineStatusErrorDomain;
/// Domain for errors indicated by the pEp adapter itself.
extern NSString *const _Nonnull PEPObjCAdapterErrorDomain;


+ 12
- 0
Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils.xcodeproj/project.pbxproj View File

@ -14,6 +14,10 @@
15BD2FB42734487F00B1B1F5 /* PEPObjCTypeConversionUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD2FB12734487F00B1B1F5 /* PEPObjCTypeConversionUtil.h */; settings = {ATTRIBUTES = (Public, ); }; };
15BD2FB52734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD2FB22734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m */; };
15BD2FB62734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD2FB22734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m */; };
15BD31722742820400B1B1F5 /* PEPStatusNSErrorUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD31702742820400B1B1F5 /* PEPStatusNSErrorUtil.h */; };
15BD31732742820400B1B1F5 /* PEPStatusNSErrorUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BD31702742820400B1B1F5 /* PEPStatusNSErrorUtil.h */; };
15BD31742742820400B1B1F5 /* PEPStatusNSErrorUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD31712742820400B1B1F5 /* PEPStatusNSErrorUtil.m */; };
15BD31752742820400B1B1F5 /* PEPStatusNSErrorUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 15BD31712742820400B1B1F5 /* PEPStatusNSErrorUtil.m */; };
4E89010726CF900B00A683E9 /* libPEPObjCTypes_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E51C1F926CD12EE007A2164 /* libPEPObjCTypes_macOS.a */; };
/* End PBXBuildFile section */
@ -110,6 +114,8 @@
159805FA26CFC0C500593C9D /* PEPObjCTypes.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PEPObjCTypes.xcodeproj; path = ../PEPObjCTypes/PEPObjCTypes.xcodeproj; sourceTree = "<group>"; };
15BD2FB12734487F00B1B1F5 /* PEPObjCTypeConversionUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPObjCTypeConversionUtil.h; sourceTree = "<group>"; };
15BD2FB22734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPObjCTypeConversionUtil.m; sourceTree = "<group>"; };
15BD31702742820400B1B1F5 /* PEPStatusNSErrorUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPStatusNSErrorUtil.h; sourceTree = "<group>"; };
15BD31712742820400B1B1F5 /* PEPStatusNSErrorUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPStatusNSErrorUtil.m; sourceTree = "<group>"; };
4E51C1F926CD12EE007A2164 /* libPEPObjCTypes_macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPObjCTypes_macOS.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@ -158,6 +164,7 @@
children = (
1585EA9526984DB800B822E1 /* PublicHeaders */,
15BD2FB22734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m */,
15BD31712742820400B1B1F5 /* PEPStatusNSErrorUtil.m */,
);
path = PEPObjCTypeUtils;
sourceTree = "<group>";
@ -167,6 +174,7 @@
children = (
1585EBC12698A8FC00B822E1 /* PEPObjCTypeUtils.h */,
15BD2FB12734487F00B1B1F5 /* PEPObjCTypeConversionUtil.h */,
15BD31702742820400B1B1F5 /* PEPStatusNSErrorUtil.h */,
);
path = PublicHeaders;
sourceTree = "<group>";
@ -206,6 +214,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
15BD31722742820400B1B1F5 /* PEPStatusNSErrorUtil.h in Headers */,
15BD2FB32734487F00B1B1F5 /* PEPObjCTypeConversionUtil.h in Headers */,
1585EBC32698A8FC00B822E1 /* PEPObjCTypeUtils.h in Headers */,
);
@ -215,6 +224,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
15BD31732742820400B1B1F5 /* PEPStatusNSErrorUtil.h in Headers */,
15BD2FB42734487F00B1B1F5 /* PEPObjCTypeConversionUtil.h in Headers */,
1585EC79269C3E1700B822E1 /* PEPObjCTypeUtils.h in Headers */,
);
@ -400,6 +410,7 @@
buildActionMask = 2147483647;
files = (
15BD2FB52734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m in Sources */,
15BD31742742820400B1B1F5 /* PEPStatusNSErrorUtil.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -408,6 +419,7 @@
buildActionMask = 2147483647;
files = (
15BD2FB62734487F00B1B1F5 /* PEPObjCTypeConversionUtil.m in Sources */,
15BD31752742820400B1B1F5 /* PEPStatusNSErrorUtil.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};


+ 0
- 12
Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PEPObjCTypeConversionUtil.m View File

@ -455,16 +455,4 @@
return _bl;
}
// MARK: - NSString From PEP_STATUS
/// Could in theory return a fully localized version of the underlying error.
NSString * _Nonnull localizedErrorStringFromPEPStatus(PEP_STATUS status) {
return stringFromPEPStatus(status);
}
NSString * _Nonnull stringFromPEPStatus(PEP_STATUS status) {
const char *pstrStatus = pEp_status_to_string(status);
return [NSString stringWithUTF8String:pstrStatus];
}
@end

pEpObjCAdapter/Extensions/NSError+PEP.m → Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PEPStatusNSErrorUtil.m View File


+ 0
- 8
Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PublicHeaders/PEPObjCTypeConversionUtil.h View File

@ -73,14 +73,6 @@ NS_ASSUME_NONNULL_BEGIN
+ (bloblist_t * _Nullable)arrayToBloblist:(NSArray<PEPAttachment*> *)array;
//!!!: this maybe privare after moving NSError<->PEP_STATUS from adapter to here
// MARK: - NSString From PEP_STATUS
/// Could in theory return a fully localized version of the underlying error.
NSString * _Nonnull localizedErrorStringFromPEPStatus(PEP_STATUS status);
NSString * _Nonnull stringFromPEPStatus(PEP_STATUS status);
@end
NS_ASSUME_NONNULL_END

+ 1
- 0
Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PublicHeaders/PEPObjCTypeUtils.h View File

@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>
#import "PEPObjCTypeConversionUtil.h"
#import "PEPStatusNSErrorUtil.h"
// Umbrella Header
@interface PEPObjCTypeUtils : NSObject


+ 35
- 0
Subprojects/PEPObjCTypeUtils/PEPObjCTypeUtils/PublicHeaders/PEPStatusNSErrorUtil.h View File

@ -0,0 +1,35 @@
//
// NSErrorPEPStatusUtil.h
// PEPObjCTypeUtils
//
// Created by Andreas Buff on 15.11.21.
//
#import <Foundation/Foundation.h>
#import <PEPEngineTypes.h>
NS_ASSUME_NONNULL_BEGIN
@interface PEPStatusNSErrorUtil : NSObject
+ (NSError * _Nullable)errorWithPEPStatus:(PEPStatus)status;
//??
/**
If the given status indicates an error, tries to set the given error accordingly.
@return YES if the given status indicates an error condition, NO otherwise.
*/
+ (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatus:(PEPStatus)status;
//!!!: this maybe privare after moving NSError<->PEP_STATUS from adapter to here
//// MARK: - NSString From PEP_STATUS
//
///// Could in theory return a fully localized version of the underlying error.
//NSString * _Nonnull localizedErrorStringFromPEPStatus(PEP_STATUS status);
//
//NSString * _Nonnull stringFromPEPStatus(PEP_STATUS status);
@end
NS_ASSUME_NONNULL_END

+ 13
- 1
Subprojects/PEPObjCTypes/PEPObjCTypes.xcodeproj/project.pbxproj View File

@ -21,6 +21,10 @@
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 */; };
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, ); }; };
43D44C842685BEB400638D1C /* module.modulemap in CopyFiles */ = {isa = PBXBuildFile; fileRef = 43D44C832685BE4300638D1C /* module.modulemap */; platformFilter = ios; };
4E57585B268329170084F02D /* PEPObjCTypes_macOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E57585A268329170084F02D /* PEPObjCTypes_macOS.h */; };
@ -99,6 +103,8 @@
1598067926CFE9CF00593C9D /* PEPTransportConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPTransportConfig.m; sourceTree = "<group>"; };
15BD2F9827342A2400B1B1F5 /* PEPEqualableTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPEqualableTools.h; sourceTree = "<group>"; };
15BD2F9927342A2400B1B1F5 /* PEPEqualableTools.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPEqualableTools.m; sourceTree = "<group>"; };
15BD319A2742A1B500B1B1F5 /* PEPErrors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPErrors.h; sourceTree = "<group>"; };
15BD319B2742A1B500B1B1F5 /* PEPErrors.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPErrors.m; sourceTree = "<group>"; };
43D44C832685BE4300638D1C /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
4E575841268328CD0084F02D /* PEPObjCTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPObjCTypes.h; sourceTree = "<group>"; };
4E575858268329170084F02D /* libPEPObjCTypes_macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPEPObjCTypes_macOS.a; sourceTree = BUILT_PRODUCTS_DIR; };
@ -224,6 +230,7 @@
4E57587526832F2F0084F02D /* PEPIdentity.m */,
4E57587B26832F2F0084F02D /* PEPLanguage.m */,
4E57587D26832F2F0084F02D /* PEPMessage.m */,
15BD319B2742A1B500B1B1F5 /* PEPErrors.m */,
15BD2F9E27342A3500B1B1F5 /* PEPEqualableTools */,
);
path = src;
@ -232,15 +239,16 @@
4E57587E26832F2F0084F02D /* PublicHeaders */ = {
isa = PBXGroup;
children = (
4E575841268328CD0084F02D /* PEPObjCTypes.h */,
1598067226CFE9B100593C9D /* PEPTransport.h */,
1598067326CFE9B100593C9D /* PEPTransportConfig.h */,
4E575841268328CD0084F02D /* PEPObjCTypes.h */,
4E57587F26832F2F0084F02D /* PEPEngineTypes.h */,
4E57588126832F2F0084F02D /* PEPTypes.h */,
4E57588226832F2F0084F02D /* PEPLanguage.h */,
4E57588326832F2F0084F02D /* PEPMessage.h */,
4E57588426832F2F0084F02D /* PEPAttachment.h */,
4E57588626832F2F0084F02D /* PEPIdentity.h */,
15BD319A2742A1B500B1B1F5 /* PEPErrors.h */,
);
path = PublicHeaders;
sourceTree = "<group>";
@ -285,6 +293,7 @@
1598067626CFE9B100593C9D /* PEPTransportConfig.h in Headers */,
4E57589F26832F2F0084F02D /* PEPLanguage.h in Headers */,
4E5758A026832F2F0084F02D /* PEPMessage.h in Headers */,
15BD319C2742A1B500B1B1F5 /* PEPErrors.h in Headers */,
1598061B26CFC5D900593C9D /* PEPObjCTypes.h in Headers */,
1598067426CFE9B100593C9D /* PEPTransport.h in Headers */,
4E5758A126832F2F0084F02D /* PEPAttachment.h in Headers */,
@ -303,6 +312,7 @@
1598067726CFE9B100593C9D /* PEPTransportConfig.h in Headers */,
4E5758AC2683331C0084F02D /* PEPIdentity.h in Headers */,
1598061A26CFC5D800593C9D /* PEPObjCTypes.h in Headers */,
15BD319D2742A1B500B1B1F5 /* PEPErrors.h in Headers */,
1598067526CFE9B100593C9D /* PEPTransport.h in Headers */,
4E5758AE2683331C0084F02D /* PEPTypes.h in Headers */,
4E5758B02683331C0084F02D /* PEPLanguage.h in Headers */,
@ -466,6 +476,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
15BD319E2742A1B500B1B1F5 /* PEPErrors.m in Sources */,
4E57589626832F2F0084F02D /* PEPLanguage.m in Sources */,
4E57589026832F2F0084F02D /* PEPAttachment.m in Sources */,
4E57588B26832F2F0084F02D /* PEPIdentity.m in Sources */,
@ -481,6 +492,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
15BD319F2742A1B500B1B1F5 /* PEPErrors.m in Sources */,
4E57589726832F2F0084F02D /* PEPLanguage.m in Sources */,
4E57589126832F2F0084F02D /* PEPAttachment.m in Sources */,
4E57588C26832F2F0084F02D /* PEPIdentity.m in Sources */,


+ 18
- 0
Subprojects/PEPObjCTypes/PEPObjCTypes/PublicHeaders/PEPErrors.h View File

@ -0,0 +1,18 @@
//
// PEPErrors.h
// PEPObjCTypes
//
// Created by Andreas Buff on 15.11.21.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// Domain for errors indicated by the pEp engine.
extern NSString *const _Nonnull PEPObjCEngineStatusErrorDomain;
@interface PEPErrors : NSObject
@end
NS_ASSUME_NONNULL_END

+ 1
- 0
Subprojects/PEPObjCTypes/PEPObjCTypes/PublicHeaders/PEPObjCTypes.h View File

@ -13,6 +13,7 @@
#import "PEPMessage.h"
#import "PEPAttachment.h"
#import "PEPIdentity.h"
#import "PEPErrors.h"
@interface PEPObjCTypes : NSObject


+ 14
- 0
Subprojects/PEPObjCTypes/PEPObjCTypes/src/PEPErrors.m View File

@ -0,0 +1,14 @@
//
// PEPErrors.m
// PEPObjCTypes
//
// Created by Andreas Buff on 15.11.21.
//
#import "PEPErrors.h"
NSString * _Nonnull const PEPObjCEngineStatusErrorDomain = @"PEPObjCEngineStatusErrorDomain";
@implementation PEPErrors
@end

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

@ -64,7 +64,6 @@
1552D964257660C900A92F71 /* PEPQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B311ECC2ACD007E7E2E /* PEPQueue.h */; };
1552D965257660C900A92F71 /* NSArray+Take.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B271ECC2ACD007E7E2E /* NSArray+Take.m */; };
1552D968257660C900A92F71 /* PEPInternalSession+PassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 433DFBB524A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h */; };
1552D969257660C900A92F71 /* NSError+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DED785203C25E200D45CD6 /* NSError+PEP.m */; };
1552D96B257660C900A92F71 /* PEPPassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 43589EF524A4A3B70079BEA2 /* PEPPassphraseCache.h */; };
1552D96C257660C900A92F71 /* PEPSync.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F73BE92166248E00AB4524 /* PEPSync.m */; };
1552D96D257660C900A92F71 /* PEPQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B321ECC2ACD007E7E2E /* PEPQueue.m */; };
@ -94,8 +93,6 @@
1552D986257660C900A92F71 /* PEPPassphraseUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 436C9A3224DC48B600007A3D /* PEPPassphraseUtil.m */; };
1552D988257660C900A92F71 /* NSArray+Take.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B261ECC2ACD007E7E2E /* NSArray+Take.h */; };
1552D989257660C900A92F71 /* PEPObjCAdapter+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B2E1ECC2ACD007E7E2E /* PEPObjCAdapter+Internal.h */; };
1552D98A257660C900A92F71 /* NSError+PEP.h in Headers */ = {isa = PBXBuildFile; fileRef = 43DED784203C25E200D45CD6 /* NSError+PEP.h */; };
1552D98B257660C900A92F71 /* NSError+PEP+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */; };
1552D98C257660C900A92F71 /* PEPSync_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 430CD9BF2292B1EA00AAC37F /* PEPSync_Internal.h */; };
1552D98D257660C900A92F71 /* PEPPassphraseCacheEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBAB24A5E04000AB373B /* PEPPassphraseCacheEntry.m */; };
1552D98F257660C900A92F71 /* PEPAutoPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 434ED6D4207E27B8000A7590 /* PEPAutoPointer.h */; };
@ -107,7 +104,6 @@
159C009925BB13F700F13E2B /* NSArray+Take.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B271ECC2ACD007E7E2E /* NSArray+Take.m */; };
159C00A525BB140F00F13E2B /* NSNumber+PEPRating.m in Sources */ = {isa = PBXBuildFile; fileRef = 435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */; };
159C00A725BB140F00F13E2B /* PEPIdentity+Reset.m in Sources */ = {isa = PBXBuildFile; fileRef = 4326A0AC2553F882001E18C6 /* PEPIdentity+Reset.m */; };
159C00A825BB140F00F13E2B /* NSError+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DED785203C25E200D45CD6 /* NSError+PEP.m */; };
159C00A925BB140F00F13E2B /* NSString+NormalizePassphrase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4349CD6E24AC73FC00A22A13 /* NSString+NormalizePassphrase.m */; };
159C00AA25BB140F00F13E2B /* (null) in Sources */ = {isa = PBXBuildFile; };
159C00AB25BB140F00F13E2B /* PEPInternalSession+PassphraseCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBB624A61D4B00AB373B /* PEPInternalSession+PassphraseCache.m */; };
@ -116,14 +112,11 @@
15A922F825BF2D8000D33EAB /* PEPInternalSession+PassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 433DFBB524A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h */; };
15A922F925BF2D8000D33EAB /* PEPIdentity+Reset.h in Headers */ = {isa = PBXBuildFile; fileRef = 4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */; };
15A922FA25BF2D8000D33EAB /* NSString+NormalizePassphrase.h in Headers */ = {isa = PBXBuildFile; fileRef = 4349CD6D24AC73FC00A22A13 /* NSString+NormalizePassphrase.h */; };
15A922FB25BF2D8000D33EAB /* NSError+PEP.h in Headers */ = {isa = PBXBuildFile; fileRef = 43DED784203C25E200D45CD6 /* NSError+PEP.h */; };
15A922FC25BF2D8000D33EAB /* NSError+PEP+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */; };
15A922FD25BF2D8000D33EAB /* NSNumber+PEPRating+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FE2227EBB200E62E5A /* NSNumber+PEPRating+Internal.h */; };
15A9230425BF2D9600D33EAB /* (null) in Headers */ = {isa = PBXBuildFile; };
15A9230525BF2D9700D33EAB /* (null) in Headers */ = {isa = PBXBuildFile; };
15C3085326E8B5030013F39F /* PEPInternalSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B341ECC2ACD007E7E2E /* PEPInternalSession.h */; };
15C3085426E8B5030013F39F /* Logger.h in Headers */ = {isa = PBXBuildFile; fileRef = 43E1A7AB252B421D00307A7D /* Logger.h */; };
15C3085526E8B5030013F39F /* NSError+PEP.h in Headers */ = {isa = PBXBuildFile; fileRef = 43DED784203C25E200D45CD6 /* NSError+PEP.h */; };
15C3085626E8B5030013F39F /* PEPObjCAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B2F1ECC2ACD007E7E2E /* PEPObjCAdapter.h */; settings = {ATTRIBUTES = (Public, ); }; };
15C3085726E8B5030013F39F /* PEPSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 434707F424C210CA00E05485 /* PEPSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
15C3085826E8B5030013F39F /* PEPSync_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 430CD9BF2292B1EA00AAC37F /* PEPSync_Internal.h */; };
@ -133,7 +126,6 @@
15C3085C26E8B5030013F39F /* PEPPassphraseProviderProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 436E916D24B65805000296FF /* PEPPassphraseProviderProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
15C3085D26E8B5030013F39F /* NSArray+Take.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B261ECC2ACD007E7E2E /* NSArray+Take.h */; };
15C3085E26E8B5030013F39F /* PEPSessionProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 15206CA81F8BA183003FF880 /* PEPSessionProvider.h */; };
15C3085F26E8B5030013F39F /* NSError+PEP+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */; };
15C3086026E8B5030013F39F /* PEPCSVScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B281ECC2ACD007E7E2E /* PEPCSVScanner.h */; };
15C3086126E8B5030013F39F /* PEPNotifyHandshakeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 430CD9BA2292AEDD00AAC37F /* PEPNotifyHandshakeDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
15C3086226E8B5030013F39F /* PEPIdentity+Reset.h in Headers */ = {isa = PBXBuildFile; fileRef = 4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */; };
@ -169,7 +161,6 @@
15C3088126E8B5030013F39F /* PEPAutoPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = 434ED6D5207E27B8000A7590 /* PEPAutoPointer.m */; };
15C3088226E8B5030013F39F /* PEPSync.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F73BE92166248E00AB4524 /* PEPSync.m */; };
15C3088326E8B5030013F39F /* PEPPassphraseUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 436C9A3224DC48B600007A3D /* PEPPassphraseUtil.m */; };
15C3088426E8B5030013F39F /* NSError+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DED785203C25E200D45CD6 /* NSError+PEP.m */; };
15C3088526E8B5030013F39F /* PEPObjCAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B301ECC2ACD007E7E2E /* PEPObjCAdapter.m */; };
15C3088626E8B5030013F39F /* PEPQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B321ECC2ACD007E7E2E /* PEPQueue.m */; };
15C3088726E8B5030013F39F /* (null) in Sources */ = {isa = PBXBuildFile; };
@ -452,7 +443,6 @@
43589EFA24A4ACFC0079BEA2 /* PEPPassphraseCacheTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPPassphraseCacheTest.m; sourceTree = "<group>"; };
435C0CAA222930340025C6B5 /* PEPConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPConstants.h; sourceTree = "<group>"; };
435C0CAB222930340025C6B5 /* PEPConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPConstants.m; sourceTree = "<group>"; };
4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSError+PEP+Internal.h"; sourceTree = "<group>"; };
4360A9FE2227EBB200E62E5A /* NSNumber+PEPRating+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSNumber+PEPRating+Internal.h"; sourceTree = "<group>"; };
43676B631C57EA1A00233933 /* 0xB623F674.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 0xB623F674.asc; sourceTree = "<group>"; };
43676B641C57EA1A00233933 /* B623F674_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = B623F674_sec.asc; sourceTree = "<group>"; };
@ -470,8 +460,6 @@
43AD0E2F22E99ECE00D46F56 /* PEPInternalConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPInternalConstants.m; sourceTree = "<group>"; };
43D2D5EE2632B0FA00088BDC /* XCTestCase+PEPSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "XCTestCase+PEPSession.h"; sourceTree = "<group>"; };
43D2D5F02632B0FA00088BDC /* XCTestCase+PEPSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "XCTestCase+PEPSession.m"; sourceTree = "<group>"; };
43DED784203C25E200D45CD6 /* NSError+PEP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSError+PEP.h"; sourceTree = "<group>"; };
43DED785203C25E200D45CD6 /* NSError+PEP.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSError+PEP.m"; sourceTree = "<group>"; };
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>"; };
@ -722,9 +710,6 @@
43209B271ECC2ACD007E7E2E /* NSArray+Take.m */,
4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */,
4326A0AC2553F882001E18C6 /* PEPIdentity+Reset.m */,
43DED784203C25E200D45CD6 /* NSError+PEP.h */,
4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */,
43DED785203C25E200D45CD6 /* NSError+PEP.m */,
4360A9FE2227EBB200E62E5A /* NSNumber+PEPRating+Internal.h */,
435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */,
4349CD6D24AC73FC00A22A13 /* NSString+NormalizePassphrase.h */,
@ -811,8 +796,6 @@
1543DD7F257A3BCF0041EFB5 /* PEPQueue.h in Headers */,
1543DD77257A3BCF0041EFB5 /* PEPCopyableThread.h in Headers */,
15A922F825BF2D8000D33EAB /* PEPInternalSession+PassphraseCache.h in Headers */,
15A922FB25BF2D8000D33EAB /* NSError+PEP.h in Headers */,
15A922FC25BF2D8000D33EAB /* NSError+PEP+Internal.h in Headers */,
1543DD81257A3BCF0041EFB5 /* PEPSessionProvider.h in Headers */,
1543DD7E257A3BCF0041EFB5 /* Logger.h in Headers */,
1543DD7C257A3BCF0041EFB5 /* PEPPassphraseUtil.h in Headers */,
@ -826,7 +809,6 @@
files = (
1552D981257660C900A92F71 /* PEPInternalSession.h in Headers */,
1552D974257660C900A92F71 /* Logger.h in Headers */,
1552D98A257660C900A92F71 /* NSError+PEP.h in Headers */,
1552D9522576607900A92F71 /* PEPObjCAdapter.h in Headers */,
1552D9502576607900A92F71 /* PEPSession.h in Headers */,
1552D98C257660C900A92F71 /* PEPSync_Internal.h in Headers */,
@ -836,7 +818,6 @@
1552D94B2576607900A92F71 /* PEPPassphraseProviderProtocol.h in Headers */,
1552D988257660C900A92F71 /* NSArray+Take.h in Headers */,
1552D976257660C900A92F71 /* PEPSessionProvider.h in Headers */,
1552D98B257660C900A92F71 /* NSError+PEP+Internal.h in Headers */,
1552D972257660C900A92F71 /* PEPCSVScanner.h in Headers */,
1552D94F2576607900A92F71 /* PEPNotifyHandshakeDelegate.h in Headers */,
1552D975257660C900A92F71 /* PEPIdentity+Reset.h in Headers */,
@ -864,7 +845,6 @@
files = (
15C3085326E8B5030013F39F /* PEPInternalSession.h in Headers */,
15C3085426E8B5030013F39F /* Logger.h in Headers */,
15C3085526E8B5030013F39F /* NSError+PEP.h in Headers */,
15C3085626E8B5030013F39F /* PEPObjCAdapter.h in Headers */,
15C3085726E8B5030013F39F /* PEPSession.h in Headers */,
15C3085826E8B5030013F39F /* PEPSync_Internal.h in Headers */,
@ -874,7 +854,6 @@
15C3085C26E8B5030013F39F /* PEPPassphraseProviderProtocol.h in Headers */,
15C3085D26E8B5030013F39F /* NSArray+Take.h in Headers */,
15C3085E26E8B5030013F39F /* PEPSessionProvider.h in Headers */,
15C3085F26E8B5030013F39F /* NSError+PEP+Internal.h in Headers */,
15C3086026E8B5030013F39F /* PEPCSVScanner.h in Headers */,
15C3086126E8B5030013F39F /* PEPNotifyHandshakeDelegate.h in Headers */,
15C3086226E8B5030013F39F /* PEPIdentity+Reset.h in Headers */,
@ -1232,7 +1211,6 @@
1543DCB5257944DC0041EFB5 /* PEPInternalConstants.m in Sources */,
1543DC9E257944C40041EFB5 /* PEPInternalSession.m in Sources */,
159C00AA25BB140F00F13E2B /* (null) in Sources */,
159C00A825BB140F00F13E2B /* NSError+PEP.m in Sources */,
1543DCC3257944EB0041EFB5 /* PEPPassphraseCacheEntry.m in Sources */,
1543DCA6257944CB0041EFB5 /* PEPSessionProvider.m in Sources */,
1543DC97257944C00041EFB5 /* PEPQueue.m in Sources */,
@ -1261,7 +1239,6 @@
15C3089526E8B8550013F39F /* Logger.m in Sources */,
1552D96C257660C900A92F71 /* PEPSync.m in Sources */,
1552D986257660C900A92F71 /* PEPPassphraseUtil.m in Sources */,
1552D969257660C900A92F71 /* NSError+PEP.m in Sources */,
1552D980257660C900A92F71 /* PEPObjCAdapter.m in Sources */,
1552D96D257660C900A92F71 /* PEPQueue.m in Sources */,
159C00B125BB141000F13E2B /* (null) in Sources */,
@ -1291,7 +1268,6 @@
15C3089626E8B8550013F39F /* Logger.m in Sources */,
15C3088226E8B5030013F39F /* PEPSync.m in Sources */,
15C3088326E8B5030013F39F /* PEPPassphraseUtil.m in Sources */,
15C3088426E8B5030013F39F /* NSError+PEP.m in Sources */,
15C3088526E8B5030013F39F /* PEPObjCAdapter.m in Sources */,
15C3088626E8B5030013F39F /* PEPQueue.m in Sources */,
15C3088726E8B5030013F39F /* (null) in Sources */,


+ 0
- 31
pEpObjCAdapter/Extensions/NSError+PEP+Internal.h View File

@ -1,31 +0,0 @@
//
// NSError+PEP+Internal.h
// pEpObjCAdapter
//
// Created by Dirk Zimmermann on 28.02.19.
// Copyright © 2019 pp. All rights reserved.
//
#ifndef NSError_PEP_Internal_h
#define NSError_PEP_Internal_h
#import "PEPEngineTypes.h"
/**
Extension for creating `NSError`s from `PEP_STATUS`
*/
@interface NSError (Internal)
+ (NSError * _Nullable)errorWithPEPStatus:(PEPStatus)status;
+ (NSError * _Nullable)errorWithPEPStatusInternal:(PEP_STATUS)status;
/**
If the given status indicates an error, tries to set the given error accordingly.
@return YES if the given status indicates an error condition, NO otherwise.
*/
+ (BOOL)setError:(NSError * _Nullable * _Nullable)error fromPEPStatus:(PEPStatus)status;
@end
#endif /* NSError_PEP_Internal_h */

+ 0
- 24
pEpObjCAdapter/Extensions/NSError+PEP.h View File

@ -1,24 +0,0 @@
//
// NSError+PEP.h
// pEpObjCAdapter
//
// Created by Dirk Zimmermann on 20.02.18.
// Copyright © 2018 pp. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "pEpEngine.h"
/**
Extension for creating `NSError`s from `PEP_STATUS`
*/
@interface NSError (Extension)
/**
A possible string representation of the error code if this is a pEp error.
@return A string representation of the pEp error code, if it's in the pEp domain.
*/
- (NSString * _Nullable)pEpErrorString;
@end

+ 35
- 36
pEpObjCAdapter/PEPInternalSession.m View File

@ -18,7 +18,6 @@
#import "NSArray+Take.h"
#import "PEPIdentity.h"
#import "PEPMessage.h"
#import "NSError+PEP+Internal.h"
#import "PEPAutoPointer.h"
#import "NSNumber+PEPRating.h"
#import "PEPSync.h"
@ -124,7 +123,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
*status = theStatus;
}
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
decryptMessageFree(_src, _dst, theKeys);
return nil;
}
@ -191,7 +190,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
*status = theStatus;
}
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
return NO;
} else {
return YES;
@ -226,7 +225,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
*status = theStatus;
}
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
return nil;
}
@ -292,7 +291,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
*status = theStatus;
}
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
return nil;
}
@ -338,7 +337,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
*status = theStatus;
}
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
return nil;
}
@ -363,7 +362,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
free_message(_msg);
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return nil;
}
@ -382,7 +381,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
free_message(_msg);
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return nil;
}
@ -401,7 +400,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
free_identity(ident);
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return nil;
}
@ -436,7 +435,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
&size);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return nil;
}
@ -454,7 +453,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return myself(session, ident);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free_identity(ident);
return NO;
}
@ -477,7 +476,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return update_identity(session, ident);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free_identity(ident);
return NO;
}
@ -499,7 +498,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return trust_personal_key(session, ident);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free_identity(ident);
return NO;
}
@ -517,7 +516,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return key_mistrusted(session, ident);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free_identity(ident);
return NO;
}
@ -536,7 +535,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return key_reset_trust(session, ident);
}];
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
free_identity(ident);
return NO;
}
@ -550,7 +549,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
error:(NSError * _Nullable * _Nullable)error
{
if (!identity.isOwn) {
[NSError setError:error fromPEPStatus:PEPStatusIllegalValue];
[PEPStatusNSErrorUtil setError:error fromPEPStatus:PEPStatusIllegalValue];
return NO;
}
@ -560,7 +559,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return enable_identity_for_sync(session, ident);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free_identity(ident);
return NO;
}
@ -574,7 +573,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
error:(NSError * _Nullable * _Nullable)error
{
if (!identity.isOwn) {
[NSError setError:error fromPEPStatus:PEPStatusIllegalValue];
[PEPStatusNSErrorUtil setError:error fromPEPStatus:PEPStatusIllegalValue];
return NO;
}
@ -584,7 +583,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return disable_identity_for_sync(session, ident);
}];
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
free_identity(ident);
return NO;
}
@ -605,7 +604,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
[keydata length], &identList);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free(identList);
return nil;
}
@ -634,7 +633,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
UTF8String]);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return NO;
} else {
return YES;
@ -648,14 +647,14 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return get_crashdump_log(session, 0, &theChars);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return nil;
}
if (theChars) {
return [NSString stringWithUTF8String:theChars];
} else {
[NSError setError:error fromPEPStatus:(PEPStatus) PEP_UNKNOWN_ERROR];
[PEPStatusNSErrorUtil setError:error fromPEPStatus:(PEPStatus) PEP_UNKNOWN_ERROR];
return nil;
}
}
@ -684,7 +683,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
NSString *result = nil;
if (![NSError setError:error fromPEPStatus:status]) {
if (![PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
result = [NSString stringWithUTF8String:trustwords.charPointer];
}
@ -712,7 +711,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
NSString *result = nil;
if (![NSError setError:error fromPEPStatus:status]) {
if (![PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
result = [NSString stringWithUTF8String:trustwords.charPointer];
}
@ -726,7 +725,7 @@ void decryptMessageFree(message *src, message *dst, stringlist_t *extraKeys)
return get_languagelist(session, chLangs.charPointerPointer);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return nil;
}
@ -823,7 +822,7 @@ static NSDictionary *stringToRating;
free_identity(ident);
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return nil;
} else {
return [NSNumber numberWithBool:isPEP];
@ -844,7 +843,7 @@ static NSDictionary *stringToRating;
free_identity(ident);
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return NO;
} else {
return YES;
@ -866,7 +865,7 @@ static NSDictionary *stringToRating;
return set_identity_flags(session, ident, flags);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free_identity(ident);
return NO;
} else {
@ -895,7 +894,7 @@ static NSDictionary *stringToRating;
free(identitiesSharingData);
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return NO;
} else {
return YES;
@ -913,7 +912,7 @@ static NSDictionary *stringToRating;
free_identity(ident);
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return NO;
} else {
return YES;
@ -939,7 +938,7 @@ static NSDictionary *stringToRating;
free_identity(ident);
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
return NO;
} else {
return YES;
@ -952,7 +951,7 @@ static NSDictionary *stringToRating;
return leave_device_group(session);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
return NO;
} else {
return YES;
@ -965,7 +964,7 @@ static NSDictionary *stringToRating;
return key_reset_all_own_keys(self.session);
}];
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
return NO;
} else {
return YES;
@ -989,7 +988,7 @@ static NSDictionary *stringToRating;
PEP_STATUS status = config_passphrase(_session, [normalizedPassphrase UTF8String]);
if ([NSError setError:error fromPEPStatus:(PEPStatus) status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:(PEPStatus) status]) {
return NO;
}
[PEPSync.sharedInstance handleNewPassphraseConfigured];
@ -1008,7 +1007,7 @@ static NSDictionary *stringToRating;
return disable_all_sync_channels(self.session);
}];
if ([NSError setError:error fromPEPStatus:theStatus]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:theStatus]) {
return NO;
} else {
return YES;


+ 0
- 1
pEpObjCAdapter/PEPObjCAdapter.m View File

@ -14,7 +14,6 @@
#import "PEPObjCAdapter.h"
#import "PEPObjCAdapter+Internal.h"
#import "NSError+PEP.h"
#import "NSString+NormalizePassphrase.h"
#import "PEPInternalSession.h"
#import "PEPPassphraseCache.h"


+ 3
- 3
pEpObjCAdapter/PEPSession.m View File

@ -15,7 +15,7 @@
#import "PEPIdentity.h"
#import "PEPSessionProvider.h"
#import "PEPInternalConstants.h"
#import "NSError+PEP+Internal.h"
#import <PEPObjCTypeUtils.h>
static dispatch_queue_t queue;
@ -595,7 +595,7 @@ successCallback:(void (^)(NSString *log))successCallback
PEPInternalSession *session = [PEPSessionProvider session];
if (session == nil) {
if (error) {
*error = [NSError errorWithPEPStatusInternal:PEP_UNKNOWN_ERROR];
*error = [PEPStatusNSErrorUtil errorWithPEPStatus:PEP_UNKNOWN_ERROR];
}
return NO;
}
@ -636,7 +636,7 @@ successCallback:(void (^)(NSString *log))successCallback
PEPInternalSession *session = [PEPSessionProvider session];
if (session == nil) {
if (error) {
*error = [NSError errorWithPEPStatusInternal:PEP_UNKNOWN_ERROR];
*error = [PEPStatusNSErrorUtil errorWithPEPStatus:PEP_UNKNOWN_ERROR];
}
return NO;
}


+ 1
- 2
pEpObjCAdapter/PEPSync.m View File

@ -20,7 +20,6 @@
#import "PEPMessage.h"
#import "PEPQueue.h"
#import "PEPObjCAdapter.h"
#import "NSError+PEP+Internal.h"
#import "PEPSessionProvider.h"
#import "PEPInternalSession.h"
#import "PEPPassphraseCache.h"
@ -162,7 +161,7 @@ static __weak PEPSync *s_pEpSync;
if (status != PEP_STATUS_OK) {
if (error) {
*error = [NSError errorWithPEPStatusInternal:status];
*error = [PEPStatusNSErrorUtil errorWithPEPStatus:status];
LogError(@"error creating session: %@", *error);
}
return nil;


+ 1
- 1
pEpObjCTests/TestUtils/PEPInternalSession+SetIdentity.m View File

@ -26,7 +26,7 @@
return set_identity(self.session, ident);
}];
if ([NSError setError:error fromPEPStatus:status]) {
if ([PEPStatusNSErrorUtil setError:error fromPEPStatus:status]) {
free_identity(ident);
return NO;
}


Loading…
Cancel
Save