COM-67: Adapters: Implement wrapper around undo_last_mistrust() in default
authorMarkus Schaber <markus@pep-security.net>
Fri, 01 Dec 2017 19:38:09 +0100
changeset 264aa6bd84bd6c3
parent 262 c599247b93b3
child 265 d13ae58b6862
child 267 ae02fcd56811
child 268 4d41410af9a0
child 275 08f4040eca91
COM-67: Adapters: Implement wrapper around undo_last_mistrust() in default
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Mon Oct 02 13:01:21 2017 +0200
     1.2 +++ b/CpEpEngine.cpp	Fri Dec 01 19:38:09 2017 +0100
     1.3 @@ -605,6 +605,19 @@
     1.4      return S_OK;
     1.5  }
     1.6  
     1.7 +STDMETHODIMP CpEpEngine::UndoLastMistrust()
     1.8 +{
     1.9 +	PEP_STATUS status = ::undo_last_mistrust(get_session());
    1.10 +
    1.11 +	if (status == PEP_CANNOT_FIND_IDENTITY)
    1.12 +		return FAIL(L"Cannot find identity!", status);
    1.13 +
    1.14 +	if (status != ::PEP_STATUS_OK)
    1.15 +		return FAIL(L"cannot revoke compromized key", status);
    1.16 +
    1.17 +	return S_OK;
    1.18 +}
    1.19 +
    1.20  STDMETHODIMP CpEpEngine::KeyResetTrust(struct pEpIdentity *ident)
    1.21  {
    1.22      ::pEp_identity *_ident;
     2.1 --- a/CpEpEngine.h	Mon Oct 02 13:01:21 2017 +0200
     2.2 +++ b/CpEpEngine.h	Fri Dec 01 19:38:09 2017 +0100
     2.3 @@ -237,6 +237,8 @@
     2.4      // PGP compatibility functions
     2.5      STDMETHOD(OpenPGPListKeyinfo)(BSTR search_pattern, LPSAFEARRAY* keyinfo_list);
     2.6  
     2.7 +	STDMETHOD(UndoLastMistrust)();
     2.8 +
     2.9  protected:
    2.10  	HRESULT Fire_MessageToSend(
    2.11  		/* [in] */ struct TextMessage *msg);
     3.1 --- a/pEpCOMServerAdapter.idl	Mon Oct 02 13:01:21 2017 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Fri Dec 01 19:38:09 2017 +0100
     3.3 @@ -326,6 +326,8 @@
     3.4          [in] pEpRating x_EncStatus, // referring to X-EncStatus mail header
     3.5          [out, retval] pEpRating *rating
     3.6      );
     3.7 +
     3.8 +	HRESULT UndoLastMistrust();
     3.9  };
    3.10  
    3.11  [