unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* T355-smime.sh is flaky
@ 2020-11-10 12:25 David Bremner
  2021-09-12  0:38 ` David Bremner
  2021-10-02 11:44 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: David Bremner @ 2020-11-10 12:25 UTC (permalink / raw)
  To: notmuch; +Cc: Daniel Kahn Gillmor

[-- 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 --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: T355-smime.sh is flaky
  2020-11-10 12:25 T355-smime.sh is flaky David Bremner
@ 2021-09-12  0:38 ` David Bremner
  2021-10-02 11:44 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2021-09-12  0:38 UTC (permalink / raw)
  To: notmuch; +Cc: Daniel Kahn Gillmor

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

David Bremner <david@tethera.net> writes:
> 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 wrote the output from openssl to a temporary file, and it appears that
sometimes (like the case I attached), this cannot be imported by "gpgsm
--import". It might be related to the existing bug report [1] from dkg.

One thing I noticed is that the debugging output has broken looking
offset in it.

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 2646783990
gpgsm: error at "bag-sequence", offset 996
gpgsm: error parsing or decrypting the PKCS#12 file
gpgsm: total number processed: 1
gpgsm:               imported: 1


[1]: https://dev.gnupg.org/T4751


[-- Attachment #2: bad.p12 --]
[-- Type: application/pkcs12, Size: 2381 bytes --]

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: T355-smime.sh is flaky
  2020-11-10 12:25 T355-smime.sh is flaky David Bremner
  2021-09-12  0:38 ` David Bremner
@ 2021-10-02 11:44 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2021-10-02 11:44 UTC (permalink / raw)
  To: notmuch; +Cc: Daniel Kahn Gillmor

David Bremner <david@tethera.net> writes:

> 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

Just for the record, this bug was fixed in 0.33.2

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-02 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10 12:25 T355-smime.sh is flaky David Bremner
2021-09-12  0:38 ` David Bremner
2021-10-02 11:44 ` David Bremner

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).