reflections on trusting trust
authorVolker Birk <vb@pep-project.org>
Sat, 03 Oct 2015 13:39:04 +0200
changeset 502b496f97e75a
parent 49 6bb2268f58c3
child 51 9c68434e7745
reflections on trusting trust
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Mon Sep 28 15:13:37 2015 +0200
     1.2 +++ b/CpEpEngine.cpp	Sat Oct 03 13:39:04 2015 +0200
     1.3 @@ -973,11 +973,12 @@
     1.4      return S_OK;
     1.5  }
     1.6  
     1.7 -STDMETHODIMP CpEpEngine::trust_personal_key(struct pEp_identity_s *ident)
     1.8 +STDMETHODIMP CpEpEngine::trust_personal_key(struct pEp_identity_s *ident, struct pEp_identity_s *result)
     1.9  {
    1.10      ::pEp_identity *_ident;
    1.11  
    1.12      assert(ident);
    1.13 +    assert(result);
    1.14  
    1.15      try {
    1.16          _ident = new_identity(ident);
    1.17 @@ -990,6 +991,9 @@
    1.18      }
    1.19  
    1.20      PEP_STATUS status = ::trust_personal_key(get_session(), _ident);
    1.21 +    if (status == PEP_STATUS_OK)
    1.22 +        copy_identity(result, _ident);
    1.23 +
    1.24      free_identity(_ident);
    1.25      if (status == PEP_OUT_OF_MEMORY)
    1.26          return E_OUTOFMEMORY;
     2.1 --- a/CpEpEngine.h	Mon Sep 28 15:13:37 2015 +0200
     2.2 +++ b/CpEpEngine.h	Sat Oct 03 13:39:04 2015 +0200
     2.3 @@ -144,7 +144,7 @@
     2.4      STDMETHOD(myself)(struct pEp_identity_s *ident, struct pEp_identity_s *result);
     2.5      STDMETHOD(update_identity)(struct pEp_identity_s *ident, struct pEp_identity_s *result);
     2.6      STDMETHOD(key_compromized)(struct pEp_identity_s *ident);
     2.7 -    STDMETHOD(trust_personal_key)(struct pEp_identity_s *ident);
     2.8 +    STDMETHOD(trust_personal_key)(struct pEp_identity_s *ident, struct pEp_identity_s *result);
     2.9  
    2.10      // Message API
    2.11  
     3.1 --- a/pEpCOMServerAdapter.idl	Mon Sep 28 15:13:37 2015 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Sat Oct 03 13:39:04 2015 +0200
     3.3 @@ -120,7 +120,7 @@
     3.4      HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
     3.5      HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
     3.6      HRESULT key_compromized([in] struct pEp_identity_s *ident);
     3.7 -    HRESULT trust_personal_key([in] struct pEp_identity_s *ident);
     3.8 +    HRESULT trust_personal_key([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
     3.9  
    3.10      // Message API
    3.11