]> git.notmuchmail.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <david@tethera.net>
Tue, 11 Jun 2019 23:41:35 +0000 (20:41 -0300)
committerDavid Bremner <david@tethera.net>
Tue, 11 Jun 2019 23:41:35 +0000 (20:41 -0300)
21 files changed:
debian/control
debian/rules
lib/messages.c
notmuch-client.h
notmuch-setup.c
notmuch.c
performance-test/M00-new.sh
performance-test/M01-dump-restore.sh
performance-test/M02-show.sh
performance-test/M03-search.sh
performance-test/M04-reply.sh
performance-test/M05-reindex.sh
performance-test/M06-insert.sh
performance-test/T00-new.sh
performance-test/T01-dump-restore.sh
performance-test/T02-tag.sh
performance-test/T03-reindex.sh
performance-test/T04-thread-subquery.sh
test/T357-index-decryption.sh
test/aggregate-results.sh
test/corpora/crypto/encrypted-signed.eml [new file with mode: 0644]

index 31d6471c28b29dee9a19e567e57196493302afee..ff646c6bafe39f082fe06a9928016cdc4613ea70 100644 (file)
@@ -29,7 +29,7 @@ Build-Depends:
  gnupg <!nocheck>,
  bash-completion (>=1.9.0~),
  texinfo
-Standards-Version: 4.1.3
+Standards-Version: 4.3.0
 Homepage: https://notmuchmail.org/
 Vcs-Git: https://git.notmuchmail.org/git/notmuch -b release
 Vcs-Browser: https://git.notmuchmail.org/git/notmuch
@@ -77,6 +77,8 @@ Package: python-notmuch
 Architecture: all
 Section: python
 Depends: ${misc:Depends}, ${python:Depends}, libnotmuch5 (>= ${source:Version})
+Provides: ${python:Provides}
+XB-Python-Version: ${python:Versions}
 Description: Python interface to the notmuch mail search and index library
  Notmuch is a system for indexing, searching, reading, and tagging
  large collections of email messages in maildir or mh format. It uses
@@ -152,7 +154,8 @@ Depends:
  notmuch (>= 0.4),
  libmail-box-perl, libmailtools-perl,
  libstring-shellquote-perl, libterm-readline-gnu-perl,
- ${misc:Depends}
+ ${misc:Depends},
+ ${perl:Depends},
 Recommends: mutt
 Enhances: notmuch, mutt
 Description: thread-based email index, search and tagging (Mutt interface)
index d056edb623944822730fcb7ca13ad40457e27daa..ebd1048170839dfc90aa75c789b1669af252bee2 100755 (executable)
@@ -2,6 +2,8 @@
 
 python3_all = py3versions -s | xargs -n1 | xargs -t -I {} env {}
 
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
 %:
        dh $@ --with python2,python3,elpa
 
index 04fa19f8ec16e4c140e506e1f39f084ba47e09dc..7ddfaf269c74b3a1cd2893bb4d64d04dba520393 100644 (file)
@@ -117,7 +117,7 @@ _notmuch_messages_has_next (notmuch_messages_t *messages)
        return false;
 
     if (! messages->is_of_list_type)
-       INTERNAL_ERROR("_notmuch_messages_has_next not implimented for msets");
+       INTERNAL_ERROR("_notmuch_messages_has_next not implemented for msets");
 
     return (messages->iterator->next != NULL);
 }
index 39e26f2ec92aa3a2e4ef32516396491cc3184e9d..b3a501a9123ffdb08b74f8d9f3343ee6a38f644a 100644 (file)
@@ -53,7 +53,7 @@
 #include "talloc-extra.h"
 #include "crypto.h"
 
-#define unused(x) x __attribute__ ((unused))
+#define unused(x) x ## _unused __attribute__ ((unused))
 
 #define STRINGIFY(s) STRINGIFY_(s)
 #define STRINGIFY_(s) #s
