Add a new overload of the encrypt_message funciton which contains the outlook_mime_support
authorMarkus Schaber <markus@pep-security.net>
Sun, 21 Aug 2016 02:01:20 +0200
branchoutlook_mime_support
changeset 150316269fc987e
parent 149 612d5093fe9c
child 155 0264d4b637a4
Add a new overload of the encrypt_message funciton which contains the
pEp_enc_format parameter, this is needed for for the pgp_mime support, as
we need to be able to select the new format.

Using a branch, as the changes need to be analyzed whether they're correct and
really applicable.
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Wed Aug 03 08:32:17 2016 -0700
     1.2 +++ b/CpEpEngine.cpp	Sun Aug 21 02:01:20 2016 +0200
     1.3 @@ -1101,6 +1101,12 @@
     1.4  
     1.5  STDMETHODIMP CpEpEngine::encrypt_message(text_message * src, text_message * dst, SAFEARRAY * extra)
     1.6  {
     1.7 +	// this method is just a backwards compatibility wrapper
     1.8 +	return encrypt_message_ex(src, dst, extra, pEp_enc_pieces);
     1.9 +}
    1.10 +
    1.11 +STDMETHODIMP CpEpEngine::encrypt_message_ex(text_message * src, text_message * dst, SAFEARRAY * extra, pEp_enc_format enc_format)
    1.12 +{
    1.13      assert(src);
    1.14      assert(dst);
    1.15  
    1.16 @@ -1108,7 +1114,10 @@
    1.17      ::message *msg_dst;
    1.18      ::stringlist_t *_extra = new_stringlist(extra);
    1.19  
    1.20 -    PEP_STATUS status = ::encrypt_message(get_session(), _src, _extra, &msg_dst, PEP_enc_pieces);
    1.21 +	// casting this value in a local variable allows for easier debugging.
    1.22 +	PEP_enc_format engine_enc_format = (PEP_enc_format)enc_format;
    1.23 +
    1.24 +    PEP_STATUS status = ::encrypt_message(get_session(), _src, _extra, &msg_dst, engine_enc_format);
    1.25      ::free_stringlist(_extra);
    1.26  
    1.27      if (status == PEP_STATUS_OK)
     2.1 --- a/CpEpEngine.h	Wed Aug 03 08:32:17 2016 -0700
     2.2 +++ b/CpEpEngine.h	Sun Aug 21 02:01:20 2016 +0200
     2.3 @@ -217,7 +217,8 @@
     2.4      // Message API
     2.5  
     2.6      STDMETHOD(encrypt_message)(text_message * src, text_message * dst, SAFEARRAY * extra);
     2.7 -    STDMETHOD(decrypt_message)(text_message * src, text_message * dst, SAFEARRAY ** keylist, pEp_color *rating);
     2.8 +	STDMETHOD(encrypt_message_ex)(text_message * src, text_message * dst, SAFEARRAY * extra, pEp_enc_format enc_format);
     2.9 +	STDMETHOD(decrypt_message)(text_message * src, text_message * dst, SAFEARRAY ** keylist, pEp_color *rating);
    2.10      STDMETHOD(outgoing_message_color)(text_message *msg, pEp_color * pVal);
    2.11      STDMETHOD(identity_color)(pEp_identity_s * ident, pEp_color * pVal);
    2.12  
     3.1 --- a/pEpCOMServerAdapter.idl	Wed Aug 03 08:32:17 2016 -0700
     3.2 +++ b/pEpCOMServerAdapter.idl	Sun Aug 21 02:01:20 2016 +0200
     3.3 @@ -286,6 +286,9 @@
     3.4  	HRESULT register_callbacks([in] IpEpEngineCallbacks* new_callback);
     3.5  
     3.6  	HRESULT unregister_callbacks([in] IpEpEngineCallbacks* obsolete_callback);
     3.7 +
     3.8 +	// new members should be added to the end of this list...
     3.9 +	HRESULT encrypt_message_ex([in] struct text_message *src, [out] struct text_message * dst, [in] SAFEARRAY(BSTR) extra, [in] pEp_enc_format enc_format);
    3.10  };
    3.11  
    3.12  [