unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: Daniel Kahn Gillmor <dkg@fifthhorseaman.net>
Subject: T355-smime.sh is flaky
Date: Tue, 10 Nov 2020 08:25:48 -0400	[thread overview]
Message-ID: <87h7pxiek3.fsf@tethera.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]


With the attached (the first test from T355-smime.sh) saved as foo.sh,
try running the following.

count=0; while ./foo.sh ; do
count=$((count + 1))
echo $count >> tests.log
done

After the somewhere between 1 and 200 iterations this hangs up for
me. Emacs is still running, the message-mode buffer has appropriate
looking stuff in it. There is nothing interesting in *Messages*, and the
buffer is still titled "*unsent mail*". When sending manually, I get
a message that there is no key for test_suite@notmuchmail.org

After digging through mml-secure for a while, I realized that the
problem is not actually in emacs, but in our test harness for gpgsm. I
added the gpgsm -K to the script, and you can see that the
test_suite@notmuchmail.org key is not being added.

I think that means there is some kind of intermittent failure with the
following pipeline
    
    openssl pkcs12 -export -passout pass: -inkey "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" \
	< "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
	gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
	      --disable-dirmngr --import  >"$GNUPGHOME"/import.log 2>&1 3<<<''

I've attached "import.log". I _think_ the failure reported is the
notmuchmail.org key, and the success is the 'Bob Babbage' key, 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: foo.sh --]
[-- Type: text/x-sh, Size: 637 bytes --]

#!/usr/bin/env bash

test_description='S/MIME signature verification and decryption'
. $(dirname "$0")/test-lib.sh || exit 1

test_require_external_prereq openssl
test_require_external_prereq gpgsm

FINGERPRINT=$(openssl x509 -sha1 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)

add_gpgsm_home

gpgsm -K

test_begin_subtest "emacs delivery of S/MIME signed message"
test_expect_success \
     'emacs_fcc_message \
     "test signed message 001" \
     "This is a test signed message." \
     "(let ((mml-secure-fail-when-key-problem t)) (mml-secure-message-sign \"smime\"))"'
test_done

[-- Attachment #3: import.log --]
[-- Type: application/octet-stream, Size: 1508 bytes --]

gpgsm: keybox '/tmp/notmuch-test-4077817.WrNIne/gnupg/pubring.kbx' created
gpgsm: 872 bytes of RC2 encrypted text
gpgsm: processing certBag
gpgsm: 1224 bytes of 3DES encrypted text
gpgsm: decryption failed; trying charset 'ISO-8859-1'
gpgsm: decryption failed; trying charset 'ISO-8859-15'
gpgsm: decryption failed; trying charset 'ISO-8859-2'
gpgsm: decryption failed; trying charset 'ISO-8859-3'
gpgsm: decryption failed; trying charset 'ISO-8859-4'
gpgsm: decryption failed; trying charset 'ISO-8859-5'
gpgsm: decryption failed; trying charset 'ISO-8859-6'
gpgsm: decryption failed; trying charset 'ISO-8859-7'
gpgsm: decryption failed; trying charset 'ISO-8859-8'
gpgsm: decryption failed; trying charset 'ISO-8859-9'
gpgsm: decryption failed; trying charset 'KOI8-R'
gpgsm: decryption failed; trying charset 'IBM437'
gpgsm: decryption failed; trying charset 'IBM850'
gpgsm: decryption failed; trying charset 'EUC-JP'
gpgsm: decryption failed; trying charset 'BIG5'
gpgsm: data error at "decrypted-text", offset 3448238404
gpgsm: error at "bag-sequence", offset 996
gpgsm: error parsing or decrypting the PKCS#12 file
gpgsm: total number processed: 1
gpgsm:               imported: 1
gpgsm: 1056 bytes of RC2 encrypted text
gpgsm: processing certBag
gpgsm: 1224 bytes of 3DES encrypted text
gpgsm: DBG: keygrip= D3 E5 44 6E 1D 01 22 86 F3 97 4B F4 BB CD 56 19 4A 2B E5 FC
gpgsm: total number processed: 2
gpgsm:               imported: 1
gpgsm:       secret keys read: 1
gpgsm:   secret keys imported: 1

[-- Attachment #4: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2020-11-10 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 12:25 David Bremner [this message]
2021-09-12  0:38 ` T355-smime.sh is flaky David Bremner
2021-10-02 11:44 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7pxiek3.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=dkg@fifthhorseaman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).