default merge enigmail-color-tests
authorKrista Grothoff <krista@pep-project.org>
Thu, 09 Feb 2017 13:04:13 +0100
branchenigmail-color-tests
changeset 15773991870e35c9
parent 1576 e7b04608f770
parent 1573 e3c1acfac537
child 1578 a676a68136e3
default merge
     1.1 --- a/src/message_api.c	Thu Feb 09 13:03:53 2017 +0100
     1.2 +++ b/src/message_api.c	Thu Feb 09 13:04:13 2017 +0100
     1.3 @@ -1473,7 +1473,8 @@
     1.4      for (from_curr = from_keys; from_curr; from_curr = from_curr->next) {
     1.5          for (verify_curr = orig_verify; verify_curr; verify_curr = verify_curr->next) {
     1.6              if (from_curr->value && verify_curr->value &&
     1.7 -                strcasecmp(from_curr->value, verify_curr->value) == 0) {
     1.8 +                _same_fpr(from_curr->value, strlen(from_curr->value),
     1.9 +                          verify_curr->value, strlen(verify_curr->value))) {
    1.10                  from_fpr_node = from_curr;
    1.11                  break;
    1.12              }
    1.13 @@ -1488,7 +1489,8 @@
    1.14      verify_curr = orig_verify;
    1.15      
    1.16      /* put "from" signer at the beginning of the list */
    1.17 -    if (strcasecmp(orig_verify->value, from_fpr_node->value) != 0) {
    1.18 +    if (!_same_fpr(orig_verify->value, strlen(orig_verify->value),
    1.19 +                   from_fpr_node->value, strlen(from_fpr_node->value))) {
    1.20          orig_verify = stringlist_delete(orig_verify, from_fpr_node->value);
    1.21          verify_curr = new_stringlist(from_fpr_node->value);
    1.22          verify_curr->next = orig_verify;
     2.1 --- a/src/pEpEngine.c	Thu Feb 09 13:03:53 2017 +0100
     2.2 +++ b/src/pEpEngine.c	Thu Feb 09 13:04:13 2017 +0100
     2.3 @@ -768,6 +768,12 @@
     2.4      assert(title);
     2.5      assert(entity);
     2.6  
     2.7 +    #ifndef NDEBUG
     2.8 +    #ifdef ANDROID
     2.9 +    LOGD(" %s :: %s :: %s ", title, entity, description);
    2.10 +    #endif
    2.11 +    #endif
    2.12 +
    2.13      if (!(session && title && entity))
    2.14          return PEP_ILLEGAL_VALUE;
    2.15  
    2.16 @@ -2058,13 +2064,15 @@
    2.17      status = _increment_sequence_value(session, name, own);
    2.18      if (status == PEP_STATUS_OK) {
    2.19          status = _get_sequence_value(session, name, value);
    2.20 +    }
    2.21 +    if (status == PEP_STATUS_OK || status == PEP_OWN_SEQUENCE) {
    2.22          result = sqlite3_exec(session->db, "COMMIT ;", NULL, NULL, NULL);
    2.23          if (result == SQLITE_OK){
    2.24              assert(*value < INT32_MAX);
    2.25              if (*value == INT32_MAX){
    2.26                  return PEP_CANNOT_INCREASE_SEQUENCE;
    2.27              }
    2.28 -            return PEP_STATUS_OK;
    2.29 +            return status;
    2.30          } else {
    2.31              return PEP_COMMIT_FAILED;
    2.32          }
     3.1 --- a/src/pEp_internal.h	Thu Feb 09 13:03:53 2017 +0100
     3.2 +++ b/src/pEp_internal.h	Thu Feb 09 13:04:13 2017 +0100
     3.3 @@ -166,9 +166,16 @@
     3.4  
     3.5  #ifdef NDEBUG
     3.6  #define DEBUG_LOG(TITLE, ENTITY, DESC)
     3.7 +#define  LOGD(...)
     3.8  #else
     3.9  #define DEBUG_LOG(TITLE, ENTITY, DESC) \
    3.10      log_event(session, (TITLE), (ENTITY), (DESC), "debug");
    3.11 +#ifdef ANDROID
    3.12 +#include <android/log.h>
    3.13 +#define  LOG_TAG    "pEpEngine"
    3.14 +#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
    3.15 +#endif
    3.16 +
    3.17  #endif
    3.18  
    3.19  // Space tolerant and case insensitive fingerprint string compare