linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem with new X.509 is_hash_blacklisted() interface
@ 2017-05-27 15:05 James Bottomley
  2017-05-30 10:37 ` Ard Biesheuvel
  2017-06-20 16:09 ` David Howells
  0 siblings, 2 replies; 6+ messages in thread
From: James Bottomley @ 2017-05-27 15:05 UTC (permalink / raw)
  To: David Howells; +Cc: linux-efi, linux-kernel

Added by

commit 436529562df2748fd9918f578205b22cf8ced277
Author: David Howells <dhowells@redhat.com>
Date:   Mon Apr 3 16:07:25 2017 +0100

    X.509: Allow X.509 certs to be blacklisted
 
Ironically it duplicates a UEFI bug we've been struggling with for a
while in the pkcs11 handlers:  namely if you have a blacklist based on
certificate hashes, an interface which only takes a hash cannot
definitively tell you if the certificate is on the blacklist or not
because the hash the cert is blacklisted by may be a different
algorithm from the hash you feed in to is_hash_blacklisted().  This
means that the only safe way to use the interface is to construct every
possible hash of the cert and feed them one at a time into
is_hash_blacklisted().  This makes it an almost unusable API.

I suggest you deprecate this interface immediately and introduce an
is_cert_blacklisted() one which takes a pointer to the TBS data.  Then
the implementation can loop over the blacklists, see the hash type and
construct the hash of the TBS data for comparison (caching the hashes
for efficiency).  That way you'll be assured of a definitive answer and
an easy API.

It might be reasonable to cc linux-efi on future kernel keyring stuff,
because some of the other issues may have also come up in the UEFI
keyrings.

James

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

end of thread, other threads:[~2017-06-21 13:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-27 15:05 Problem with new X.509 is_hash_blacklisted() interface James Bottomley
2017-05-30 10:37 ` Ard Biesheuvel
2017-06-20 16:09 ` David Howells
2017-06-21 12:28   ` Ard Biesheuvel
2017-06-21 12:49   ` David Howells
2017-06-21 13:07     ` Ard Biesheuvel

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 NNTP newsgroup(s).