index 5304800553cfbe3897e2c8774ba702a30b8b9488..81419ccf3a9426b56117e1eb44efbb642600d74e 100644 (file)
@@ -121,7 +121,7 @@ parse_tag_list (void *ctx, char *response)
 
 int
 notmuch_setup_command (notmuch_config_t *config,
-                      unused (int argc), unused (char *argv[]))
+                      int argc, char *argv[])
 {
     char *response = NULL;
     size_t response_size = 0;
index eeb794e85216115adaf8583744f51f382f8e5817..2ddc8fbcdb0b388b1c4b1dc9c6bd44387bf24321 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -358,7 +358,7 @@ notmuch_help_command (unused (notmuch_config_t * config), int argc, char *argv[]
  */
 static int
 notmuch_command (notmuch_config_t *config,
-                unused(int argc), unused(char *argv[]))
+                unused(int argc), unused(char **argv))
 {
     char *db_path;
     struct stat st;
index aab36e6953e2917b40a959a5bb4177d0c1cfd772..5858ab337fd8be17da7a64617fb3327971f45a0f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='notmuch new'
 
index 32ab8dc9c0b99fac7e5375b17f8d184daea7187b..7850b4117d50740b322e09b2d8e82131fcc93d8c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='dump and restore'
 
index 2e218fd3c4b6fd0c5ea9163a82084de627752918..40c5d4d756000d46fd12b2b5a16e1b2563f38a87 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='show'
 
index 343f5c7cfc24bba490ee67aa410be76937165763..a73a36abf1c75e163aac3c61e4c38c80695bb20b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='search'
 
index 3c1205dbc41206f67c086de8640c3ef615d23f0f..3b0f9e7848a36da230b4bcfef062c47d24929a8e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='search'
 
index 17e2c824698ab5852e11d57bd598222c686753f9..8ea7e7ee89a64c808d528ccde664da82d1f9a6c7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='reindex'
 
index 5ae0656a505b1c909644ab6251988578db6d1bd8..12330c76981589ec46916925a3267c17be8047e3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='search'
 
index 25391136c041c8417912e4dab82b3cd541b6521c..a14dd13f1477a7cab465e1ca6c3fefe88b53c690 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='notmuch new'
 
index 12f12e660533ecd288cbdd61e6dbfddb34b6f916..2a53e3b82f3bf4c113e570b9314e8a5c60055c80 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='dump and restore'
 
index 8c5dfd68031656503d2ba40b49271f9570b87eaa..9c895d6a910145266dde528039a61caabcc8fa70 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='tagging'
 
index 8e0a77f42c5d2da47b14fa1eb8c40c2ab2ac35e6..8db52a33a9e2d8c78ca3720bad83ebfceea07079 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='reindexing'
 
index 665d5a64d93fc0e27317d591c06f40b87dfb3e00..ba81f3836e371e1c6ae210c7b2db53e25885f80a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='thread subqueries'
 
index 8a2d4c0265a6f9b1c98b10b5727db1c87d02b0ce..1ac2836a6e31e9cab1b8c37444038fc6162bce29 100755 (executable)
@@ -226,6 +226,7 @@ output=$(notmuch dump | LC_ALL=C sort)
 expected='#= simple-encrypted@crypto.notmuchmail.org index.decryption=failure
 #notmuch-dump batch-tag:3 config,properties,tags
 +encrypted +inbox +unread -- id:basic-encrypted@crypto.notmuchmail.org
++encrypted +inbox +unread -- id:encrypted-signed@crypto.notmuchmail.org
 +encrypted +inbox +unread -- id:simple-encrypted@crypto.notmuchmail.org'
 test_expect_equal \
     "$output" \
@@ -288,6 +289,24 @@ test_expect_equal \
     "$output" \
     "$expected"
 
+goodsig='good_sig:[0][0][0]["crypto"]["signed"]["status"][0]["status"]="good"'
+nosig='no_sig:[0][0][0]["crypto"]!"signed"'
+
+test_begin_subtest "verify signature without a session key stashed when --decrypt=true"
+output=$(notmuch show --format=json --decrypt=true id:encrypted-signed@crypto.notmuchmail.org)
+test_json_nodes <<<"$output" "$goodsig"
+
+test_begin_subtest "do not verify sig without a session key stashed if --decrypt=auto"
+output=$(notmuch show --format=json id:encrypted-signed@crypto.notmuchmail.org)
+test_json_nodes <<<"$output" "$nosig"
+
+test_begin_subtest "verify signature when --decrypt=stash"
+output=$(notmuch show --format=json --decrypt=stash id:encrypted-signed@crypto.notmuchmail.org)
+test_json_nodes <<<"$output" "$goodsig"
+
+test_begin_subtest "verify signature with stashed session key"
+output=$(notmuch show --format=json id:encrypted-signed@crypto.notmuchmail.org)
+test_json_nodes <<<"$output" "$goodsig"
 
 # TODO: test removal of a message from the message store between
 # indexing and reindexing.
index 6322854675fdae93cabbf55ac9a7cb531513b00d..05fb0a92af89113b08fb86b936c3ba039d460083 100755 (executable)
@@ -13,81 +13,61 @@ do
        while read type value
        do
                case $type in
-               '')
-                       continue ;;
                fixed)
