pEpCOMServerAdapter.idl
author Markus Schaber <markus@pep-security.net>
Sat, 05 Nov 2016 10:22:14 +0100
changeset 193 896f1ea47f31
parent 190 8d1c4f057dea
child 200 e8368b1b8763
permissions -rw-r--r--
COM-20: Memory leak in CpEpEngine::blacklist_retrieve
vb@0
     1
// pEpCOMServerAdapter.idl : IDL source for pEpCOMServerAdapter
vb@0
     2
//
vb@0
     3
vb@0
     4
// This file will be processed by the MIDL tool to
vb@0
     5
// produce the type library (pEpCOMServerAdapter.tlb) and marshalling code.
vb@0
     6
vb@0
     7
import "oaidl.idl";
vb@0
     8
import "ocidl.idl";
vb@0
     9
markus@84
    10
[
markus@181
    11
    object,
markus@181
    12
    uuid(4DA92647-A858-448E-B01F-BE4DCB8C86A1),
markus@181
    13
    oleautomation,
markus@181
    14
    nonextensible,
markus@181
    15
    pointer_default(unique)
markus@84
    16
]
markus@84
    17
interface IpEpEngineCallbacks : IUnknown {
markus@172
    18
markus@172
    19
    typedef [v1_enum] enum SyncHandshakeResult {
markus@181
    20
        SyncHandshakeCancel = -1,
markus@181
    21
        SyncHandshakeAccepted = 0,
markus@181
    22
        SyncHandshakeRejected = 1
markus@172
    23
    } SyncHandshakeResult;
markus@172
    24
markus@181
    25
    [id(1)] HRESULT MessageToSend([in] struct TextMessage * msg);
markus@181
    26
    [id(2)] HRESULT ShowHandshake([in] struct pEpIdentity * self, [in] struct pEpIdentity * partner, [out, retval] SyncHandshakeResult * result);
markus@84
    27
};
markus@84
    28
markus@84
    29
vb@0
    30
[
vb@0
    31
    object,
markus@172
    32
    uuid(045E49AF-0975-4876-A53B-8CA5AB28C0F8),
vb@0
    33
    oleautomation,
vb@0
    34
    nonextensible,
vb@0
    35
    pointer_default(unique)
vb@0
    36
]
vb@0
    37
interface IpEpEngine : IUnknown {
markus@177
    38
vb@60
    39
    // runtime config of the adapter
vb@60
    40
markus@172
    41
    HRESULT VerboseLogging([in] VARIANT_BOOL enable);
vb@51
    42
vb@60
    43
    // runtime config of the engine
vb@60
    44
markus@172
    45
    HRESULT PassiveMode([in] VARIANT_BOOL enable);
markus@172
    46
    HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
vb@60
    47
vb@60
    48
    // basic API
vb@60
    49
Dean@184
    50
    HRESULT ExportKey([in] BSTR fpr, [out, retval] BSTR * keyData);
markus@177
    51
    HRESULT Log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
markus@177
    52
    HRESULT TrustWords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG maxWords, [out, retval] BSTR * words);
markus@190
    53
    HRESULT GetTrustWords([in] struct pEpIdentity * id1, [in] struct pEpIdentity * id2, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] VARIANT_BOOL full, [out, retval] BSTR * words);
markus@172
    54
    HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
markus@177
    55
    HRESULT GetEngineVersion([out, retval] BSTR * engineVersion);
markus@177
    56
    HRESULT GetLanguageList([out, retval] BSTR * languages);
vb@0
    57
