merging sync
authorVolker Birk <vb@pep-project.org>
Thu, 21 Mar 2019 18:44:38 +0100
branchsync
changeset 337664ef75bc10fb
parent 3375 4f64652fb80d
parent 3374 19c811bae100
child 3377 922fd505e0c0
merging
     1.1 --- a/build-mac/pEpEngine.xcodeproj/project.pbxproj	Thu Mar 21 18:44:22 2019 +0100
     1.2 +++ b/build-mac/pEpEngine.xcodeproj/project.pbxproj	Thu Mar 21 18:44:38 2019 +0100
     1.3 @@ -812,7 +812,7 @@
     1.4  			);
     1.5  			runOnlyForDeploymentPostprocessing = 0;
     1.6  			shellPath = /bin/sh;
     1.7 -			shellScript = "mkdir -p \"$BUILT_PRODUCTS_DIR/include\"\n\ncd \"$SRCROOT/..\"\n\nbash -l -c \"gmake -C sync\"\nbash -l -c \"gmake -C asn.1\"\n";
     1.8 +			shellScript = "export LANG=en_US.UTF-8\nmkdir -p \"$BUILT_PRODUCTS_DIR/include\"\n\ncd \"$SRCROOT/..\"\n\nbash -l -c \"gmake -C sync\"\nbash -l -c \"gmake -C asn.1\"\n";
     1.9  		};
    1.10  /* End PBXShellScriptBuildPhase section */
    1.11  
     2.1 --- a/src/pgp_sequoia.c	Thu Mar 21 18:44:22 2019 +0100
     2.2 +++ b/src/pgp_sequoia.c	Thu Mar 21 18:44:38 2019 +0100
     2.3 @@ -608,6 +608,14 @@
     2.4      pgp_tpk_key_iter_t key_iter = NULL;
     2.5      pgp_user_id_binding_iter_t user_id_iter = NULL;
     2.6  
     2.7 +    sqlite3_stmt *stmt = session->sq_sql.begin_transaction;
     2.8 +    int sqlite_result = sqlite3_step(stmt);
     2.9 +    sqlite3_reset(stmt);
    2.10 +    if (sqlite_result != SQLITE_DONE)
    2.11 +        ERROR_OUT(NULL, PEP_UNKNOWN_ERROR,
    2.12 +                  "begin transaction failed: %s",
    2.13 +                  sqlite3_errmsg(session->key_db));
    2.14 +
    2.15      pgp_fpr = pgp_tpk_fingerprint(tpk);
    2.16      fpr = pgp_fingerprint_to_hex(pgp_fpr);
    2.17      T("(%s, private_idents: %s)", fpr, private_idents ? "yes" : "no");
    2.18 @@ -642,14 +650,6 @@
    2.19  
    2.20  
    2.21      // Insert the TSK into the DB.
    2.22 -    sqlite3_stmt *stmt = session->sq_sql.begin_transaction;
    2.23 -    int sqlite_result = sqlite3_step(stmt);
    2.24 -    sqlite3_reset(stmt);
    2.25 -    if (sqlite_result != SQLITE_DONE)
    2.26 -        ERROR_OUT(NULL, PEP_UNKNOWN_ERROR,
    2.27 -                  "begin transaction failed: %s",
    2.28 -                  sqlite3_errmsg(session->key_db));
    2.29 -
    2.30      stmt = session->sq_sql.tpk_save_insert_primary;
    2.31      sqlite3_bind_text(stmt, 1, fpr, -1, SQLITE_STATIC);
    2.32      sqlite3_bind_int(stmt, 2, is_tsk);
    2.33 @@ -963,6 +963,7 @@
    2.34  
    2.35                  *secret = pgp_secret_cached(algo, session_key, session_key_len);
    2.36                  cookie->decrypted = 1;
    2.37 +                break;
    2.38              }
    2.39  
    2.40              pgp_tpk_key_iter_free(key_iter);
    2.41 @@ -1286,7 +1287,7 @@
    2.42  
    2.43      ws = pgp_writer_stack_message(writer);
    2.44  
    2.45 -    ws = pgp_signer_new_detached(&err, ws, &signer, 1);
    2.46 +    ws = pgp_signer_new_detached(&err, ws, &signer, 1, 0);
    2.47      if (!ws)
    2.48          ERROR_OUT(err, PEP_UNKNOWN_ERROR, "Setting up signer");
    2.49  
    2.50 @@ -1376,12 +1377,10 @@
    2.51  
    2.52      ws = pgp_writer_stack_message(writer);
    2.53      ws = pgp_encryptor_new (&err, ws,
    2.54 -                           NULL, 0, keys, keys_count,
    2.55 -                           PGP_ENCRYPTION_MODE_FOR_TRANSPORT);
    2.56 -    if (!ws) {
    2.57 -        pgp_writer_free(writer);
    2.58 +                            NULL, 0, keys, keys_count,
    2.59 +                            PGP_ENCRYPTION_MODE_FOR_TRANSPORT, 0);
    2.60 +    if (!ws)
    2.61          ERROR_OUT(err, PEP_UNKNOWN_ERROR, "Setting up encryptor");
    2.62 -    }
    2.63  
    2.64      if (sign) {
    2.65          iter = pgp_tpk_key_iter_valid(signer_tpk);
    2.66 @@ -1403,7 +1402,7 @@
    2.67          if (! signer)
    2.68              ERROR_OUT (err, PEP_UNKNOWN_ERROR, "Creating a signer");
    2.69  
    2.70 -        ws = pgp_signer_new(&err, ws, &signer, 1);
    2.71 +        ws = pgp_signer_new(&err, ws, &signer, 1, 0);
    2.72          if (!ws)
    2.73              ERROR_OUT(err, PEP_UNKNOWN_ERROR, "Setting up signer");
    2.74      }