Re: [PATCH 2/2] test/smime: fix signature verification test with newer gmime.

2022-04-11 Thread Daniel Kahn Gillmor
On Mon 2022-04-11 10:44:47 +0200, Michael J Gruber wrote:
> Just so that others don't have to be wondering, too: notmuch does not embed
> gmime sources and does not reuse them. (It would be very wrong to do so.)
> notmuch has a file `_check_gmime_cert.c` which is used for configure checks
> and which David cleverly amended to check for the return format of
> signature checks (when compiled against the libgmime3).

Yep, this is what i meant.

> If I read 2/2 correctly, though, then T355-smime does not adjust its
> expected textual outcome to the results of the check, but rather marks the
> test "known broken" if the signature check does not return the "new"
> format. In other words: Unless you have a very new unpatched gmime,
> T355-sime does not "really" do this subtest any more - it is happy as soon
> as it fails for any reason.

Exactly right.  Thanks for taking the time to explain it all in clearer
English than my rushed shorthand, Michael.

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 2/2] test/smime: fix signature verification test with newer gmime.

2022-04-11 Thread Michael J Gruber
Am Mo., 11. Apr. 2022 um 02:36 Uhr schrieb Daniel Kahn Gillmor <
d...@debian.org>:

> Thanks, Bremner!
>
> This series looks reasonable to me.  nice clever hack to reuse the
> gmime embedded .c source for the test.
>

Just so that others don't have to be wondering, too: notmuch does not embed
gmime sources and does not reuse them. (It would be very wrong to do so.)
notmuch has a file `_check_gmime_cert.c` which is used for configure checks
and which David cleverly amended to check for the return format of
signature checks (when compiled against the libgmime3).

If I read 2/2 correctly, though, then T355-smime does not adjust its
expected textual outcome to the results of the check, but rather marks the
test "known broken" if the signature check does not return the "new"
format. In other words: Unless you have a very new unpatched gmime,
T355-sime does not "really" do this subtest any more - it is happy as soon
as it fails for any reason.


> a bit of a tweak below:
>
> On Sat 2022-04-09 09:34:53 -0300, David Bremner wrote:
> > + printf "Checking for GMime new email format... "
> > + if ${CC} -DCHECK_EMAIL ${CFLAGS} ${gmime_cflags}
> _check_gmime_cert.c ${gmime_ldflags} -o _check_email &&
> > + GNUPGHOME=${TEMP_GPG} ./_check_email; then
> > + gmime_new_email_format=1
> > + printf "Yes.\n"
> > + else
> > + gmime_new_email_format=0
> > + printf "No (some tests will be skipped).\n"
> > + fi
> >  else
> >   printf 'No.\nFailed to set up gpgsm for testing X.509 certificate
> validity support.\n'
> >   errors=$((errors + 1))
>
> Words like "new" have a tendency to get, well, old.
>
> I'd say
>
>"Checking GMime emits email addresses from certs without angle
> brackets..."
>
> And i'd name the variable gmime_cert_addresses_have_angle_brackets (so
> "1" effectively means "probably a stale, deprecated version of GMime").
>
> Then change the rest of the tests to match.
>
> This is kind of an aesthetic choice -- i'd be fine with the original
> patch too.  but it seems safer to just identify the out-of-date stuff
> when it happens, rather than identifying the current stuff.
>
>   --dkg
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org
>
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 2/2] test/smime: fix signature verification test with newer gmime.

2022-04-10 Thread Daniel Kahn Gillmor
Thanks, Bremner!

This series looks reasonable to me.  nice clever hack to reuse the
gmime embedded .c source for the test.

a bit of a tweak below:

On Sat 2022-04-09 09:34:53 -0300, David Bremner wrote:
> + printf "Checking for GMime new email format... "
> + if ${CC} -DCHECK_EMAIL ${CFLAGS} ${gmime_cflags} _check_gmime_cert.c 
> ${gmime_ldflags} -o _check_email &&
> + GNUPGHOME=${TEMP_GPG} ./_check_email; then
> + gmime_new_email_format=1
> + printf "Yes.\n"
> + else
> + gmime_new_email_format=0
> + printf "No (some tests will be skipped).\n"
> + fi
>  else
>   printf 'No.\nFailed to set up gpgsm for testing X.509 certificate 
> validity support.\n'
>   errors=$((errors + 1))

Words like "new" have a tendency to get, well, old.

I'd say

   "Checking GMime emits email addresses from certs without angle brackets..."

And i'd name the variable gmime_cert_addresses_have_angle_brackets (so
"1" effectively means "probably a stale, deprecated version of GMime").

Then change the rest of the tests to match.

This is kind of an aesthetic choice -- i'd be fine with the original
patch too.  but it seems safer to just identify the out-of-date stuff
when it happens, rather than identifying the current stuff.

  --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org