From: Glenn Morris <rgm@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Emacs developers <emacs-devel@gnu.org>,
Noam Postavsky <npostavs@users.sourceforge.net>
Subject: Re: master 583995c: GnuTLS HMAC and symmetric cipher support
Date: Mon, 17 Jul 2017 17:37:51 -0400 [thread overview]
Message-ID: <n9zic2agnk.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <f9d2b34e-b131-9bf5-e9d5-3c3cfefc9ef3@cs.ucla.edu> (Paul Eggert's message of "Mon, 17 Jul 2017 12:44:09 -0700")
Paul Eggert wrote:
>> gnutls_mac_get_name and gnutls_digest_get_name can
>> also apparently return NULL
>
> As I recall, they can't return NULL in the contexts where they're
> used, as a previous call already established the validities of their
> arguments.
It's not obvious to me that 2 and 3 below are any different to 1, save
for the fact that GNUTLS_CIPHER_NULL == 1 (and GNUTLS_CIPHER_UNKNOWN ==
0, which is maybe what happens to stop 2 and 3 crashing in the same way
1 does. Seems a bit like a happy accident?):
1. Fgnutls_ciphers. Can intern NULL and crash.
const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list ();
for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++)
{
gnutls_cipher_algorithm_t gca = gciphers[pos];
Lisp_Object cipher_symbol = intern (gnutls_cipher_get_name (gca));
...
}
2. Fgnutls_macs.
const gnutls_mac_algorithm_t *macs = gnutls_mac_list ();
for (ptrdiff_t pos = 0; macs[pos] != 0; pos++)
{
const gnutls_mac_algorithm_t gma = macs[pos];
Lisp_Object gma_symbol = intern (gnutls_mac_get_name (gma));
...
}
3. Fgnutls_digests.
const gnutls_digest_algorithm_t *digests = gnutls_digest_list ();
for (ptrdiff_t pos = 0; digests[pos] != 0; pos++)
{
const gnutls_digest_algorithm_t gda = digests[pos];
Lisp_Object gda_symbol = intern (gnutls_digest_get_name (gda));
...
}
next prev parent reply other threads:[~2017-07-17 21:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170714150706.13106.18905@vcs0.savannah.gnu.org>
[not found] ` <20170714150707.5E9B322DF8@vcs0.savannah.gnu.org>
2017-07-17 0:05 ` master 583995c: GnuTLS HMAC and symmetric cipher support Glenn Morris
2017-07-17 14:18 ` Ted Zlatanov
2017-07-17 14:30 ` Michael Albinus
2017-07-17 14:50 ` Ted Zlatanov
2017-07-17 18:22 ` Michael Albinus
2017-07-17 17:12 ` Glenn Morris
2017-07-17 17:19 ` Noam Postavsky
2017-07-17 18:20 ` Glenn Morris
2017-07-17 18:45 ` Noam Postavsky
2017-07-17 19:27 ` Glenn Morris
2017-07-17 19:44 ` Paul Eggert
2017-07-17 21:37 ` Glenn Morris [this message]
2017-07-17 21:58 ` Paul Eggert
2017-07-17 22:14 ` Glenn Morris
2017-07-18 0:59 ` Paul Eggert
2017-07-18 2:33 ` Glenn Morris
2017-07-18 7:45 ` Paul Eggert
2017-07-18 18:44 ` Glenn Morris
2017-07-18 20:44 ` Paul Eggert
2017-07-18 21:02 ` Glenn Morris
2017-07-18 21:16 ` Paul Eggert
2017-07-18 21:29 ` Glenn Morris
2017-07-23 19:18 ` Ted Zlatanov
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=n9zic2agnk.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=npostavs@users.sourceforge.net \
/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://git.savannah.gnu.org/cgit/emacs.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).