• Mickaël Salaün's avatar
    certs: Fix blacklisted hexadecimal hash string check · 84ffbefd
    Mickaël Salaün authored
    When looking for a blacklisted hash, bin2hex() is used to transform a
    binary hash to an ascii (lowercase) hexadecimal string.  This string is
    then search for in the description of the keys from the blacklist
    keyring.  When adding a key to the blacklist keyring,
    blacklist_vet_description() checks the hash prefix and the hexadecimal
    string, but not that this string is lowercase.  It is then valid to set
    hashes with uppercase hexadecimal, which will be silently ignored by the
    kernel.
    
    Add an additional check to blacklist_vet_description() to check that
    hexadecimal strings are in lowercase.
    Signed-off-by: default avatarMickaël Salaün <mic@linux.microsoft.com>
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Reviewed-by: default avatarBen Boeckel <mathstuf@gmail.com>
    Cc: David Woodhouse <dwmw2@infradead.org>
    84ffbefd
blacklist.c 4.05 KB