markus@172
    58
    typedef [v1_enum] enum pEpComType {
markus@172
    59
        pEpCtUnknown = 0,
vb@0
    60
vb@0
    61
        // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
vb@0
    62
markus@172
    63
        pEpCtNoEncryption = 0x01,                // generic
markus@172
    64
        pEpCtNoEncryptedChannel = 0x02,
markus@172
    65
        pEpCtKeyNotFound = 0x03,
markus@172
    66
        pEpCtKeyExpired = 0x04,
markus@172
    67
        pEpCtKeyRevoked = 0x05,
markus@172
    68
        pEpCtKeyB0rken = 0x06,
markus@172
    69
        pEpCtMyKeyNotIncluded = 0x09,
vb@0
    70
markus@172
    71
        pEpCtSecurityByObscurity = 0x0a,
markus@172
    72
        pEpCtB0rkenCrypto = 0x0b,
markus@172
    73
        pEpCtKeyTooShort = 0x0c,
vb@0
    74
Dean@174
    75
        pEpCtCompromised = 0x0e,                 // known compromized connection
Dean@174
    76
        pEpCtMistrusted = 0x0f,                  // known mistrusted key
vb@0
    77
vb@0
    78
        // range 0x10 to 0x3f: unconfirmed encryption
vb@0
    79
markus@172
    80
        pEpCtUnconfirmedEncryption = 0x10,       // generic
Dean@174
    81
        pEpCtOpenPGPWeakUnconfirmed = 0x11,      // RSA 1024 is weak
vb@62
    82
Dean@174
    83
        pEpCtToBeChecked = 0x20,                 // generic
markus@172
    84
        pEpCtSMIMEUnconfirmed = 0x21,
markus@172
    85
        pEpCtCMSUnconfirmed = 0x22,
vb@62
    86
Dean@174
    87
        pEpCtStrongButUnconfirmed = 0x30,        // generic
markus@172
    88
        pEpCtOpenPGPUnconfirmed = 0x38,          // key at least 2048 bit RSA or EC
markus@172
    89
        pEpCtOTRUnconfirmed = 0x3a,
vb@0
    90
vb@0
    91
        // range 0x40 to 0x7f: unconfirmed encryption and anonymization
vb@0
    92
Dean@174
    93
        pEpCtUnconfirmedEncAnon = 0x40,          // generic
markus@172
    94
        pEpCtpEpUnconfirmed = 0x7f,
vb@0
    95
Dean@174
    96
        pEpCtConfirmed = 0x80,                   // this bit decides if trust is confirmed
vb@0
    97
vb@0
    98
        // range 0x81 to 0x8f: reserved
vb@0
    99
        // range 0x90 to 0xbf: confirmed encryption
vb@0
   100
markus@172
   101
        pEpCtConfirmedEncryption = 0x90,         // generic
markus@172
   102
        pEpCtOpenPGPWeak = 0x91,                 // RSA 1024 is weak
vb@62
   103
Dean@174
   104
        pEpCtToBeCheckedConfirmed = 0xa0,        // generic
markus@172
   105
        pEpCtSMIME = 0xa1,
markus@172
   106
        pEpCtCMS = 0xa2,
vb@62
   107
markus@172
   108
        pEpCtStrongEncryption = 0xb0,            // generic
Dean@174
   109
        pEpCtOpenPGP = 0xb8,                     // key at least 2048 bit RSA or EC
markus@172
   110
        pEpCtOTR = 0xba,
vb@0
   111
vb@0
   112
        // range 0xc0 to 0xff: confirmed encryption and anonymization
vb@0
   113
Dean@174
   114
        pEpCtConfirmedEncAnon = 0xc0,            // generic
markus@172
   115
        pEpCtpEp = 0xff
markus@172
   116
    } pEpComType;
vb@0
   117
markus@181
   118
    [uuid(C3A3814E-567F-4D1C-9F44-9B1DA3957A89)] struct pEpIdentity {
markus@180
   119
        BSTR Address;
markus@180
   120
        BSTR Fpr;
markus@180
   121
        BSTR UserId;
markus@180
   122
        BSTR UserName;
markus@180
   123
        pEpComType CommType;
markus@180
   124
        BSTR Lang;
vb@0
   125
    };
markus@181
   126
markus@177
   127
    // Keymanagement API
Dean@183
   128
markus@172
   129
    HRESULT StartKeyserverLookup();
markus@172
   130
    HRESULT StopKeyserverLookup();
vb@24
   131
markus@172
   132
    HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@172
   133
    HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@172
   134
    HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
markus@172
   135
    HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
markus@172
   136
    HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
vb@4
   137
vb@65
   138
    // Blacklist API
vb@65
   139
markus@172
   140
    HRESULT BlacklistAdd([in] BSTR fpr);
markus@172
   141
    HRESULT BlacklistDelete([in] BSTR fpr);
markus@172
   142
    HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
Dean@187
   143
    HRESULT BlacklistRetrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
vb@65
   144
markus@181
   145
    // PGP compatibility functions
Dean@174
   146
markus@181
   147
    HRESULT OpenPGPListKeyinfo([in] BSTR searchPattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfoList);
krista@157
   148
vb@15
   149
    // Message API
vb@12
   150
markus@181
   151
    typedef [v1_enum] enum pEpRating {
markus@181
   152
        pEpRatingUndefined = 0,
markus@181
   153
        pEpRatingCannotDecrypt,
markus@181
   154
        pEpRatingHaveNoKey,
markus@181
   155
        pEpRatingUnencrypted,
markus@181
   156
        pEpRatingUnencryptedForSome,
markus@181
   157
        pEpRatingUnreliable,
markus@181
   158
        pEpRatingReliable,
markus@181
   159
        pEpRatingTrusted,
markus@181
   160
        pEpRatingTrustedAndAnonymized,
markus@181
   161
        pEpRatingFullyAnonymous,
markus@166
   162
markus@181
   163
        pEpRatingMistrust = -1,
markus@181
   164
        pEpRatingB0rken = -2,
markus@181
   165
        pEpRatingUnderAttack = -3
markus@181
   166
    } pEpRating;
