COM-74: Expose _PEP_enc_format to app for EncryptMessage COM-74
authorMarkus Schaber <markus@pep-security.net>
Wed, 07 Feb 2018 19:33:59 +0100
branchCOM-74
changeset 27192866cd8b0c4
parent 270 c713a265866f
child 272 0cd9b4cde17c
COM-74: Expose _PEP_enc_format to app for EncryptMessage

- Interface cleanup: Unify 2nd generation interfaces back to a single one.
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Wed Feb 07 18:53:25 2018 +0100
     1.2 +++ b/CpEpEngine.cpp	Wed Feb 07 19:33:59 2018 +0100
     1.3 @@ -15,7 +15,6 @@
     1.4      static const IID* const arr[] =
     1.5      {
     1.6          &IID_IpEpEngine,
     1.7 -        &IID_IpEpEngine2,
     1.8      };
     1.9  
    1.10      for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
    1.11 @@ -606,15 +605,15 @@
    1.12  
    1.13  STDMETHODIMP CpEpEngine::UndoLastMistrust()
    1.14  {
    1.15 -	PEP_STATUS status = ::undo_last_mistrust(get_session());
    1.16 +    PEP_STATUS status = ::undo_last_mistrust(get_session());
    1.17  
    1.18 -	if (status == PEP_CANNOT_FIND_IDENTITY)
    1.19 -		return FAIL(L"Cannot find identity!", status);
    1.20 +    if (status == PEP_CANNOT_FIND_IDENTITY)
    1.21 +        return FAIL(L"Cannot find identity!", status);
    1.22  
    1.23 -	if (status != ::PEP_STATUS_OK)
    1.24 -		return FAIL(L"cannot revoke compromized key", status);
    1.25 +    if (status != ::PEP_STATUS_OK)
    1.26 +        return FAIL(L"cannot revoke compromized key", status);
    1.27  
    1.28 -	return S_OK;
    1.29 +    return S_OK;
    1.30  }
    1.31  
    1.32  STDMETHODIMP CpEpEngine::KeyResetTrust(struct pEpIdentity *ident)
    1.33 @@ -828,12 +827,7 @@
    1.34      return E_FAIL;
    1.35  }
    1.36  
    1.37 -STDMETHODIMP CpEpEngine::EncryptMessage(TextMessage * src, TextMessage * dst, SAFEARRAY * extra, pEpEncryptFlags flags)
    1.38 -{
    1.39 -	return EncryptMessage2(src, dst, extra, flags, pEpEncPep);
    1.40 -}
    1.41 -
    1.42 -STDMETHODIMP CpEpEngine::EncryptMessage2(TextMessage * src, TextMessage * dst, SAFEARRAY * extra, pEpEncryptFlags flags, pEpEncFormat encFormat)
    1.43 +STDMETHODIMP CpEpEngine::EncryptMessage(TextMessage * src, TextMessage * dst, SAFEARRAY * extra, pEpEncryptFlags flags, pEpEncFormat encFormat)
    1.44  {
    1.45      assert(src);
    1.46      assert(dst);
    1.47 @@ -843,7 +837,7 @@
    1.48  
    1.49      ::message *_src = text_message_to_C(src);
    1.50  
    1.51 -	_PEP_enc_format _encFormat = (_PEP_enc_format)encFormat;
    1.52 +    _PEP_enc_format _encFormat = (_PEP_enc_format)encFormat;
    1.53  
    1.54      // COM-19: Initialize msg_dst to NULL, or we end up calling
    1.55      // free_message() below with a pointer to random garbage in
    1.56 @@ -853,7 +847,7 @@
    1.57  
    1.58      // _PEP_enc_format used to be intentionally hardcoded to PEP_enc_PEP:
    1.59      // Since COM-74, this has been changed to an explicit parameter, to allow the engine to attach
    1.60 -	// the keys and headers to outgoing, unencrypted messages.
    1.61 +    // the keys and headers to outgoing, unencrypted messages.
    1.62      PEP_encrypt_flags_t engineFlags = (PEP_encrypt_flags_t)flags;
    1.63      PEP_STATUS status = ::encrypt_message(get_session(), _src, _extra, &msg_dst, _encFormat, engineFlags);
    1.64      ::free_stringlist(_extra);
    1.65 @@ -1165,12 +1159,12 @@
    1.66      keysync_abort_requested = false;
    1.67  
    1.68      // Init our keysync session
    1.69 -	{ // begin lock scope
    1.70 -		std::lock_guard<std::mutex> lock(init_mutex);
    1.71 -		PEP_STATUS status = ::init(&keysync_session);
    1.72 -		::register_sync_callbacks(keysync_session, (void*)this, messageToSend, notifyHandshake, inject_sync_msg, retrieve_next_sync_msg);
    1.73 -		assert(status == PEP_STATUS_OK);
    1.74 -	} // end lock scope
    1.75 +    { // begin lock scope
    1.76 +        std::lock_guard<std::mutex> lock(init_mutex);
    1.77 +        PEP_STATUS status = ::init(&keysync_session);
    1.78 +        ::register_sync_callbacks(keysync_session, (void*)this, messageToSend, notifyHandshake, inject_sync_msg, retrieve_next_sync_msg);
    1.79 +        assert(status == PEP_STATUS_OK);
    1.80 +    } // end lock scope
    1.81  
    1.82      attach_sync_session(get_session(), keysync_session);
    1.83  
    1.84 @@ -1203,21 +1197,12 @@
    1.85      self->client_last_signalled_polling_state = false;
    1.86      self->client_callbacks_on_sync_thread = static_cast<IpEpEngineCallbacks*>(vp);
    1.87  
    1.88 -    res = self->client_callbacks_on_sync_thread->QueryInterface(
    1.89 -        &self->client_callbacks2_on_sync_thread);
    1.90 -    if (res != S_OK)
    1.91 -        self->client_callbacks2_on_sync_thread = NULL;
    1.92 -
    1.93      ::do_sync_protocol(self->keysync_session, self);
    1.94  
    1.95      self->client_callbacks_on_sync_thread->Release();
    1.96  
    1.97      self->client_callbacks_on_sync_thread = NULL;
    1.98  
    1.99 -    if (self->client_callbacks2_on_sync_thread)
   1.100 -        self->client_callbacks2_on_sync_thread->Release();
   1.101 -    self->client_callbacks2_on_sync_thread = NULL;
   1.102 -
   1.103      CoUninitialize();
   1.104  }
   1.105  
   1.106 @@ -1251,7 +1236,7 @@
   1.107      ::detach_sync_session(get_session());
   1.108      ::unregister_sync_callbacks(keysync_session);
   1.109  
   1.110 -	std::lock_guard<std::mutex> releaselock(init_mutex);
   1.111 +    std::lock_guard<std::mutex> releaselock(init_mutex);
   1.112      release(keysync_session);
   1.113      keysync_session = NULL;
   1.114  }
   1.115 @@ -1294,17 +1279,17 @@
   1.116      CpEpEngine* me = (CpEpEngine*)management;
   1.117  
   1.118      if ((timeout && *timeout)
   1.119 -        && me->client_callbacks2_on_sync_thread
   1.120 +        && me->client_callbacks_on_sync_thread
   1.121          && me->client_last_signalled_polling_state == false)
   1.122      {
   1.123 -        me->client_callbacks2_on_sync_thread->NeedFastPolling(VARIANT_TRUE);
   1.124 +        me->client_callbacks_on_sync_thread->NeedFastPolling(VARIANT_TRUE);
   1.125          me->client_last_signalled_polling_state = true;
   1.126      }
   1.127      else if (!(timeout && *timeout)
   1.128 -        && me->client_callbacks2_on_sync_thread
   1.129 +        && me->client_callbacks_on_sync_thread
   1.130          && me->client_last_signalled_polling_state == true)
   1.131      {
   1.132 -        me->client_callbacks2_on_sync_thread->NeedFastPolling(VARIANT_FALSE);
   1.133 +        me->client_callbacks_on_sync_thread->NeedFastPolling(VARIANT_FALSE);
   1.134          me->client_last_signalled_polling_state = false;
   1.135      }
   1.136  
     2.1 --- a/CpEpEngine.h	Wed Feb 07 18:53:25 2018 +0100
     2.2 +++ b/CpEpEngine.h	Wed Feb 07 19:33:59 2018 +0100
     2.3 @@ -24,7 +24,7 @@
     2.4      public CComObjectRootEx<CComObjectThreadModel>,
     2.5      public CComCoClass<CpEpEngine, &CLSID_pEpEngine>,
     2.6      public ISupportErrorInfo,
     2.7 -    public IpEpEngine2
     2.8 +    public IpEpEngine
     2.9  {
    2.10  
    2.11  protected:
    2.12 @@ -56,7 +56,6 @@
    2.13  
    2.14  BEGIN_COM_MAP(CpEpEngine)
    2.15      COM_INTERFACE_ENTRY(IpEpEngine)
    2.16 -    COM_INTERFACE_ENTRY(IpEpEngine2)
    2.17      COM_INTERFACE_ENTRY(ISupportErrorInfo)
    2.18  END_COM_MAP()
    2.19  
    2.20 @@ -133,7 +132,6 @@
    2.21  
    2.22      IpEpEngineCallbacks* client_callbacks = NULL;
    2.23      IpEpEngineCallbacks* client_callbacks_on_sync_thread = NULL;
    2.24 -    IpEpEngineCallbacks2* client_callbacks2_on_sync_thread = NULL;
    2.25      bool client_last_signalled_polling_state = true;
    2.26  
    2.27      // Keysync members
    2.28 @@ -215,7 +213,13 @@
    2.29  
    2.30      // Message API
    2.31  
    2.32 -    STDMETHOD(EncryptMessage)(TextMessage * src, TextMessage * dst, SAFEARRAY * extra, pEpEncryptFlags flags);
    2.33 +    STDMETHOD(EncryptMessage)(
    2.34 +        /* [in] */ struct TextMessage *src,
    2.35 +        /* [out] */ struct TextMessage *dst,
    2.36 +        /* [in] */ SAFEARRAY * extra,
    2.37 +        /* [defaultvalue][in] */ pEpEncryptFlags flags = pEpEncryptFlagDefault,
    2.38 +        /* [defaultvalue][in] */ pEpEncFormat encFormat = pEpEncPep);
    2.39 +
    2.40      STDMETHOD(DecryptMessage)(TextMessage * src, TextMessage * dst, SAFEARRAY ** keylist, pEpDecryptFlags* flags, pEpRating *rating);
    2.41      STDMETHOD(ReEvaluateMessageRating)(TextMessage * msg, SAFEARRAY * x_KeyList, pEpRating x_EncStatus, pEpRating *rating);
    2.42      STDMETHOD(OutgoingMessageRating)(TextMessage *msg, pEpRating * pVal);
    2.43 @@ -229,13 +233,6 @@
    2.44          pEpEncryptFlags flags
    2.45          );
    2.46  
    2.47 -    STDMETHOD(EncryptMessage2)(
    2.48 -        /* [in] */ struct TextMessage *src,
    2.49 -        /* [out] */ struct TextMessage *dst,
    2.50 -        /* [in] */ SAFEARRAY * extra,
    2.51 -        /* [defaultvalue][in] */ pEpEncryptFlags flags = pEpEncryptFlagDefault,
    2.52 -        /* [defaultvalue][in] */ pEpEncFormat encFormat = pEpEncPep);
    2.53 -
    2.54      // Event callbacks
    2.55  
    2.56      STDMETHOD(RegisterCallbacks)(IpEpEngineCallbacks *new_callback);
     3.1 --- a/pEpCOMServerAdapter.idl	Wed Feb 07 18:53:25 2018 +0100
     3.2 +++ b/pEpCOMServerAdapter.idl	Wed Feb 07 19:33:59 2018 +0100
     3.3 @@ -43,18 +43,9 @@
     3.4      } SyncHandshakeResult;
     3.5  
     3.6      [id(1)] HRESULT MessageToSend([in] struct TextMessage * msg);
     3.7 +
     3.8      [id(2)] HRESULT NotifyHandshake([in] struct pEpIdentity * self, [in] struct pEpIdentity * partner, [in] SyncHandshakeSignal signal, [out, retval] SyncHandshakeResult * result);
     3.9 -};
    3.10  
    3.11 -[
    3.12 -    object,
    3.13 -    uuid(64E964B2-880A-4E92-B0B5-66FF4286A3B3),
    3.14 -    oleautomation,
    3.15 -    nonextensible,
    3.16 -    pointer_default(unique)
    3.17 -]
    3.18 -interface IpEpEngineCallbacks2 : IpEpEngineCallbacks 
    3.19 -{
    3.20      [id(3)] HRESULT NeedFastPolling([in] VARIANT_BOOL enableFastPolling);
    3.21  };
    3.22  
    3.23 @@ -69,22 +60,22 @@
    3.24  
    3.25      // runtime config of the adapter
    3.26  
    3.27 -    HRESULT VerboseLogging([in] VARIANT_BOOL enable);
    3.28 +    [id(1)] HRESULT VerboseLogging([in] VARIANT_BOOL enable);
    3.29  
    3.30      // runtime config of the engine
    3.31  
    3.32 -    HRESULT PassiveMode([in] VARIANT_BOOL enable);
    3.33 -    HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
    3.34 +    [id(2)] HRESULT PassiveMode([in] VARIANT_BOOL enable);
    3.35 +    [id(3)] HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
    3.36  
    3.37      // basic API
    3.38  
    3.39 -    HRESULT ExportKey([in] BSTR fpr, [out, retval] BSTR * keyData);
    3.40 -    HRESULT Log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
    3.41 -    HRESULT Trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG maxWords, [out, retval] BSTR * words);
    3.42 -    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);
    3.43 -    HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
    3.44 -    HRESULT GetEngineVersion([out, retval] BSTR * engineVersion);
    3.45 -    HRESULT GetLanguageList([out, retval] BSTR * languages);
    3.46 +    [id(4)] HRESULT ExportKey([in] BSTR fpr, [out, retval] BSTR * keyData);
    3.47 +    [id(5)] HRESULT Log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
    3.48 +    [id(6)] HRESULT Trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG maxWords, [out, retval] BSTR * words);
    3.49 +    [id(7)] 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);
    3.50 +    [id(8)] HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
    3.51 +    [id(9)] HRESULT GetEngineVersion([out, retval] BSTR * engineVersion);
    3.52 +    [id(10)] HRESULT GetLanguageList([out, retval] BSTR * languages);
    3.53  
    3.54      typedef [v1_enum] enum pEpComType {
    3.55          pEpCtUnknown = 0,
    3.56 @@ -163,31 +154,32 @@
    3.57          pEpIdentityFlags Flags;
    3.58      };
    3.59  
    3.60 -    HRESULT SetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
    3.61 -    HRESULT UnsetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
    3.62 +    [id(11)] HRESULT SetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
    3.63 +    [id(12)] HRESULT UnsetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
    3.64  
    3.65      // Keymanagement API
    3.66  
    3.67 -    HRESULT StartKeyserverLookup();
    3.68 -    HRESULT StopKeyserverLookup();
    3.69 +    [id(13)] HRESULT StartKeyserverLookup();
    3.70 +    [id(14)] HRESULT StopKeyserverLookup();
    3.71  
    3.72 -    HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
    3.73 -    HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
    3.74 -    HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
    3.75 -    HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
    3.76 -    HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
    3.77 -    HRESULT OwnIdentitiesRetrieve([out, retval] SAFEARRAY(struct pEpIdentity)* ownIdentities);
    3.78 +    [id(15)] HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
    3.79 +    [id(16)] HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
    3.80 +    [id(17)] HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
    3.81 +    [id(18)] HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
    3.82 +    [id(19)] HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
    3.83 +    [id(20)] HRESULT OwnIdentitiesRetrieve([out, retval] SAFEARRAY(struct pEpIdentity)* ownIdentities);
    3.84 +    [id(21)] HRESULT UndoLastMistrust();
    3.85  
    3.86      // Blacklist API
    3.87  
    3.88 -    HRESULT BlacklistAdd([in] BSTR fpr);
    3.89 -    HRESULT BlacklistDelete([in] BSTR fpr);
    3.90 -    HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
    3.91 -    HRESULT BlacklistRetrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
    3.92 +    [id(22)] HRESULT BlacklistAdd([in] BSTR fpr);
    3.93 +    [id(23)] HRESULT BlacklistDelete([in] BSTR fpr);
    3.94 +    [id(24)] HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
    3.95 +    [id(25)] HRESULT BlacklistRetrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
    3.96  
    3.97      // PGP compatibility functions
    3.98  
    3.99 -    HRESULT OpenPGPListKeyinfo([in] BSTR searchPattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfoList);
   3.100 +    [id(26)] HRESULT OpenPGPListKeyinfo([in] BSTR searchPattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfoList);
   3.101  
   3.102      // Message API
   3.103  
   3.104 @@ -241,6 +233,15 @@
   3.105          pEpDirOutgoing
   3.106      } pEpMsgDirection;
   3.107  
   3.108 +    typedef [v1_enum] enum pEpEncFormat {
   3.109 +        pEpEncNone = 0,                       // message is not encrypted
   3.110 +        pEpEncPieces,                         // inline PGP + PGP extensions
   3.111 +        pEpEncSMime,                          // RFC5751
   3.112 +        pEpEncPgpMime,                        // RFC3156
   3.113 +        pEpEncPep,                            // pEp encryption format
   3.114 +        pEpEncPgpMimeOutlook1                 // Message B0rken by Outlook type 1
   3.115 +    } pEpEncFormat;
   3.116 +
   3.117      [uuid(47FB0795-6B64-455C-BB0E-54998CAB8ACB)] struct StringPair {
   3.118          BSTR Name;
   3.119          BSTR Value;
   3.120 @@ -273,47 +274,28 @@
   3.121          SAFEARRAY(struct StringPair) OptFields;
   3.122      };
   3.123  
   3.124 -    HRESULT EncryptMessage(
   3.125 +    [id(27)] HRESULT EncryptMessage(
   3.126          [in] struct TextMessage *src,
   3.127          [out] struct TextMessage * dst,
   3.128          [in] SAFEARRAY(BSTR) extra,
   3.129 -        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags);
   3.130 +        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags,
   3.131 +        // Use pEpEncFormat.pEpEncNone for unencrypted, outgoing messages.
   3.132 +        // Default is pEpEncFormat.pEpEncPep, all other formats are only 
   3.133 +        // for compatibility and not intended for normal use.
   3.134 +        [in, defaultvalue(pEpEncPep)] pEpEncFormat encFormat);
   3.135  
   3.136 -    HRESULT DecryptMessage(
   3.137 +    [id(28)] HRESULT DecryptMessage(
   3.138          [in] struct TextMessage *src,
   3.139          [out] struct TextMessage * dst,
   3.140          [out] SAFEARRAY(BSTR) *keylist,
   3.141          [out] pEpDecryptFlags* flags,
   3.142          [out, retval] pEpRating *rating);
   3.143  
   3.144 -    HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
   3.145 -    HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
   3.146 -    HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
   3.147 +    [id(29)] HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
   3.148 +    [id(30)] HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
   3.149 +    [id(31)] HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
   3.150  
   3.151 -    // callback / keysync API
   3.152 -    HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* newCallback);
   3.153 -    HRESULT UnregisterCallbacks();
   3.154 -};
   3.155 -
   3.156 -[
   3.157 -    object,
   3.158 -    uuid(8A042123-D433-4DEA-ADA2-2E5E61A00292),
   3.159 -    oleautomation,
   3.160 -    nonextensible,
   3.161 -    pointer_default(unique)
   3.162 -]
   3.163 -interface IpEpEngine2 : IpEpEngine
   3.164 -{
   3.165 -    typedef [v1_enum] enum pEpEncFormat {
   3.166 -        pEpEncNone = 0,                       // message is not encrypted
   3.167 -        pEpEncPieces,                         // inline PGP + PGP extensions
   3.168 -        pEpEncSMime,                          // RFC5751
   3.169 -        pEpEncPgpMime,                        // RFC3156
   3.170 -        pEpEncPep,                            // pEp encryption format
   3.171 -        pEpEncPgpMimeOutlook1                 // Message B0rken by Outlook type 1
   3.172 -    } pEpEncFormat;
   3.173 -
   3.174 -    HRESULT GetMessageTrustwords(
   3.175 +    [id(32)] HRESULT GetMessageTrustwords(
   3.176          [in] struct TextMessage *msg,
   3.177          [in] struct pEpIdentity * receivedBy,
   3.178          [in] SAFEARRAY(BSTR) keylist,
   3.179 @@ -322,31 +304,23 @@
   3.180          [out, retval] BSTR * words
   3.181      );
   3.182  
   3.183 -    HRESULT EncryptMessageForSelf(
   3.184 +    [id(33)] HRESULT EncryptMessageForSelf(
   3.185          [in] struct pEpIdentity* targetId,
   3.186 -        [in] struct TextMessage* src, 
   3.187 +        [in] struct TextMessage* src,
   3.188          [out] struct TextMessage* dst,
   3.189          [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags
   3.190      );
   3.191  
   3.192 -    HRESULT ReEvaluateMessageRating(
   3.193 +    [id(34)] HRESULT ReEvaluateMessageRating(
   3.194          [in] struct TextMessage *src,
   3.195          [in] SAFEARRAY(BSTR) x_KeyList, // referring to X-KeyList mail header
   3.196          [in] pEpRating x_EncStatus, // referring to X-EncStatus mail header
   3.197          [out, retval] pEpRating *rating
   3.198      );
   3.199  
   3.200 -    HRESULT UndoLastMistrust();
   3.201 -
   3.202 -    HRESULT EncryptMessage2(
   3.203 -        [in] struct TextMessage *src,
   3.204 -        [out] struct TextMessage * dst,
   3.205 -        [in] SAFEARRAY(BSTR) extra,
   3.206 -        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags,
   3.207 -        // Use pEpEncFormat.pEpEncNone for unencrypted, outgoing messages.
   3.208 -        // Default is pEpEncFormat.pEpEncPep, all other formats are only 
   3.209 -        // for compatibility and not intended for normal use.
   3.210 -        [in, defaultvalue(pEpEncPep)] pEpEncFormat encFormat);
   3.211 +    // callback / keysync API
   3.212 +    [id(35)] HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* newCallback);
   3.213 +    [id(36)] HRESULT UnregisterCallbacks();
   3.214  };
   3.215  
   3.216  [
   3.217 @@ -361,8 +335,7 @@
   3.218          uuid(5FF6682B-727B-4DFE-A68D-28982874C0C7)
   3.219      ]
   3.220      coclass pEpEngine {
   3.221 -        [default] interface IpEpEngine2;
   3.222 -        interface IpEpEngine;
   3.223 -        interface IpEpEngineCallbacks2;
   3.224 +        [default] interface IpEpEngine;
   3.225 +        interface IpEpEngineCallbacks;
   3.226      };
   3.227  };