IOS-1480 PEPTypes -> PEPEngineTypes. IOS-1480
authorDirk Zimmermann <dz@pep.security>
Fri, 01 Mar 2019 16:03:28 +0100
branchIOS-1480
changeset 8461871d4dcd3fd
parent 845 39908620a3f8
child 847 699c535ce67b
IOS-1480 PEPTypes -> PEPEngineTypes.
pEpObjCAdapter.xcodeproj/project.pbxproj
pEpObjCAdapterFramework/PEPEngineTypes.h
pEpObjCAdapterFramework/PEPObjCAdapterFramework.h
pEpObjCAdapterFramework/PEPTypes.h
     1.1 --- a/pEpObjCAdapter.xcodeproj/project.pbxproj	Fri Mar 01 16:03:28 2019 +0100
     1.2 +++ b/pEpObjCAdapter.xcodeproj/project.pbxproj	Fri Mar 01 16:03:28 2019 +0100
     1.3 @@ -57,7 +57,7 @@
     1.4  		43E39867221D7EB1008E7983 /* libpEpEngine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64289E561B8B70E800FC617B /* libpEpEngine.a */; };
     1.5  		43E39869221D7EC2008E7983 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 43E39868221D7EC2008E7983 /* libbz2.tbd */; };
     1.6  		43E3986B221D7EDD008E7983 /* libiconv.2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 43E3986A221D7EDD008E7983 /* libiconv.2.tbd */; };
     1.7 -		43FF2ED12226AFE9000D9567 /* PEPTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FF2ECC2226AE7E000D9567 /* PEPTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
     1.8 +		43FF2ED12226AFE9000D9567 /* PEPEngineTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 43FF2ECC2226AE7E000D9567 /* PEPEngineTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
     1.9  		640F79231C9B517C00DBEC4E /* 5CB2C182_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */; };
    1.10  		640F79241C9B517C00DBEC4E /* 5CB2C182.asc in Resources */ = {isa = PBXBuildFile; fileRef = 640F79221C9B517C00DBEC4E /* 5CB2C182.asc */; };
    1.11  		64415E2E1BE9511300F6CBB2 /* libbz2.1.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 64415E2D1BE9511300F6CBB2 /* libbz2.1.0.dylib */; };
    1.12 @@ -192,7 +192,7 @@
    1.13  		43F73BD32165F6EC00AB4524 /* PEPLock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPLock.m; sourceTree = "<group>"; };
    1.14  		43F73BE82166248E00AB4524 /* PEPSync.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPSync.h; sourceTree = "<group>"; };
    1.15  		43F73BE92166248E00AB4524 /* PEPSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSync.m; sourceTree = "<group>"; };
    1.16 -		43FF2ECC2226AE7E000D9567 /* PEPTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PEPTypes.h; path = pEpObjCAdapterFramework/PEPTypes.h; sourceTree = SOURCE_ROOT; };
    1.17 +		43FF2ECC2226AE7E000D9567 /* PEPEngineTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PEPEngineTypes.h; path = pEpObjCAdapterFramework/PEPEngineTypes.h; sourceTree = SOURCE_ROOT; };
    1.18  		640F79211C9B517C00DBEC4E /* 5CB2C182_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5CB2C182_sec.asc; sourceTree = "<group>"; };
    1.19  		640F79221C9B517C00DBEC4E /* 5CB2C182.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 5CB2C182.asc; sourceTree = "<group>"; };
    1.20  		64415E171BE94FCB00F6CBB2 /* pEpObjCAdapterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = pEpObjCAdapterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
    1.21 @@ -364,7 +364,7 @@
    1.22  				435796E11FB5E51A00395A9E /* PEPMessage.h */,
    1.23  				15206CC51F8E078B003FF880 /* PEPSession.h */,
    1.24  				43209B2F1ECC2ACD007E7E2E /* PEPObjCAdapter.h */,
    1.25 -				43FF2ECC2226AE7E000D9567 /* PEPTypes.h */,
    1.26 +				43FF2ECC2226AE7E000D9567 /* PEPEngineTypes.h */,
    1.27  				435F518F22204A67006EB11F /* PEPSessionProtocol.h */,
    1.28  				435F5163222045FB006EB11F /* PEPIdentity.h */,
    1.29  				43E3985D221D7E56008E7983 /* PEPObjCAdapterFramework.h */,
    1.30 @@ -408,7 +408,7 @@
    1.31  				435F5164222045FB006EB11F /* PEPIdentity.h in Headers */,
    1.32  				43E3985F221D7E56008E7983 /* PEPObjCAdapterFramework.h in Headers */,
    1.33  				435C0C8C22291FFB0025C6B5 /* PEPSession.h in Headers */,
    1.34 -				43FF2ED12226AFE9000D9567 /* PEPTypes.h in Headers */,
    1.35 +				43FF2ED12226AFE9000D9567 /* PEPEngineTypes.h in Headers */,
    1.36  				435F519022204A67006EB11F /* PEPSessionProtocol.h in Headers */,
    1.37  			);
    1.38  			runOnlyForDeploymentPostprocessing = 0;
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/pEpObjCAdapterFramework/PEPEngineTypes.h	Fri Mar 01 16:03:28 2019 +0100
     2.3 @@ -0,0 +1,230 @@
     2.4 +//
     2.5 +//  PEPTypes.h
     2.6 +//  pEpObjCAdapter
     2.7 +//
     2.8 +//  Created by Dirk Zimmermann on 27.02.19.
     2.9 +//  Copyright © 2019 p≡p. All rights reserved.
    2.10 +//
    2.11 +
    2.12 +#ifndef PEPTypes_h
    2.13 +#define PEPTypes_h
    2.14 +
    2.15 +#import <Foundation/Foundation.h>
    2.16 +
    2.17 +typedef NSDictionary<NSString *, id> PEPDict;
    2.18 +typedef NSMutableDictionary<NSString *, id> PEPMutableDict;
    2.19 +typedef NSArray<NSString *> PEPStringList;
    2.20 +
    2.21 +typedef enum _ObjC_PEP_decrypt_flags {
    2.22 +    PEPDecryptFlagOwnPrivateKey = 0x1, // PEP_decrypt_flag_own_private_key = 0x1,
    2.23 +    PEPDecryptFlagConsume = 0x2, // PEP_decrypt_flag_consume = 0x2,
    2.24 +    PEPDecryptFlagIgnore = 0x4, // PEP_decrypt_flag_ignore = 0x4,
    2.25 +    PEPDecryptFlagSrcModified = 0x8, // PEP_decrypt_flag_src_modified = 0x8,
    2.26 +    // input flags
    2.27 +    PEPDecryptFlagUntrustedServer = 0x100 // PEP_decrypt_flag_untrusted_server = 0x100
    2.28 +} PEPDecryptFlags; // PEP_decrypt_flags;
    2.29 +
    2.30 +typedef enum _ObjC_PEP_enc_format {
    2.31 +    PEPEncNone = 0, // PEP_enc_none = 0, // message is not encrypted
    2.32 +    PEPEncPieces, // PEP_enc_pieces, // inline PGP + PGP extensions
    2.33 +    PEPEncSMIME, // PEP_enc_S_MIME, // RFC5751
    2.34 +    PEPEncPGPMIME, // PEP_enc_PGP_MIME, // RFC3156
    2.35 +    PEPEncPEP, // PEP_enc_PEP, // pEp encryption format
    2.36 +    PEPEncPGPMIMEOutlook1 // PEP_enc_PGP_MIME_Outlook1 // Message B0rken by Outlook type 1
    2.37 +} PEPEncFormat;
    2.38 +
    2.39 +typedef enum _ObjC_PEP_rating {
    2.40 +    PEPRatingUndefined = 0,// PEP_rating_undefined = 0,
    2.41 +    PEPRatingCannotDecrypt, // PEP_rating_cannot_decrypt,
    2.42 +    PEPRatingHaveNoKey, // PEP_rating_have_no_key,
    2.43 +    PEPRatingUnencrypted, // PEP_rating_unencrypted,
    2.44 +    PEPRatingUnencryptedForSome, // PEP_rating_unencrypted_for_some, // don't use this any more
    2.45 +    PEPRatingUnreliable, // PEP_rating_unreliable,
    2.46 +    PEPRatingReliable, // PEP_rating_reliable,
    2.47 +    PEPRatingTrusted, // PEP_rating_trusted,
    2.48 +    PEPRatingTrustedAndAnonymized, // PEP_rating_trusted_and_anonymized,
    2.49 +    PEPRatingFullyAnonymous, // PEP_rating_fully_anonymous,
    2.50 +
    2.51 +    PEPRatingMistrust = -1, // PEP_rating_mistrust = -1,
    2.52 +    PEPRatingB0rken = -2, // PEP_rating_b0rken = -2,
    2.53 +    PEPRatingUnderAttack = -3 // PEP_rating_under_attack = -3
    2.54 +} PEPRating;
    2.55 +
    2.56 +typedef enum {
    2.57 +    PEPStatusOK                                   = 0, // PEP_STATUS_OK
    2.58 +
    2.59 +    PEPInitCannotLoadGPME                      = 0x0110, // PEP_INIT_CANNOT_LOAD_GPGME
    2.60 +    PEPInitGPGMEInitFailed                      = 0x0111, // PEP_INIT_GPGME_INIT_FAILED
    2.61 +    PEPInitNoGPGHome                            = 0x0112, // PEP_INIT_NO_GPG_HOME
    2.62 +    PEPInitNETPGPInitFailed                     = 0x0113, // PEP_INIT_NETPGP_INIT_FAILED
    2.63 +    PEPInitCannotDetermineGPGVersion           = 0x0114, // PEP_INIT_CANNOT_DETERMINE_GPG_VERSION
    2.64 +    PEPInitUnsupportedGPGVersion                = 0x0115, // PEP_INIT_UNSUPPORTED_GPG_VERSION
    2.65 +    PEPInitCannotConfigGPGAgent                = 0x0116, // PEP_INIT_CANNOT_CONFIG_GPG_AGENT
    2.66 +
    2.67 +    PEPInitSqlite3WithoutMutex                  = 0x0120, // PEP_INIT_SQLITE3_WITHOUT_MUTEX
    2.68 +    PEPInitCannotOpenDB                         = 0x0121, // PEP_INIT_CANNOT_OPEN_DB
    2.69 +    PEPInitCannotOpenSystemDB                  = 0x0122, // PEP_INIT_CANNOT_OPEN_SYSTEM_DB
    2.70 +    PEPUnknownDBError                            = 0x01ff, // PEP_UNKNOWN_DB_ERROR
    2.71 +
    2.72 +    PEPKeyNotFound                               = 0x0201, // PEP_KEY_NOT_FOUND
    2.73 +    PEPKeyHasAmbigName                          = 0x0202, // PEP_KEY_HAS_AMBIG_NAME
    2.74 +    PEPGetKeyFailed                              = 0x0203, // PEP_GET_KEY_FAILED
    2.75 +    PEPCannotExportKey                           = 0x0204, // PEP_CANNOT_EXPORT_KEY
    2.76 +    PEPCannotEditKey                             = 0x0205, // PEP_CANNOT_EDIT_KEY
    2.77 +    PEPKeyUnsuitable                              = 0x0206, // PEP_KEY_UNSUITABLE
    2.78 +    PEPMalformedKeyResetMsg                     = 0x0210, // PEP_MALFORMED_KEY_RESET_MSG
    2.79 +    PEPKeyNotReset                               = 0x0211, // PEP_KEY_NOT_RESET
    2.80 +
    2.81 +    PEPKeyImported                                = 0x0220, // PEP_KEY_IMPORTED
    2.82 +    PEPNoKeyImported                             = 0x0221, // PEP_NO_KEY_IMPORTED
    2.83 +    PEPKeyImportStatusUnknown                   = 0x0222, // PEP_KEY_IMPORT_STATUS_UNKNOWN
    2.84 +
    2.85 +    PEPCannotFindIdentity                        = 0x0301, // PEP_CANNOT_FIND_IDENTITY
    2.86 +    PEPCannotSetPerson                           = 0x0381, // PEP_CANNOT_SET_PERSON
    2.87 +    PEPCannotSetPGPKeyPair                      = 0x0382, // PEP_CANNOT_SET_PGP_KEYPAIR
    2.88 +    PEPCannotSetIdentity                         = 0x0383, // PEP_CANNOT_SET_IDENTITY
    2.89 +    PEPCannotSetTrust                            = 0x0384, // PEP_CANNOT_SET_TRUST
    2.90 +    PEPKeyBlacklisted                             = 0x0385, // PEP_KEY_BLACKLISTED
    2.91 +    PEPCannotFindPerson                          = 0x0386, // PEP_CANNOT_FIND_PERSON
    2.92 +
    2.93 +    PEPCannotFindAlias                           = 0x0391, // PEP_CANNOT_FIND_ALIAS
    2.94 +    PEPCannotSetAlias                            = 0x0392, // PEP_CANNOT_SET_ALIAS
    2.95 +
    2.96 +    PEPUnencrypted                                 = 0x0400, // PEP_UNENCRYPTED
    2.97 +    PEPVerified                                    = 0x0401, // PEP_VERIFIED
    2.98 +    PEPDecrypted                                   = 0x0402, // PEP_DECRYPTED
    2.99 +    PEPDecryptedAndVerified                      = 0x0403, // PEP_DECRYPTED_AND_VERIFIED
   2.100 +    PEPDecryptWrongFormat                        = 0x0404, // PEP_DECRYPT_WRONG_FORMAT
   2.101 +    PEPDecryptNoKey                              = 0x0405, // PEP_DECRYPT_NO_KEY
   2.102 +    PEPDecryptSignatureDoesNotMatch            = 0x0406, // PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH
   2.103 +    PEPVerifyNoKey                               = 0x0407, // PEP_VERIFY_NO_KEY
   2.104 +    PEPVerifiedAndTrusted                        = 0x0408, // PEP_VERIFIED_AND_TRUSTED
   2.105 +    PEPCannotReencrypt                            = 0x0409, // PEP_CANNOT_REENCRYPT
   2.106 +    PEPCannotDecryptUnknown                      = 0x04ff, // PEP_CANNOT_DECRYPT_UNKNOWN
   2.107 +
   2.108 +    PEPTrustwordNotFound                         = 0x0501, // PEP_TRUSTWORD_NOT_FOUND
   2.109 +    PEPTrustwordsFPRWrongLength                 = 0x0502, // PEP_TRUSTWORDS_FPR_WRONG_LENGTH
   2.110 +    PEPTrustwordsDuplicateFPR                    = 0x0503, // PEP_TRUSTWORDS_DUPLICATE_FPR
   2.111 +
   2.112 +    PEPCannotCreateKey                           = 0x0601, // PEP_CANNOT_CREATE_KEY
   2.113 +    PEPCannotSendKey                             = 0x0602, // PEP_CANNOT_SEND_KEY
   2.114 +
   2.115 +    PEPPhraseNotFound                            = 0x0701, // PEP_PHRASE_NOT_FOUND
   2.116 +
   2.117 +    PEPSendFunctionNotRegistered                = 0x0801, // PEP_SEND_FUNCTION_NOT_REGISTERED
   2.118 +    PEPConstraintsViolated                         = 0x0802, // PEP_CONTRAINTS_VIOLATED
   2.119 +    PEPCannotEncode                               = 0x0803, // PEP_CANNOT_ENCODE
   2.120 +
   2.121 +    PEPSyncNoNotifyCallback                     = 0x0901, // PEP_SYNC_NO_NOTIFY_CALLBACK
   2.122 +    PEPSyncIllegalMessage                        = 0x0902, // PEP_SYNC_ILLEGAL_MESSAGE
   2.123 +    PEPSyncNoInjectCallback                     = 0x0903, // PEP_SYNC_NO_INJECT_CALLBACK
   2.124 +    PEPSyncNoChannel                             = 0x0904, // PEP_SYNC_NO_CHANNEL
   2.125 +    PEPSyncCannotEncrypt                         = 0x0905, // PEP_SYNC_CANNOT_ENCRYPT
   2.126 +    PEPSyncNoMessageSendCallback               = 0x0906, // PEP_SYNC_NO_MESSAGE_SEND_CALLBACK
   2.127 +
   2.128 +    PEPCannotIncreaseSequence                    = 0x0971, // PEP_CANNOT_INCREASE_SEQUENCE
   2.129 +
   2.130 +    PEPStatemachineError                          = 0x0980, // PEP_STATEMACHINE_ERROR
   2.131 +    PEPNoTrust                                    = 0x0981, // PEP_NO_TRUST
   2.132 +    PEPStatemachineInvalidState                  = 0x0982, // PEP_STATEMACHINE_INVALID_STATE
   2.133 +    PEPStatemachineInvalidEvent                  = 0x0983, // PEP_STATEMACHINE_INVALID_EVENT
   2.134 +    PEPStatemachineInvalidCondition              = 0x0984, // PEP_STATEMACHINE_INVALID_CONDITION
   2.135 +    PEPStatemachineInvalidAction                 = 0x0985, // PEP_STATEMACHINE_INVALID_ACTION
   2.136 +    PEPStatemachineInhibitedEvent                = 0x0986, // PEP_STATEMACHINE_INHIBITED_EVENT
   2.137 +    PEPStatemachineCannotSend                    = 0x0987, // PEP_STATEMACHINE_CANNOT_SEND
   2.138 +
   2.139 +    PEPCommitFailed                               = 0xff01, // PEP_COMMIT_FAILED
   2.140 +    PEPMessageConsume                             = 0xff02, // PEP_MESSAGE_CONSUME
   2.141 +    PEPMessageIgnore                              = 0xff03, // PEP_MESSAGE_IGNORE
   2.142 +
   2.143 +    PEPRecordNotFound                            = -6, // PEP_RECORD_NOT_FOUND
   2.144 +    PEPCannotCreateTempFile                     = -5, // PEP_CANNOT_CREATE_TEMP_FILE
   2.145 +    PEPIllegalValue                               = -4, // PEP_ILLEGAL_VALUE
   2.146 +    PEPBufferTooSmall                            = -3, // PEP_BUFFER_TOO_SMALL
   2.147 +    PEPOutOfMemory                               = -2, // PEP_OUT_OF_MEMORY
   2.148 +    PEPUnknownError                               = -1, // PEP_UNKNOWN_ERROR
   2.149 +
   2.150 +    PEPVersionMismatch                            = -7, // PEP_VERSION_MISMATCH
   2.151 +} PEPStatus;
   2.152 +
   2.153 +typedef enum _ObjC_identity_flags {
   2.154 +    // the first octet flags are app defined settings
   2.155 +    PEPIdfNotForSync = 0x0001, // PEP_idf_not_for_sync = 0x0001,   // don't use this identity for sync
   2.156 +    PEPIdfList = 0x0002, // PEP_idf_list = 0x0002,           // identity of list of persons
   2.157 +    // the second octet flags are calculated
   2.158 +    PEPIdfDeviceGroup = 0x0100 // PEP_idf_devicegroup = 0x0100     // identity of a device group member
   2.159 +} PEPIdentityFlags;
   2.160 +
   2.161 +typedef enum _ObjC_sync_handshake_result {
   2.162 +    PEPSyncHandshakeResultCancel = -1, // SYNC_HANDSHAKE_CANCEL = -1,
   2.163 +    PEPSyncHandshakeResultAccepted = 0, // SYNC_HANDSHAKE_ACCEPTED = 0,
   2.164 +    PEPSyncHandshakeResultRejected = 1 // SYNC_HANDSHAKE_REJECTED = 1
   2.165 +} PEPSyncHandshakeResult;
   2.166 +
   2.167 +typedef enum _PEPCommType {
   2.168 +    PEPCtUnknown = 0, // PEP_ct_unknown = 0,
   2.169 +
   2.170 +    // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
   2.171 +
   2.172 +    PEPCtNoEncryption = 0x01, // PEP_ct_no_encryption = 0x01,                // generic
   2.173 +    PEPCtNoEncrypted_channel = 0x02, // PEP_ct_no_encrypted_channel = 0x02,
   2.174 +    PEPCtKeyNotFound = 0x03, // PEP_ct_key_not_found = 0x03,
   2.175 +    PEPCtKeyExpired = 0x04, // PEP_ct_key_expired = 0x04,
   2.176 +    PEPCtKeyRevoked = 0x05, // PEP_ct_key_revoked = 0x05,
   2.177 +    PEPCtKeyBr0ken = 0x06, // PEP_ct_key_b0rken = 0x06,
   2.178 +    PEPCtKeyExpiredButConfirmed = 0x07, // PEP_ct_key_expired_but_confirmed = 0x07, // NOT with confirmed bit. Just retaining info here in case of renewal.
   2.179 +    PEPCtMyKeyNotIncluded = 0x09, // PEP_ct_my_key_not_included = 0x09,
   2.180 +
   2.181 +    PEPCtSecurityByObscurity = 0x0a, // PEP_ct_security_by_obscurity = 0x0a,
   2.182 +    PEPCtBr0kenCrypto = 0x0b, // PEP_ct_b0rken_crypto = 0x0b,
   2.183 +    PEPCtKeyTooShort = 0x0c, // PEP_ct_key_too_short = 0x0c,
   2.184 +
   2.185 +    PEPCtCompromised = 0x0e, // PEP_ct_compromized = 0x0e,                  // deprecated misspelling
   2.186 +    PEPCtMistrusted = 0x0f, // PEP_ct_mistrusted = 0x0f,                   // known mistrusted key
   2.187 +
   2.188 +    // range 0x10 to 0x3f: unconfirmed encryption
   2.189 +
   2.190 +    PEPCtUnconfirmedEncryption = 0x10, // PEP_ct_unconfirmed_encryption = 0x10,       // generic
   2.191 +    PEPCtOpenPGPWeakUnconfirmed = 0x11, // PEP_ct_OpenPGP_weak_unconfirmed = 0x11,     // RSA 1024 is weak
   2.192 +
   2.193 +    PEPCtToBeChecked = 0x20, // PEP_ct_to_be_checked = 0x20,                // generic
   2.194 +    PEPCtSMIMEUnconfirmed = 0x21, // PEP_ct_SMIME_unconfirmed = 0x21,
   2.195 +    PEPCtCMSUnconfirmed = 0x22, // PEP_ct_CMS_unconfirmed = 0x22,
   2.196 +
   2.197 +    PEPCtStongButUnconfirmed = 0x30, // PEP_ct_strong_but_unconfirmed = 0x30,       // generic
   2.198 +    PEPCtOpenPGPUnconfirmed = 0x38, // PEP_ct_OpenPGP_unconfirmed = 0x38,          // key at least 2048 bit RSA or EC
   2.199 +    PEPCtOTRUnconfirmed = 0x3a, // PEP_ct_OTR_unconfirmed = 0x3a,
   2.200 +
   2.201 +    // range 0x40 to 0x7f: unconfirmed encryption and anonymization
   2.202 +
   2.203 +    PEPCtUnconfirmedEncAnon = 0x40, // PEP_ct_unconfirmed_enc_anon = 0x40,         // generic
   2.204 +    PEPCtPEPUnconfirmed = 0x7f, // PEP_ct_pEp_unconfirmed = 0x7f,
   2.205 +
   2.206 +    PEPCtConfirmed = 0x80, // PEP_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
   2.207 +
   2.208 +    // range 0x81 to 0x8f: reserved
   2.209 +    // range 0x90 to 0xbf: confirmed encryption
   2.210 +
   2.211 +    PEPCtConfirmedEncryption = 0x90, // PEP_ct_confirmed_encryption = 0x90,         // generic
   2.212 +    PEPCtOpenPGPWeak = 0x91, // PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak (unused)
   2.213 +
   2.214 +    PEPCtToBeCheckedConfirmed = 0xa0, // PEP_ct_to_be_checked_confirmed = 0xa0,      // generic
   2.215 +    PEPCtSMIME = 0xa1, // PEP_ct_SMIME = 0xa1,
   2.216 +    PEPCtCMS = 0xa2, // PEP_ct_CMS = 0xa2,
   2.217 +
   2.218 +    PEPCtStongEncryption = 0xb0, // PEP_ct_strong_encryption = 0xb0,            // generic
   2.219 +    PEPCtOpenPGP = 0xb8, // PEP_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
   2.220 +    PEPCtOTR = 0xba, // PEP_ct_OTR = 0xba,
   2.221 +
   2.222 +    // range 0xc0 to 0xff: confirmed encryption and anonymization
   2.223 +
   2.224 +    PEPCtConfirmedEncAnon = 0xc0, // PEP_ct_confirmed_enc_anon = 0xc0,           // generic
   2.225 +    PEPCtPEP = 0xff // PEP_ct_pEp = 0xff
   2.226 +} PEPCommType;
   2.227 +
   2.228 +typedef enum _ObjC_PEP_msg_direction {
   2.229 +    PEPDirIncoming = 0,
   2.230 +    PEPDirOutgoing
   2.231 +} PEPMsgDirection;
   2.232 +
   2.233 +#endif /* PEPTypes_h */
     3.1 --- a/pEpObjCAdapterFramework/PEPObjCAdapterFramework.h	Fri Mar 01 16:03:28 2019 +0100
     3.2 +++ b/pEpObjCAdapterFramework/PEPObjCAdapterFramework.h	Fri Mar 01 16:03:28 2019 +0100
     3.3 @@ -18,7 +18,7 @@
     3.4  
     3.5  #import <PEPObjCAdapterFramework/PEPIdentity.h>
     3.6  #import <PEPObjCAdapterFramework/PEPSessionProtocol.h>
     3.7 -#import <PEPObjCAdapterFramework/PEPTypes.h>
     3.8 +#import <PEPObjCAdapterFramework/PEPEngineTypes.h>
     3.9  #import <PEPObjCAdapterFramework/PEPObjCAdapter.h>
    3.10  #import <PEPObjCAdapterFramework/PEPSession.h>
    3.11  #import <PEPObjCAdapterFramework/PEPMessage.h>
     4.1 --- a/pEpObjCAdapterFramework/PEPTypes.h	Fri Mar 01 16:03:28 2019 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,230 +0,0 @@
     4.4 -//
     4.5 -//  PEPTypes.h
     4.6 -//  pEpObjCAdapter
     4.7 -//
     4.8 -//  Created by Dirk Zimmermann on 27.02.19.
     4.9 -//  Copyright © 2019 p≡p. All rights reserved.
    4.10 -//
    4.11 -
    4.12 -#ifndef PEPTypes_h
    4.13 -#define PEPTypes_h
    4.14 -
    4.15 -#import <Foundation/Foundation.h>
    4.16 -
    4.17 -typedef NSDictionary<NSString *, id> PEPDict;
    4.18 -typedef NSMutableDictionary<NSString *, id> PEPMutableDict;
    4.19 -typedef NSArray<NSString *> PEPStringList;
    4.20 -
    4.21 -typedef enum _ObjC_PEP_decrypt_flags {
    4.22 -    PEPDecryptFlagOwnPrivateKey = 0x1, // PEP_decrypt_flag_own_private_key = 0x1,
    4.23 -    PEPDecryptFlagConsume = 0x2, // PEP_decrypt_flag_consume = 0x2,
    4.24 -    PEPDecryptFlagIgnore = 0x4, // PEP_decrypt_flag_ignore = 0x4,
    4.25 -    PEPDecryptFlagSrcModified = 0x8, // PEP_decrypt_flag_src_modified = 0x8,
    4.26 -    // input flags
    4.27 -    PEPDecryptFlagUntrustedServer = 0x100 // PEP_decrypt_flag_untrusted_server = 0x100
    4.28 -} PEPDecryptFlags; // PEP_decrypt_flags;
    4.29 -
    4.30 -typedef enum _ObjC_PEP_enc_format {
    4.31 -    PEPEncNone = 0, // PEP_enc_none = 0, // message is not encrypted
    4.32 -    PEPEncPieces, // PEP_enc_pieces, // inline PGP + PGP extensions
    4.33 -    PEPEncSMIME, // PEP_enc_S_MIME, // RFC5751
    4.34 -    PEPEncPGPMIME, // PEP_enc_PGP_MIME, // RFC3156
    4.35 -    PEPEncPEP, // PEP_enc_PEP, // pEp encryption format
    4.36 -    PEPEncPGPMIMEOutlook1 // PEP_enc_PGP_MIME_Outlook1 // Message B0rken by Outlook type 1
    4.37 -} PEPEncFormat;
    4.38 -
    4.39 -typedef enum _ObjC_PEP_rating {
    4.40 -    PEPRatingUndefined = 0,// PEP_rating_undefined = 0,
    4.41 -    PEPRatingCannotDecrypt, // PEP_rating_cannot_decrypt,
    4.42 -    PEPRatingHaveNoKey, // PEP_rating_have_no_key,
    4.43 -    PEPRatingUnencrypted, // PEP_rating_unencrypted,
    4.44 -    PEPRatingUnencryptedForSome, // PEP_rating_unencrypted_for_some, // don't use this any more
    4.45 -    PEPRatingUnreliable, // PEP_rating_unreliable,
    4.46 -    PEPRatingReliable, // PEP_rating_reliable,
    4.47 -    PEPRatingTrusted, // PEP_rating_trusted,
    4.48 -    PEPRatingTrustedAndAnonymized, // PEP_rating_trusted_and_anonymized,
    4.49 -    PEPRatingFullyAnonymous, // PEP_rating_fully_anonymous,
    4.50 -
    4.51 -    PEPRatingMistrust = -1, // PEP_rating_mistrust = -1,
    4.52 -    PEPRatingB0rken = -2, // PEP_rating_b0rken = -2,
    4.53 -    PEPRatingUnderAttack = -3 // PEP_rating_under_attack = -3
    4.54 -} PEPRating;
    4.55 -
    4.56 -typedef enum {
    4.57 -    PEPStatusOK                                   = 0, // PEP_STATUS_OK
    4.58 -
    4.59 -    PEPInitCannotLoadGPME                      = 0x0110, // PEP_INIT_CANNOT_LOAD_GPGME
    4.60 -    PEPInitGPGMEInitFailed                      = 0x0111, // PEP_INIT_GPGME_INIT_FAILED
    4.61 -    PEPInitNoGPGHome                            = 0x0112, // PEP_INIT_NO_GPG_HOME
    4.62 -    PEPInitNETPGPInitFailed                     = 0x0113, // PEP_INIT_NETPGP_INIT_FAILED
    4.63 -    PEPInitCannotDetermineGPGVersion           = 0x0114, // PEP_INIT_CANNOT_DETERMINE_GPG_VERSION
    4.64 -    PEPInitUnsupportedGPGVersion                = 0x0115, // PEP_INIT_UNSUPPORTED_GPG_VERSION
    4.65 -    PEPInitCannotConfigGPGAgent                = 0x0116, // PEP_INIT_CANNOT_CONFIG_GPG_AGENT
    4.66 -
    4.67 -    PEPInitSqlite3WithoutMutex                  = 0x0120, // PEP_INIT_SQLITE3_WITHOUT_MUTEX
    4.68 -    PEPInitCannotOpenDB                         = 0x0121, // PEP_INIT_CANNOT_OPEN_DB
    4.69 -    PEPInitCannotOpenSystemDB                  = 0x0122, // PEP_INIT_CANNOT_OPEN_SYSTEM_DB
    4.70 -    PEPUnknownDBError                            = 0x01ff, // PEP_UNKNOWN_DB_ERROR
    4.71 -
    4.72 -    PEPKeyNotFound                               = 0x0201, // PEP_KEY_NOT_FOUND
    4.73 -    PEPKeyHasAmbigName                          = 0x0202, // PEP_KEY_HAS_AMBIG_NAME
    4.74 -    PEPGetKeyFailed                              = 0x0203, // PEP_GET_KEY_FAILED
    4.75 -    PEPCannotExportKey                           = 0x0204, // PEP_CANNOT_EXPORT_KEY
    4.76 -    PEPCannotEditKey                             = 0x0205, // PEP_CANNOT_EDIT_KEY
    4.77 -    PEPKeyUnsuitable                              = 0x0206, // PEP_KEY_UNSUITABLE
    4.78 -    PEPMalformedKeyResetMsg                     = 0x0210, // PEP_MALFORMED_KEY_RESET_MSG
    4.79 -    PEPKeyNotReset                               = 0x0211, // PEP_KEY_NOT_RESET
    4.80 -
    4.81 -    PEPKeyImported                                = 0x0220, // PEP_KEY_IMPORTED
    4.82 -    PEPNoKeyImported                             = 0x0221, // PEP_NO_KEY_IMPORTED
    4.83 -    PEPKeyImportStatusUnknown                   = 0x0222, // PEP_KEY_IMPORT_STATUS_UNKNOWN
    4.84 -
    4.85 -    PEPCannotFindIdentity                        = 0x0301, // PEP_CANNOT_FIND_IDENTITY
    4.86 -    PEPCannotSetPerson                           = 0x0381, // PEP_CANNOT_SET_PERSON
    4.87 -    PEPCannotSetPGPKeyPair                      = 0x0382, // PEP_CANNOT_SET_PGP_KEYPAIR
    4.88 -    PEPCannotSetIdentity                         = 0x0383, // PEP_CANNOT_SET_IDENTITY
    4.89 -    PEPCannotSetTrust                            = 0x0384, // PEP_CANNOT_SET_TRUST
    4.90 -    PEPKeyBlacklisted                             = 0x0385, // PEP_KEY_BLACKLISTED
    4.91 -    PEPCannotFindPerson                          = 0x0386, // PEP_CANNOT_FIND_PERSON
    4.92 -
    4.93 -    PEPCannotFindAlias                           = 0x0391, // PEP_CANNOT_FIND_ALIAS
    4.94 -    PEPCannotSetAlias                            = 0x0392, // PEP_CANNOT_SET_ALIAS
    4.95 -
    4.96 -    PEPUnencrypted                                 = 0x0400, // PEP_UNENCRYPTED
    4.97 -    PEPVerified                                    = 0x0401, // PEP_VERIFIED
    4.98 -    PEPDecrypted                                   = 0x0402, // PEP_DECRYPTED
    4.99 -    PEPDecryptedAndVerified                      = 0x0403, // PEP_DECRYPTED_AND_VERIFIED
   4.100 -    PEPDecryptWrongFormat                        = 0x0404, // PEP_DECRYPT_WRONG_FORMAT
   4.101 -    PEPDecryptNoKey                              = 0x0405, // PEP_DECRYPT_NO_KEY
   4.102 -    PEPDecryptSignatureDoesNotMatch            = 0x0406, // PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH
   4.103 -    PEPVerifyNoKey                               = 0x0407, // PEP_VERIFY_NO_KEY
   4.104 -    PEPVerifiedAndTrusted                        = 0x0408, // PEP_VERIFIED_AND_TRUSTED
   4.105 -    PEPCannotReencrypt                            = 0x0409, // PEP_CANNOT_REENCRYPT
   4.106 -    PEPCannotDecryptUnknown                      = 0x04ff, // PEP_CANNOT_DECRYPT_UNKNOWN
   4.107 -
   4.108 -    PEPTrustwordNotFound                         = 0x0501, // PEP_TRUSTWORD_NOT_FOUND
   4.109 -    PEPTrustwordsFPRWrongLength                 = 0x0502, // PEP_TRUSTWORDS_FPR_WRONG_LENGTH
   4.110 -    PEPTrustwordsDuplicateFPR                    = 0x0503, // PEP_TRUSTWORDS_DUPLICATE_FPR
   4.111 -
   4.112 -    PEPCannotCreateKey                           = 0x0601, // PEP_CANNOT_CREATE_KEY
   4.113 -    PEPCannotSendKey                             = 0x0602, // PEP_CANNOT_SEND_KEY
   4.114 -
   4.115 -    PEPPhraseNotFound                            = 0x0701, // PEP_PHRASE_NOT_FOUND
   4.116 -
   4.117 -    PEPSendFunctionNotRegistered                = 0x0801, // PEP_SEND_FUNCTION_NOT_REGISTERED
   4.118 -    PEPConstraintsViolated                         = 0x0802, // PEP_CONTRAINTS_VIOLATED
   4.119 -    PEPCannotEncode                               = 0x0803, // PEP_CANNOT_ENCODE
   4.120 -
   4.121 -    PEPSyncNoNotifyCallback                     = 0x0901, // PEP_SYNC_NO_NOTIFY_CALLBACK
   4.122 -    PEPSyncIllegalMessage                        = 0x0902, // PEP_SYNC_ILLEGAL_MESSAGE
   4.123 -    PEPSyncNoInjectCallback                     = 0x0903, // PEP_SYNC_NO_INJECT_CALLBACK
   4.124 -    PEPSyncNoChannel                             = 0x0904, // PEP_SYNC_NO_CHANNEL
   4.125 -    PEPSyncCannotEncrypt                         = 0x0905, // PEP_SYNC_CANNOT_ENCRYPT
   4.126 -    PEPSyncNoMessageSendCallback               = 0x0906, // PEP_SYNC_NO_MESSAGE_SEND_CALLBACK
   4.127 -
   4.128 -    PEPCannotIncreaseSequence                    = 0x0971, // PEP_CANNOT_INCREASE_SEQUENCE
   4.129 -
   4.130 -    PEPStatemachineError                          = 0x0980, // PEP_STATEMACHINE_ERROR
   4.131 -    PEPNoTrust                                    = 0x0981, // PEP_NO_TRUST
   4.132 -    PEPStatemachineInvalidState                  = 0x0982, // PEP_STATEMACHINE_INVALID_STATE
   4.133 -    PEPStatemachineInvalidEvent                  = 0x0983, // PEP_STATEMACHINE_INVALID_EVENT
   4.134 -    PEPStatemachineInvalidCondition              = 0x0984, // PEP_STATEMACHINE_INVALID_CONDITION
   4.135 -    PEPStatemachineInvalidAction                 = 0x0985, // PEP_STATEMACHINE_INVALID_ACTION
   4.136 -    PEPStatemachineInhibitedEvent                = 0x0986, // PEP_STATEMACHINE_INHIBITED_EVENT
   4.137 -    PEPStatemachineCannotSend                    = 0x0987, // PEP_STATEMACHINE_CANNOT_SEND
   4.138 -
   4.139 -    PEPCommitFailed                               = 0xff01, // PEP_COMMIT_FAILED
   4.140 -    PEPMessageConsume                             = 0xff02, // PEP_MESSAGE_CONSUME
   4.141 -    PEPMessageIgnore                              = 0xff03, // PEP_MESSAGE_IGNORE
   4.142 -
   4.143 -    PEPRecordNotFound                            = -6, // PEP_RECORD_NOT_FOUND
   4.144 -    PEPCannotCreateTempFile                     = -5, // PEP_CANNOT_CREATE_TEMP_FILE
   4.145 -    PEPIllegalValue                               = -4, // PEP_ILLEGAL_VALUE
   4.146 -    PEPBufferTooSmall                            = -3, // PEP_BUFFER_TOO_SMALL
   4.147 -    PEPOutOfMemory                               = -2, // PEP_OUT_OF_MEMORY
   4.148 -    PEPUnknownError                               = -1, // PEP_UNKNOWN_ERROR
   4.149 -
   4.150 -    PEPVersionMismatch                            = -7, // PEP_VERSION_MISMATCH
   4.151 -} PEPStatus;
   4.152 -
   4.153 -typedef enum _ObjC_identity_flags {
   4.154 -    // the first octet flags are app defined settings
   4.155 -    PEPIdfNotForSync = 0x0001, // PEP_idf_not_for_sync = 0x0001,   // don't use this identity for sync
   4.156 -    PEPIdfList = 0x0002, // PEP_idf_list = 0x0002,           // identity of list of persons
   4.157 -    // the second octet flags are calculated
   4.158 -    PEPIdfDeviceGroup = 0x0100 // PEP_idf_devicegroup = 0x0100     // identity of a device group member
   4.159 -} PEPIdentityFlags;
   4.160 -
   4.161 -typedef enum _ObjC_sync_handshake_result {
   4.162 -    PEPSyncHandshakeResultCancel = -1, // SYNC_HANDSHAKE_CANCEL = -1,
   4.163 -    PEPSyncHandshakeResultAccepted = 0, // SYNC_HANDSHAKE_ACCEPTED = 0,
   4.164 -    PEPSyncHandshakeResultRejected = 1 // SYNC_HANDSHAKE_REJECTED = 1
   4.165 -} PEPSyncHandshakeResult;
   4.166 -
   4.167 -typedef enum _PEPCommType {
   4.168 -    PEPCtUnknown = 0, // PEP_ct_unknown = 0,
   4.169 -
   4.170 -    // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
   4.171 -
   4.172 -    PEPCtNoEncryption = 0x01, // PEP_ct_no_encryption = 0x01,                // generic
   4.173 -    PEPCtNoEncrypted_channel = 0x02, // PEP_ct_no_encrypted_channel = 0x02,
   4.174 -    PEPCtKeyNotFound = 0x03, // PEP_ct_key_not_found = 0x03,
   4.175 -    PEPCtKeyExpired = 0x04, // PEP_ct_key_expired = 0x04,
   4.176 -    PEPCtKeyRevoked = 0x05, // PEP_ct_key_revoked = 0x05,
   4.177 -    PEPCtKeyBr0ken = 0x06, // PEP_ct_key_b0rken = 0x06,
   4.178 -    PEPCtKeyExpiredButConfirmed = 0x07, // PEP_ct_key_expired_but_confirmed = 0x07, // NOT with confirmed bit. Just retaining info here in case of renewal.
   4.179 -    PEPCtMyKeyNotIncluded = 0x09, // PEP_ct_my_key_not_included = 0x09,
   4.180 -
   4.181 -    PEPCtSecurityByObscurity = 0x0a, // PEP_ct_security_by_obscurity = 0x0a,
   4.182 -    PEPCtBr0kenCrypto = 0x0b, // PEP_ct_b0rken_crypto = 0x0b,
   4.183 -    PEPCtKeyTooShort = 0x0c, // PEP_ct_key_too_short = 0x0c,
   4.184 -
   4.185 -    PEPCtCompromised = 0x0e, // PEP_ct_compromized = 0x0e,                  // deprecated misspelling
   4.186 -    PEPCtMistrusted = 0x0f, // PEP_ct_mistrusted = 0x0f,                   // known mistrusted key
   4.187 -
   4.188 -    // range 0x10 to 0x3f: unconfirmed encryption
   4.189 -
   4.190 -    PEPCtUnconfirmedEncryption = 0x10, // PEP_ct_unconfirmed_encryption = 0x10,       // generic
   4.191 -    PEPCtOpenPGPWeakUnconfirmed = 0x11, // PEP_ct_OpenPGP_weak_unconfirmed = 0x11,     // RSA 1024 is weak
   4.192 -
   4.193 -    PEPCtToBeChecked = 0x20, // PEP_ct_to_be_checked = 0x20,                // generic
   4.194 -    PEPCtSMIMEUnconfirmed = 0x21, // PEP_ct_SMIME_unconfirmed = 0x21,
   4.195 -    PEPCtCMSUnconfirmed = 0x22, // PEP_ct_CMS_unconfirmed = 0x22,
   4.196 -
   4.197 -    PEPCtStongButUnconfirmed = 0x30, // PEP_ct_strong_but_unconfirmed = 0x30,       // generic
   4.198 -    PEPCtOpenPGPUnconfirmed = 0x38, // PEP_ct_OpenPGP_unconfirmed = 0x38,          // key at least 2048 bit RSA or EC
   4.199 -    PEPCtOTRUnconfirmed = 0x3a, // PEP_ct_OTR_unconfirmed = 0x3a,
   4.200 -
   4.201 -    // range 0x40 to 0x7f: unconfirmed encryption and anonymization
   4.202 -
   4.203 -    PEPCtUnconfirmedEncAnon = 0x40, // PEP_ct_unconfirmed_enc_anon = 0x40,         // generic
   4.204 -    PEPCtPEPUnconfirmed = 0x7f, // PEP_ct_pEp_unconfirmed = 0x7f,
   4.205 -
   4.206 -    PEPCtConfirmed = 0x80, // PEP_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
   4.207 -
   4.208 -    // range 0x81 to 0x8f: reserved
   4.209 -    // range 0x90 to 0xbf: confirmed encryption
   4.210 -
   4.211 -    PEPCtConfirmedEncryption = 0x90, // PEP_ct_confirmed_encryption = 0x90,         // generic
   4.212 -    PEPCtOpenPGPWeak = 0x91, // PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak (unused)
   4.213 -
   4.214 -    PEPCtToBeCheckedConfirmed = 0xa0, // PEP_ct_to_be_checked_confirmed = 0xa0,      // generic
   4.215 -    PEPCtSMIME = 0xa1, // PEP_ct_SMIME = 0xa1,
   4.216 -    PEPCtCMS = 0xa2, // PEP_ct_CMS = 0xa2,
   4.217 -
   4.218 -    PEPCtStongEncryption = 0xb0, // PEP_ct_strong_encryption = 0xb0,            // generic
   4.219 -    PEPCtOpenPGP = 0xb8, // PEP_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
   4.220 -    PEPCtOTR = 0xba, // PEP_ct_OTR = 0xba,
   4.221 -
   4.222 -    // range 0xc0 to 0xff: confirmed encryption and anonymization
   4.223 -
   4.224 -    PEPCtConfirmedEncAnon = 0xc0, // PEP_ct_confirmed_enc_anon = 0xc0,           // generic
   4.225 -    PEPCtPEP = 0xff // PEP_ct_pEp = 0xff
   4.226 -} PEPCommType;
   4.227 -
   4.228 -typedef enum _ObjC_PEP_msg_direction {
   4.229 -    PEPDirIncoming = 0,
   4.230 -    PEPDirOutgoing
   4.231 -} PEPMsgDirection;
   4.232 -
   4.233 -#endif /* PEPTypes_h */