markus@166
   167
markus@181
   168
    typedef [v1_enum] enum pEpColor {
markus@181
   169
        pEpColorNoColor = 0,
markus@181
   170
        pEpColorYellow,
markus@181
   171
        pEpColorGreen,
markus@181
   172
        pEpColorRed = -1,
markus@181
   173
    } pEpColor;
vb@33
   174
markus@181
   175
    typedef [v1_enum] enum pEpEncryptFlags {
markus@181
   176
        pEpEncryptFlagsNone = 0,
markus@181
   177
        pEpEncryptFlagForceEncryption = 0x1,
markus@181
   178
    } pEpEncryptFlags;
markus@167
   179
markus@181
   180
    typedef [v1_enum] enum pEpDecryptFlags {
markus@181
   181
        pEpDecryptFlagsNone = 0,
markus@181
   182
        pEpDecryptFlagOwnPrivateKey = 0x1
markus@181
   183
    } pEpDecryptFlags;
markus@167
   184
markus@172
   185
    typedef [v1_enum] enum pEpMsgDirection {
markus@172
   186
        pEpDirIncoming = 0,
markus@172
   187
        pEpDirOutgoing
markus@172
   188
    } pEpMsgDirection;
vb@33
   189
markus@181
   190
    [uuid(47FB0795-6B64-455C-BB0E-54998CAB8ACB)] struct StringPair {
markus@180
   191
        BSTR Name;
markus@180
   192
        BSTR Value;
vb@33
   193
    };
vb@33
   194
markus@181
   195
    [uuid(634EB7CE-99AA-460D-BDF8-F7CDA7232CA6)] struct Blob {
vb@33
   196
        SAFEARRAY(BYTE) value;
markus@180
   197
        BSTR MimeType;
markus@180
   198
        BSTR Filename;
vb@33
   199
    };
vb@33
   200
markus@181
   201
    [uuid(B6F40887-E761-4A47-B204-A0193EE0284D)] struct TextMessage {
markus@180
   202
        pEpMsgDirection Dir;
markus@180
   203
        BSTR Id;
markus@182
   204
        BSTR ShortMsg;
markus@182
   205
        BSTR LongMsg;
markus@182
   206
        BSTR LongMsgFormatted;
markus@180
   207
        SAFEARRAY(struct Blob) Attachments;
markus@180
   208
        hyper Sent; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@180
   209
        hyper Recv; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@180
   210
        struct pEpIdentity From;
markus@180
   211
        SAFEARRAY(struct pEpIdentity) To;
markus@180
   212
        struct pEpIdentity RecvBy;
markus@180
   213
        SAFEARRAY(struct pEpIdentity) Cc;
markus@180
   214
        SAFEARRAY(struct pEpIdentity) Bcc;
markus@180
   215
        SAFEARRAY(struct pEpIdentity) ReplyTo;
markus@180
   216
        SAFEARRAY(BSTR) References;
markus@180
   217
        SAFEARRAY(BSTR) Keywords;
markus@180
   218
        BSTR Comments;
markus@180
   219
        SAFEARRAY(struct StringPair) OptFields;
vb@33
   220
    };
vb@33
   221
markus@172
   222
    HRESULT EncryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [in] SAFEARRAY(BSTR) extra, [in, defaultvalue(pEpEncryptFlagsNone)] pEpEncryptFlags flags);
markus@172
   223
    HRESULT DecryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [out] SAFEARRAY(BSTR) *keylist, [out] pEpDecryptFlags* flags, [out, retval] pEpRating *rating);
markus@177
   224
markus@172
   225
    HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
markus@172
   226
    HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
markus@181
   227
    HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
markus@84
   228
markus@177
   229
    // callback / keysync API
markus@181
   230
    HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* newCallback);
markus@188
   231
    HRESULT UnregisterCallbacks();
vb@8
   232
};
vb@4
   233
vb@8
   234
[
markus@172
   235
    uuid(564A4350-419E-47F1-B0DF-6FCCF0CD0BBC),
vb@0
   236
    version(1.0),
vb@0
   237
]
vb@0
   238
library pEpCOMServerAdapterLib
vb@0
   239
{
vb@0
   240
    importlib("stdole2.tlb");
markus@181
   241
vb@0
   242
    [
markus@172
   243
        uuid(5FF6682B-727B-4DFE-A68D-28982874C0C7)
vb@0
   244
    ]
vb@0
   245
    coclass pEpEngine {
vb@0
   246
        [default] interface IpEpEngine;
markus@188
   247
        interface IpEpEngineCallbacks;
vb@0
   248
    };
vb@0
   249
};