-                       fixed=$(($fixed + $value)) ;;
+                       fixed=$((fixed + value)) ;;
                success)
-                       success=$(($success + $value)) ;;
+                       success=$((success + value)) ;;
                failed)
-                       failed=$(($failed + $value)) ;;
+                       failed=$((failed + value)) ;;
                broken)
-                       broken=$(($broken + $value)) ;;
+                       broken=$((broken + value)) ;;
                total)
-                       total=$(($total + $value)) ;;
+                       total=$((total + value)) ;;
                esac
        done <"$file"
 done
 
-pluralize () {
-    case $2 in
-       1)
-           case $1 in
-               test)
-                   echo test ;;
-               failure)
-                   echo failure ;;
-           esac
-           ;;
-       *)
-           case $1 in
-               test)
-                   echo tests ;;
-               failure)
-                   echo failures ;;
-           esac
-           ;;
-    esac
-}
+pluralize_s () { [ "$1" -eq 1 ] && s='' || s='s'; }
 
 echo "Notmuch test suite complete."
-if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then
-    tests=$(pluralize "test" $total)
-    printf "All $total $tests "
-    if [ "$broken" = "0" ]; then
-       echo "passed."
-    else
-       failures=$(pluralize "failure" $broken)
-       echo "behaved as expected ($broken expected $failures)."
-    fi;
+
+if [ "$fixed" -eq 0 ] && [ "$failed" -eq 0 ]; then
+       pluralize_s "$total"
+       printf "All $total test$s "
+       if [ "$broken" -eq 0 ]; then
+               echo "passed."
+       else
+               pluralize_s "$broken"
+               echo "behaved as expected ($broken expected failure$s)."
+       fi
 else
-    echo "$success/$total tests passed."
-    if [ "$broken" != "0" ]; then
-       tests=$(pluralize "test" $broken)
-       echo "$broken broken $tests failed as expected."
-    fi
-    if [ "$fixed" != "0" ]; then
-       tests=$(pluralize "test" $fixed)
-       echo "$fixed broken $tests now fixed."
-    fi
-    if [ "$failed" != "0" ]; then
-       tests=$(pluralize "test" $failed)
-       echo "$failed $tests failed."
-    fi
+       echo "$success/$total tests passed."
+       if [ "$broken" -ne 0 ]; then
+               pluralize_s "$broken"
+               echo "$broken broken test$s failed as expected."
+       fi
+       if [ "$fixed" -ne 0 ]; then
+               pluralize_s "$fixed"
+               echo "$fixed broken test$s now fixed."
+       fi
+       if [ "$failed" -ne 0 ]; then
+               pluralize_s "$failed"
+               echo "$failed test$s failed."
+       fi
 fi
 
