ENGINE-84: merged in default ENGINE-84
authorKrista Grothoff <krista@pep-project.org>
Tue, 08 Nov 2016 00:12:36 +0100
branchENGINE-84
changeset 1358ff3053a671dc
parent 1357 b1677cd84729
parent 1356 ac3e66355937
child 1359 e63926f8b166
ENGINE-84: merged in default
src/keymanagement.c
test/message_api_test.cc
     1.1 --- a/src/keymanagement.c	Tue Nov 08 00:12:17 2016 +0100
     1.2 +++ b/src/keymanagement.c	Tue Nov 08 00:12:36 2016 +0100
     1.3 @@ -579,6 +579,9 @@
     1.4          }
     1.5      }
     1.6  
     1.7 +    if (!identity->username)
     1.8 +        identity->username = strdup("");
     1.9 +    
    1.10      status = set_identity(session, identity);
    1.11      assert(status == PEP_STATUS_OK);
    1.12      if (status != PEP_STATUS_OK) {
     2.1 --- a/src/message_api.c	Tue Nov 08 00:12:17 2016 +0100
     2.2 +++ b/src/message_api.c	Tue Nov 08 00:12:36 2016 +0100
     2.3 @@ -1414,7 +1414,9 @@
     2.4                      status == PEP_MESSAGE_DISCARDED) {
     2.5                      free_message(msg);
     2.6                      msg = NULL;
     2.7 -                    return status;
     2.8 +                    *flags |= (status == PEP_MESSAGE_DISCARDED) ?
     2.9 +                                PEP_decrypt_flag_discarded :
    2.10 +                                PEP_decrypt_flag_consumed;
    2.11                  }
    2.12                  else if (status != PEP_STATUS_OK) {
    2.13                      return status;
    2.14 @@ -1699,6 +1701,11 @@
    2.15                  status == PEP_MESSAGE_DISCARDED) {
    2.16                  free_message(msg);
    2.17                  msg = NULL;
    2.18 +                *flags |= (status == PEP_MESSAGE_DISCARDED) ?
    2.19 +                            PEP_decrypt_flag_discarded :
    2.20 +                            PEP_decrypt_flag_consumed;
    2.21 +
    2.22 +                status = decrypt_status;
    2.23              }
    2.24              else if (status != PEP_STATUS_OK){
    2.25                  goto pep_error;
     3.1 --- a/src/message_api.h	Tue Nov 08 00:12:17 2016 +0100
     3.2 +++ b/src/message_api.h	Tue Nov 08 00:12:36 2016 +0100
     3.3 @@ -157,7 +157,9 @@
     3.4  DYNAMIC_API PEP_color color_from_rating(PEP_rating rating);
     3.5  
     3.6  typedef enum _PEP_decrypt_flags {
     3.7 -    PEP_decrypt_flag_own_private_key = 0x1
     3.8 +    PEP_decrypt_flag_own_private_key = 0x1,
     3.9 +    PEP_decrypt_flag_consumed = 0x2,
    3.10 +    PEP_decrypt_flag_discarded = 0x4
    3.11  } PEP_decrypt_flags; 
    3.12  
    3.13  typedef unsigned int PEP_decrypt_flags_t;