merge sync IOS-1576
authorbuff <andreas@pep-project.org>
Thu, 04 Jul 2019 10:52:32 +0200
branchIOS-1576
changeset 3897688eb9375ece
parent 3896 dd9071d6d901
parent 3894 9dbd6ed542da
child 3928 117be5371dd4
merge sync
     1.1 --- a/src/pgp_sequoia.c	Tue Jul 02 18:56:49 2019 +0200
     1.2 +++ b/src/pgp_sequoia.c	Thu Jul 04 10:52:32 2019 +0200
     1.3 @@ -2578,6 +2578,22 @@
     1.4  
     1.5      // Is the TPK live?
     1.6      *expired = !pgp_tpk_alive_at(tpk, when);
     1.7 +#ifdef TRACING
     1.8 +    {
     1.9 +        char buffer[26];
    1.10 +        time_t now = time(NULL);
    1.11 +
    1.12 +        if (when == now || when == now - 1) {
    1.13 +            sprintf(buffer, "now");
    1.14 +        } else {
    1.15 +            struct tm tm;
    1.16 +            gmtime_r(&when, &tm);
    1.17 +            strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &tm);
    1.18 +        }
    1.19 +
    1.20 +        T("TPK is %slive as of %s", *expired ? "not " : "", buffer);
    1.21 +    }
    1.22 +#endif
    1.23      if (*expired)
    1.24          goto out;
    1.25  
    1.26 @@ -2608,9 +2624,15 @@
    1.27  
    1.28      *expired = !(can_encrypt && can_sign && can_certify);
    1.29  
    1.30 +    T("Key can%s encrypt, can%s sign, can%s certify => %sexpired",
    1.31 +      can_encrypt ? "" : "not",
    1.32 +      can_sign ? "" : "not",
    1.33 +      can_certify ? "" : "not",
    1.34 +      *expired ? "" : "not ");
    1.35 +
    1.36   out:
    1.37      pgp_tpk_free(tpk);
    1.38 -    T("(%s) -> %s", fpr, pEp_status_to_string(status));
    1.39 +    T("(%s) -> %s (expired: %d)", fpr, pEp_status_to_string(status), *expired);
    1.40      return status;
    1.41  }
    1.42  
     2.1 --- a/src/status_to_string.h	Tue Jul 02 18:56:49 2019 +0200
     2.2 +++ b/src/status_to_string.h	Thu Jul 04 10:52:32 2019 +0200
     2.3 @@ -35,6 +35,7 @@
     2.4      case PEP_KEY_IMPORTED: return "PEP_KEY_IMPORTED";
     2.5      case PEP_NO_KEY_IMPORTED: return "PEP_NO_KEY_IMPORTED";
     2.6      case PEP_KEY_IMPORT_STATUS_UNKNOWN: return "PEP_KEY_IMPORT_STATUS_UNKNOWN";
     2.7 +    case PEP_SOME_KEYS_IMPORTED: return "PEP_SOME_KEYS_IMPORTED";
     2.8      
     2.9      case PEP_CANNOT_FIND_IDENTITY: return "PEP_CANNOT_FIND_IDENTITY";
    2.10      case PEP_CANNOT_SET_PERSON: return "PEP_CANNOT_SET_PERSON";