-skipped=$(($total - $fixed - $success - $failed - $broken))
-if [ "$skipped" != "0" ]; then
-    tests=$(pluralize "test" $skipped)
-    echo "$skipped $tests skipped."
+skipped=$((total - fixed - success - failed - broken))
+if [ "$skipped" -ne 0 ]; then
+       pluralize_s "$skipped"
+       echo "$skipped test$s skipped."
 fi
 
 # Note that we currently do not consider skipped tests as failing the
 # build.
 
-if [ $success -gt 0 -a $fixed -eq 0 -a $failed -eq 0 ]
+if [ "$success" -gt 0 ] && [ "$fixed" -eq 0 ] && [ "$failed" -eq 0 ]
 then
-    exit 0
+       exit 0
 else
-    exit 1
+       exit 1
 fi
diff --git a/test/corpora/crypto/encrypted-signed.eml b/test/corpora/crypto/encrypted-signed.eml
new file mode 100644 (file)
index 0000000..0345e3e
--- /dev/null
@@ -0,0 +1,35 @@
+From: test_suite@notmuchmail.org
+To: test_suite@notmuchmail.org
+Subject: Lyrics
+Date: Wed 29 May 2019 06:09:22 PM EDT
+Message-ID: <encrypted-signed@crypto.notmuchmail.org>
+MIME-Version: 1.0
+Content-Type: multipart/encrypted; boundary="=-=-=";
+       protocol="application/pgp-encrypted"
+
+--=-=-=
+Content-Type: application/pgp-encrypted
+
+Version: 1
+
+--=-=-=
+Content-Type: application/octet-stream
+
+-----BEGIN PGP MESSAGE-----
+
+hIwDxE023q1UqxYBBAC9z781zV7QAInGMKHX6TKU5Xw/OkoWXahpDL88F6Ocm5R9
+7M9z2ocvlyrbgRhqE+nvFeGH/K7rVkBBT6TAcdIe/C8Qzbd3stPPcx1PlunGROj7
+H/WAcmDksK3HkXpHwmInUtzNw1pkhOoLy/sFSbPvtyg8GCUzXbafHAIIo0rB2tLB
+DwGWD3l4WdcyQWuYD9QJKuDIqdWo8E3TTcKkiOAt/6liwPNZ0jGzDeCuSTnWFj6Z
+AiXGeNtD3I1tCN/8T3NjEKOCQ+bdT5Y06dDaL61FpQ23eIuSUgksVxjnkEAb6iPe
+07gjzcyNuGP3WPI/0qu0wtZwpAQxvaNygDsQj/OjR5kn9luBd/VqodM3TWWS8miV
+m0z1tYbqYAQWW6TS7fXlsyXoOxTLW5MCfe3D36VSErL/NJItETklVKzNfKjMmRKx
+CI2ZUzugxPWSLQzOp5yl7iICk8e+vS9TkQw2j0nXAQYLYgmqZMhf4av5GlFv3tQu
+heO4XLT6NBDTHMFTDbgW42kE0N4MDPc29AqVFGImcTHvflF4Vp0qIbSJdIcHwKkU
+5LKqvicAa0lsIoJbsW3lHrzowyjov2vLH/VGd/wIX+MS3KT7cySdyp8HVMcwwyZu
+Y9nrTN/7G1FwKWlcGa4uJNcFFkYlcEymZj1EX2cyrdezPtX7K5vhwBYddptFD+Bn
+IVkghRut3UDeXe83F8OutWiZfK5EVYABq/aP3//hIbQl2o4Dkd3z9m+8LobrIV5s
+NXjAjU5WQOjRLoHBebG2HkMpFsWhXD/Fb/Bb58VOpdI=
+=x12v
+-----END PGP MESSAGE-----
+--=-=-=--