Compare commits

...

3 Commits

Author SHA1 Message Date
Luca Saiu 0f12af8aa1 WIP positron-check-signature 2 years ago
Luca Saiu cf645ea15f DEPENDENCIES 2 years ago
Luca Saiu b0ec2af79d DEPENDENCIES 2 years ago
  1. 2
      DEPENDENCIES
  2. 9
      src/pEp/_pEp/message.cc
  3. 2
      src/pEp/_pEp/message.hh
  4. 7
      src/pEp/_pEp/pEpmodule.cc

2
DEPENDENCIES

@ -1,6 +1,6 @@
# 1st Party Dependencies
## Prefer git tags instead of SHA hashes when possible.
pEpEngine=v3.3.0-RC10
pEpEngine=v3.3.0-RC12
libpEpAdapter= v3.2.0-RC5
libpEpCxx=v3.2.0-RC1

9
src/pEp/_pEp/message.cc

@ -344,6 +344,15 @@ namespace pEp {
msg_c->recv_by = new_recv_by_copy_c;
}
void Message::check_signature()
{
::message *msg_c = _msg.get();
PEP_STATUS status = ::check_message_signature(Adapter::session(), msg_c);
if (status == PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH)
throw runtime_error("signature mismatch");
_throw_status(status);
}
Message Message::encrypt()
{
boost::python::list extra;

2
src/pEp/_pEp/message.hh

@ -305,6 +305,8 @@ namespace pEp {
void set_recv_by(Identity &new_recv_by);
void check_signature();
Message encrypt();
Message _encrypt(boost::python::list extra, int enc_format = 4, int flags = 0);

7
src/pEp/_pEp/pEpmodule.cc

@ -559,6 +559,13 @@ namespace pEp {
"field with the given own identity.\n"
"\n"
" identity an own identity, on which myself has been called already\n")
.def("check_signature", &Message::check_signature,
"msg.check_signature()\n"
"\n"
"Fail if the signature in the decrypted message does not match. Do nothing on\n"
"success.\n"
"\n"
" msg a message, already decrypted, at least reliable\n")
.def("encrypt", (Message(Message::*)()) & Message::encrypt)
.def(
"encrypt",

Loading…
Cancel
Save