diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | gmime3/.footprint | 74 | ||||
| -rw-r--r-- | gmime3/.md5sum | 1 | ||||
| -rw-r--r-- | gmime3/Pkgfile | 29 | ||||
| -rw-r--r-- | notmuch/.footprint | 9 | ||||
| -rw-r--r-- | notmuch/.md5sum | 2 | ||||
| -rw-r--r-- | notmuch/Pkgfile | 29 | ||||
| -rw-r--r-- | notmuch/gpgless_configure.diff | 234 |
8 files changed, 379 insertions, 0 deletions
| @@ -4,3 +4,4 @@ | |||
| 4 | *.partial | 4 | *.partial |
| 5 | *~ | 5 | *~ |
| 6 | .*~ | 6 | .*~ |
| 7 | work/ | ||
diff --git a/gmime3/.footprint b/gmime3/.footprint new file mode 100644 index 0000000..8d17c4f --- /dev/null +++ b/gmime3/.footprint | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | drwxr-xr-x root/root usr/ | ||
| 2 | drwxr-xr-x root/root usr/include/ | ||
| 3 | drwxr-xr-x root/root usr/include/gmime-3.0/ | ||
| 4 | drwxr-xr-x root/root usr/include/gmime-3.0/gmime/ | ||
| 5 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-application-pkcs7-mime.h | ||
| 6 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-autocrypt.h | ||
| 7 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-certificate.h | ||
| 8 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-charset.h | ||
| 9 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-content-type.h | ||
| 10 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-crypto-context.h | ||
| 11 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-data-wrapper.h | ||
| 12 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-disposition.h | ||
| 13 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-encodings.h | ||
| 14 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-error.h | ||
| 15 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-basic.h | ||
| 16 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-best.h | ||
| 17 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-charset.h | ||
| 18 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-checksum.h | ||
| 19 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-dos2unix.h | ||
| 20 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-enriched.h | ||
| 21 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-from.h | ||
| 22 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-gzip.h | ||
| 23 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-html.h | ||
| 24 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-openpgp.h | ||
| 25 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-smtp-data.h | ||
| 26 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-strip.h | ||
| 27 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-unix2dos.h | ||
| 28 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-windows.h | ||
| 29 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter-yenc.h | ||
| 30 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-filter.h | ||
| 31 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-format-options.h | ||
| 32 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-gpg-context.h | ||
| 33 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-header.h | ||
| 34 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-iconv-utils.h | ||
| 35 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-iconv.h | ||
| 36 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-message-part.h | ||
| 37 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-message-partial.h | ||
| 38 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-message.h | ||
| 39 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-multipart-encrypted.h | ||
| 40 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-multipart-signed.h | ||
| 41 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-multipart.h | ||
| 42 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-object.h | ||
| 43 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-param.h | ||
| 44 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-parser-options.h | ||
| 45 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-parser.h | ||
| 46 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-part-iter.h | ||
| 47 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-part.h | ||
| 48 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-pkcs7-context.h | ||
| 49 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-references.h | ||
| 50 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-signature.h | ||
| 51 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-buffer.h | ||
| 52 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-cat.h | ||
| 53 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-file.h | ||
| 54 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-filter.h | ||
| 55 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-fs.h | ||
| 56 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-gio.h | ||
| 57 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-mem.h | ||
| 58 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-mmap.h | ||
| 59 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-null.h | ||
| 60 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream-pipe.h | ||
| 61 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-stream.h | ||
| 62 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-text-part.h | ||
| 63 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-utils.h | ||
| 64 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime-version.h | ||
| 65 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/gmime.h | ||
| 66 | -rw-r--r-- root/root usr/include/gmime-3.0/gmime/internet-address.h | ||
| 67 | drwxr-xr-x root/root usr/lib/ | ||
| 68 | -rwxr-xr-x root/root usr/lib/libgmime-3.0.la | ||
| 69 | lrwxrwxrwx root/root usr/lib/libgmime-3.0.so -> libgmime-3.0.so.0.214.1 | ||
| 70 | lrwxrwxrwx root/root usr/lib/libgmime-3.0.so.0 -> libgmime-3.0.so.0.214.1 | ||
| 71 | -rwxr-xr-x root/root usr/lib/libgmime-3.0.so.0.214.1 | ||
| 72 | drwxr-xr-x root/root usr/lib/pkgconfig/ | ||
| 73 | -rw-r--r-- root/root usr/lib/pkgconfig/gmime-3.0.pc | ||
| 74 | drwxr-xr-x root/root usr/share/ | ||
diff --git a/gmime3/.md5sum b/gmime3/.md5sum new file mode 100644 index 0000000..3c13abc --- /dev/null +++ b/gmime3/.md5sum | |||
| @@ -0,0 +1 @@ | |||
| f7d6b4ad3253e73c72237fde5bced617 gmime-3.2.15.tar.xz | |||
diff --git a/gmime3/Pkgfile b/gmime3/Pkgfile new file mode 100644 index 0000000..a13e855 --- /dev/null +++ b/gmime3/Pkgfile | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # Description: A C/C++ MIME creation and parser library with support for Unix mbox spools | ||
| 2 | # URL: https://github.com/jstedfast/gmime | ||
| 3 | # Maintainer: Shokara Kou, kou at 13f0 dot net | ||
| 4 | # Packager: Tim Biermann, tbier at posteo dot de | ||
| 5 | # Depends on: | ||
| 6 | |||
| 7 | name=gmime3 | ||
| 8 | version=3.2.15 | ||
| 9 | release=2 | ||
| 10 | source=(https://github.com/jstedfast/gmime/releases/download/$version/gmime-$version.tar.xz) | ||
| 11 | |||
| 12 | build() { | ||
| 13 | cd gmime-$version | ||
| 14 | |||
| 15 | ./configure \ | ||
| 16 | --prefix=/usr \ | ||
| 17 | --program-prefix=gmime3 \ | ||
| 18 | --disable-crypto \ | ||
| 19 | --disable-introspection \ | ||
| 20 | --disable-smime \ | ||
| 21 | --disable-gtk-doc \ | ||
| 22 | --disable-static \ | ||
| 23 | --without-libidn | ||
| 24 | sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool | ||
| 25 | make | ||
| 26 | make DESTDIR=$PKG install | ||
| 27 | |||
| 28 | rm -rf $PKG/usr/share/gtk-doc | ||
| 29 | } | ||
diff --git a/notmuch/.footprint b/notmuch/.footprint new file mode 100644 index 0000000..e9b246b --- /dev/null +++ b/notmuch/.footprint | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | drwxr-xr-x root/root usr/ | ||
| 2 | drwxr-xr-x root/root usr/bin/ | ||
| 3 | -rwxr-xr-x root/root usr/bin/notmuch | ||
| 4 | drwxr-xr-x root/root usr/include/ | ||
| 5 | -rw-r--r-- root/root usr/include/notmuch.h | ||
| 6 | drwxr-xr-x root/root usr/lib/ | ||
| 7 | lrwxrwxrwx root/root usr/lib/libnotmuch.so -> libnotmuch.so.5.6.0 | ||
| 8 | lrwxrwxrwx root/root usr/lib/libnotmuch.so.5 -> libnotmuch.so.5.6.0 | ||
| 9 | -rw-r--r-- root/root usr/lib/libnotmuch.so.5.6.0 | ||
diff --git a/notmuch/.md5sum b/notmuch/.md5sum new file mode 100644 index 0000000..d4409c9 --- /dev/null +++ b/notmuch/.md5sum | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 1d59a34a265c867a816171d50e801139 gpgless_configure.diff | ||
| 2 | edce1607f13ad8cb9ea6409b8e04c4d6 notmuch-0.39.tar.xz | ||
diff --git a/notmuch/Pkgfile b/notmuch/Pkgfile new file mode 100644 index 0000000..5076152 --- /dev/null +++ b/notmuch/Pkgfile | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # Description: a fast, global-search and tag-based email system | ||
| 2 | # URL: https://notmuchmail.org/ | ||
| 3 | # Maintainer: Shokara Kou, kou at 13f0 dot net | ||
| 4 | # Packager: Tim Biermann, tbier at posteo dot de | ||
| 5 | # Depends on: gmime3 talloc xapian-core | ||
| 6 | # Optional: emacs | ||
| 7 | |||
| 8 | name=notmuch | ||
| 9 | version=0.39 | ||
| 10 | release=1 | ||
| 11 | source=(https://notmuchmail.org/releases/$name-$version.tar.xz | ||
| 12 | gpgless_configure.diff) | ||
| 13 | |||
| 14 | build() { | ||
| 15 | cd $name-$version | ||
| 16 | |||
| 17 | patch -Np1 <$SRC/gpgless_configure.diff | ||
| 18 | ./configure \ | ||
| 19 | --prefix=/usr \ | ||
| 20 | --sysconfdir=/etc \ | ||
| 21 | --includedir=/usr/include \ | ||
| 22 | --with-emacs \ | ||
| 23 | --without-bash-completion \ | ||
| 24 | --without-zsh-completion | ||
| 25 | |||
| 26 | prt-get isinst emacs >/dev/null 2>&1 && IS_EMACS=1 || IS_EMACS=0 | ||
| 27 | make DESTDIR=$PKG LIBDIR_IN_LDCONFIG=0 WITH_EMACS=$IS_EMACS install | ||
| 28 | install -Dm755 notmuch-shared $PKG/usr/bin/notmuch | ||
| 29 | } | ||
diff --git a/notmuch/gpgless_configure.diff b/notmuch/gpgless_configure.diff new file mode 100644 index 0000000..eedb5eb --- /dev/null +++ b/notmuch/gpgless_configure.diff | |||
| @@ -0,0 +1,234 @@ | |||
| 1 | --- a/configure 2025-11-15 20:31:24.176390211 -0500 | ||
| 2 | +++ b/configure 2025-11-15 20:34:24.654376850 -0500 | ||
| 3 | @@ -501,231 +501,6 @@ | ||
| 4 | have_gmime=1 | ||
| 5 | gmime_cflags=$(pkg-config --cflags gmime-3.0) | ||
| 6 | gmime_ldflags=$(pkg-config --libs gmime-3.0) | ||
| 7 | - | ||
| 8 | - printf "Checking for GMime session key extraction support... " | ||
| 9 | - | ||
| 10 | - cat > _check_session_keys.c <<EOF | ||
| 11 | -#include <gmime/gmime.h> | ||
| 12 | -#include <stdio.h> | ||
| 13 | - | ||
| 14 | -int main () { | ||
| 15 | - GError *error = NULL; | ||
| 16 | - GMimeParser *parser = NULL; | ||
| 17 | - GMimeMultipartEncrypted *body = NULL; | ||
| 18 | - GMimeDecryptResult *decrypt_result = NULL; | ||
| 19 | - GMimeObject *output = NULL; | ||
| 20 | - | ||
| 21 | - g_mime_init (); | ||
| 22 | - parser = g_mime_parser_new (); | ||
| 23 | - g_mime_parser_init_with_stream (parser, g_mime_stream_file_open("$srcdir/test/corpora/crypto/basic-encrypted.eml", "r", &error)); | ||
| 24 | - if (error) return !! fprintf (stderr, "failed to instantiate parser with test/corpora/crypto/basic-encrypted.eml\n"); | ||
| 25 | - | ||
| 26 | - body = GMIME_MULTIPART_ENCRYPTED(g_mime_message_get_mime_part (g_mime_parser_construct_message (parser, NULL))); | ||
| 27 | - if (body == NULL) return !! fprintf (stderr, "did not find a multipart encrypted message\n"); | ||
| 28 | - | ||
| 29 | - output = g_mime_multipart_encrypted_decrypt (body, GMIME_DECRYPT_EXPORT_SESSION_KEY, NULL, &decrypt_result, &error); | ||
| 30 | - if (error || output == NULL) return !! fprintf (stderr, "decryption failed\n"); | ||
| 31 | - | ||
| 32 | - if (decrypt_result == NULL) return !! fprintf (stderr, "no GMimeDecryptResult found\n"); | ||
| 33 | - if (decrypt_result->session_key == NULL) return !! fprintf (stderr, "GMimeDecryptResult has no session key\n"); | ||
| 34 | - | ||
| 35 | - printf ("%s\n", decrypt_result->session_key); | ||
| 36 | - return 0; | ||
| 37 | -} | ||
| 38 | -EOF | ||
| 39 | - if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then | ||
| 40 | - printf 'No.\nCould not make tempdir for testing session-key support.\n' | ||
| 41 | - errors=$((errors + 1)) | ||
| 42 | - elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c ${gmime_ldflags} -o _check_session_keys \ | ||
| 43 | - && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < "$srcdir"/test/openpgp4-secret-key.asc \ | ||
| 44 | - && SESSION_KEY=$(GNUPGHOME=${TEMP_GPG} ./_check_session_keys) \ | ||
| 45 | - && [ $SESSION_KEY = 9:496A0B6D15A5E7BA762FB8E5FE6DEE421D4D9BBFCEAD1CDD0CCF636D07ADE621 ] | ||
| 46 | - then | ||
| 47 | - printf "OK.\n" | ||
| 48 | - else | ||
| 49 | - cat <<EOF | ||
| 50 | -No. | ||
| 51 | -*** Error: Could not extract session keys from encrypted message. | ||
| 52 | - | ||
| 53 | -This is likely due to your GMime having been built against a old | ||
| 54 | -version of GPGME. | ||
| 55 | - | ||
| 56 | -Please try to rebuild your version of GMime against a more recent | ||
| 57 | -version of GPGME (at least GPGME 1.8.0). | ||
| 58 | -EOF | ||
| 59 | - if GPGME_VERS="$(pkg-config --modversion gpgme || gpgme-config --version)"; then | ||
| 60 | - printf 'Your current GPGME development version is: %s\n' "$GPGME_VERS" | ||
| 61 | - else | ||
| 62 | - printf 'You do not have the GPGME development libraries installed.\n' | ||
| 63 | - fi | ||
| 64 | - errors=$((errors + 1)) | ||
| 65 | - fi | ||
| 66 | - if [ -n "$TEMP_GPG" -a -d "$TEMP_GPG" ]; then | ||
| 67 | - rm -rf "$TEMP_GPG" | ||
| 68 | - fi | ||
| 69 | - | ||
| 70 | - cat > _check_gmime_cert.c <<EOF | ||
| 71 | -#include <stdio.h> | ||
| 72 | -#include <gmime/gmime.h> | ||
| 73 | - | ||
| 74 | -int main () { | ||
| 75 | - GError *error = NULL; | ||
| 76 | - GMimeParser *parser = NULL; | ||
| 77 | - GMimeApplicationPkcs7Mime *body = NULL; | ||
| 78 | - GMimeSignatureList *sig_list = NULL; | ||
| 79 | - GMimeSignature *sig = NULL; | ||
| 80 | - GMimeCertificate *cert = NULL; | ||
| 81 | - GMimeObject *output = NULL; | ||
| 82 | - int len; | ||
| 83 | - | ||
| 84 | - g_mime_init (); | ||
| 85 | - parser = g_mime_parser_new (); | ||
| 86 | - g_mime_parser_init_with_stream (parser, g_mime_stream_file_open("$srcdir/test/corpora/pkcs7/smime-onepart-signed.eml", "r", &error)); | ||
| 87 | - if (error) return !! fprintf (stderr, "failed to instantiate parser with test/corpora/pkcs7/smime-onepart-signed.eml\n"); | ||
| 88 | - | ||
| 89 | - body = GMIME_APPLICATION_PKCS7_MIME(g_mime_message_get_mime_part (g_mime_parser_construct_message (parser, NULL))); | ||
| 90 | - if (body == NULL) return !! fprintf (stderr, "did not find a application/pkcs7 message\n"); | ||
| 91 | - | ||
| 92 | - sig_list = g_mime_application_pkcs7_mime_verify (body, GMIME_VERIFY_NONE, &output, &error); | ||
| 93 | - if (error || output == NULL) return !! fprintf (stderr, "verify failed\n"); | ||
| 94 | - | ||
| 95 | - if (sig_list == NULL) return !! fprintf (stderr, "no GMimeSignatureList found\n"); | ||
| 96 | - len = g_mime_signature_list_length (sig_list); | ||
| 97 | - if (len != 1) return !! fprintf (stderr, "expected 1 signature, got %d\n", len); | ||
| 98 | - sig = g_mime_signature_list_get_signature (sig_list, 0); | ||
| 99 | - if (sig == NULL) return !! fprintf (stderr, "no GMimeSignature found at position 0\n"); | ||
| 100 | - cert = g_mime_signature_get_certificate (sig); | ||
| 101 | - if (cert == NULL) return !! fprintf (stderr, "no GMimeCertificate found\n"); | ||
| 102 | -#ifdef CHECK_VALIDITY | ||
| 103 | - GMimeValidity validity = g_mime_certificate_get_id_validity (cert); | ||
| 104 | - if (validity != GMIME_VALIDITY_FULL) return !! fprintf (stderr, "Got validity %d, expected %d\n", validity, GMIME_VALIDITY_FULL); | ||
| 105 | -#endif | ||
| 106 | -#ifdef CHECK_EMAIL | ||
| 107 | - const char *email = g_mime_certificate_get_email (cert); | ||
| 108 | - if (! email) return !! fprintf (stderr, "no email returned"); | ||
| 109 | - if (email[0] == '<') return 2; | ||
| 110 | -#endif | ||
| 111 | - return 0; | ||
| 112 | -} | ||
| 113 | -EOF | ||
| 114 | - | ||
| 115 | - # see https://github.com/jstedfast/gmime/pull/90 | ||
| 116 | - # should be fixed in GMime in 3.2.7, but some distros might patch | ||
| 117 | - printf "Checking for GMime X.509 certificate validity... " | ||
| 118 | - | ||
| 119 | - if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then | ||
| 120 | - printf 'No.\nCould not make tempdir for testing X.509 certificate validity support.\n' | ||
| 121 | - errors=$((errors + 1)) | ||
| 122 | - elif ${CC} -DCHECK_VALIDITY ${CFLAGS} ${gmime_cflags} _check_gmime_cert.c ${gmime_ldflags} -o _check_x509_validity \ | ||
| 123 | - && echo disable-crl-checks > "$TEMP_GPG/gpgsm.conf" \ | ||
| 124 | - && echo "4D:E0:FF:63:C0:E9:EC:01:29:11:C8:7A:EE:DA:3A:9A:7F:6E:C1:0D S" >> "$TEMP_GPG/trustlist.txt" \ | ||
| 125 | - && GNUPGHOME=${TEMP_GPG} gpgsm --batch --quiet --import < "$srcdir"/test/smime/ca.crt | ||
| 126 | - then | ||
| 127 | - if GNUPGHOME=${TEMP_GPG} ./_check_x509_validity; then | ||
| 128 | - gmime_x509_cert_validity=1 | ||
| 129 | - printf "Yes.\n" | ||
| 130 | - else | ||
| 131 | - gmime_x509_cert_validity=0 | ||
| 132 | - printf "No.\n" | ||
| 133 | - if pkg-config --exists "gmime-3.0 >= 3.2.7"; then | ||
| 134 | - cat <<EOF | ||
| 135 | -*** Error: GMime fails to calculate X.509 certificate validity, and | ||
| 136 | -is later than 3.2.7, which should have fixed this issue. | ||
| 137 | - | ||
| 138 | -Please follow up on https://github.com/jstedfast/gmime/pull/90 with | ||
| 139 | -more details. | ||
| 140 | -EOF | ||
| 141 | - errors=$((errors + 1)) | ||
| 142 | - fi | ||
| 143 | - fi | ||
| 144 | - printf "Checking whether GMime emits email addresses with angle brackets... " | ||
| 145 | - if ${CC} -DCHECK_EMAIL ${CFLAGS} ${gmime_cflags} _check_gmime_cert.c ${gmime_ldflags} -o _check_email && | ||
| 146 | - GNUPGHOME=${TEMP_GPG} ./_check_email; then | ||
| 147 | - gmime_emits_angle_brackets=0 | ||
| 148 | - printf "No.\n" | ||
| 149 | - else | ||
| 150 | - gmime_emits_angle_brackets=1 | ||
| 151 | - printf "Yes.\n" | ||
| 152 | - fi | ||
| 153 | - else | ||
| 154 | - printf 'No.\nFailed to set up gpgsm for testing X.509 certificate validity support.\n' | ||
| 155 | - errors=$((errors + 1)) | ||
| 156 | - fi | ||
| 157 | - if [ -n "$TEMP_GPG" -a -d "$TEMP_GPG" ]; then | ||
| 158 | - rm -rf "$TEMP_GPG" | ||
| 159 | - fi | ||
| 160 | - | ||
| 161 | - # see https://dev.gnupg.org/T3464 | ||
| 162 | - # there are problems verifying signatures when decrypting with session keys with GPGME 1.13.0 and 1.13.1 | ||
| 163 | - printf "Checking signature verification when decrypting using session keys... " | ||
| 164 | - | ||
| 165 | - cat > _verify_sig_with_session_key.c <<EOF | ||
| 166 | -#include <stdio.h> | ||
| 167 | -#include <gmime/gmime.h> | ||
| 168 | - | ||
| 169 | -int main () { | ||
| 170 | - GError *error = NULL; | ||
| 171 | - GMimeParser *parser = NULL; | ||
| 172 | - GMimeMultipartEncrypted *body = NULL; | ||
| 173 | - GMimeDecryptResult *result = NULL; | ||
| 174 | - GMimeSignatureList *sig_list = NULL; | ||
| 175 | - GMimeSignature *sig = NULL; | ||
| 176 | - GMimeObject *output = NULL; | ||
| 177 | - GMimeSignatureStatus status; | ||
| 178 | - int len; | ||
| 179 | - | ||
| 180 | - g_mime_init (); | ||
| 181 | - parser = g_mime_parser_new (); | ||
| 182 | - g_mime_parser_init_with_stream (parser, g_mime_stream_file_open("$srcdir/test/corpora/crypto/encrypted-signed.eml", "r", &error)); | ||
| 183 | - if (error) return !! fprintf (stderr, "failed to instantiate parser with test/corpora/pkcs7/smime-onepart-signed.eml\n"); | ||
| 184 | - | ||
| 185 | - body = GMIME_MULTIPART_ENCRYPTED(g_mime_message_get_mime_part (g_mime_parser_construct_message (parser, NULL))); | ||
| 186 | - if (body == NULL) return !! fprintf (stderr, "did not find a multipart/encrypted message\n"); | ||
| 187 | - | ||
| 188 | - output = g_mime_multipart_encrypted_decrypt (body, GMIME_DECRYPT_NONE, "9:9E1CDF53BBF794EA34F894B5B68E1E56FB015EA69F81D2A5EAB7F96C7B65783E", &result, &error); | ||
| 189 | - if (error || output == NULL) return !! fprintf (stderr, "decrypt failed\n"); | ||
| 190 | - | ||
| 191 | - sig_list = g_mime_decrypt_result_get_signatures (result); | ||
| 192 | - if (sig_list == NULL) return !! fprintf (stderr, "sig_list is NULL\n"); | ||
| 193 | - | ||
| 194 | - if (sig_list == NULL) return !! fprintf (stderr, "no GMimeSignatureList found\n"); | ||
| 195 | - len = g_mime_signature_list_length (sig_list); | ||
| 196 | - if (len != 1) return !! fprintf (stderr, "expected 1 signature, got %d\n", len); | ||
| 197 | - sig = g_mime_signature_list_get_signature (sig_list, 0); | ||
| 198 | - if (sig == NULL) return !! fprintf (stderr, "no GMimeSignature found at position 0\n"); | ||
| 199 | - status = g_mime_signature_get_status (sig); | ||
| 200 | - if (status & GMIME_SIGNATURE_STATUS_KEY_MISSING) return !! fprintf (stderr, "signature status contains KEY_MISSING (see https://dev.gnupg.org/T3464)\n"); | ||
| 201 | - | ||
| 202 | - return 0; | ||
| 203 | -} | ||
| 204 | -EOF | ||
| 205 | - if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then | ||
| 206 | - printf 'No.\nCould not make tempdir for testing signature verification when decrypting with session keys.\n' | ||
| 207 | - errors=$((errors + 1)) | ||
| 208 | - elif ${CC} ${CFLAGS} ${gmime_cflags} _verify_sig_with_session_key.c ${gmime_ldflags} -o _verify_sig_with_session_key \ | ||
| 209 | - && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < "$srcdir"/test/openpgp4-secret-key.asc \ | ||
| 210 | - && rm -f ${TEMP_GPG}/private-keys-v1.d/*.key | ||
| 211 | - then | ||
| 212 | - if GNUPGHOME=${TEMP_GPG} ./_verify_sig_with_session_key; then | ||
| 213 | - gmime_verify_with_session_key=1 | ||
| 214 | - printf "Yes.\n" | ||
| 215 | - else | ||
| 216 | - gmime_verify_with_session_key=0 | ||
| 217 | - printf "No.\n" | ||
| 218 | - cat <<EOF | ||
| 219 | -*** Error: GMime fails to verify signatures when decrypting with a session key. | ||
| 220 | - | ||
| 221 | -This is most likely due to a buggy version of GPGME, which should be fixed in 1.13.2 or later. | ||
| 222 | -See https://dev.gnupg.org/T3464 for more details. | ||
| 223 | -EOF | ||
| 224 | - fi | ||
| 225 | - else | ||
| 226 | - printf 'No.\nFailed to set up gpg for testing signature verification while decrypting with a session key.\n' | ||
| 227 | - errors=$((errors + 1)) | ||
| 228 | - fi | ||
| 229 | - if [ -n "$TEMP_GPG" -a -d "$TEMP_GPG" ]; then | ||
| 230 | - rm -rf "$TEMP_GPG" | ||
| 231 | - fi | ||
| 232 | else | ||
| 233 | have_gmime=0 | ||
| 234 | printf "No.\n" | ||
