chiark / gitweb /
priv-cache etc.: private key algorithm is specified in key id
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Dec 2019 13:08:35 +0000 (13:08 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 17:08:52 +0000 (17:08 +0000)
commitdd32a22e6477486af0b545af58a3e929dee31a22
tree5b46418aa9612455da737c87a14eddb0fa7ce539
parentd759c2b60e26f9c26c48461e3fd0fb50a7b38005
priv-cache etc.: private key algorithm is specified in key id

The idea that we would try various different algorithms to see who
could load a private key was a remnant of a previous design of key id
system.  The actually implemnted arrangements identify the algorithm
in the key id, so there is no need for probing.

In this commit we fix the spec, and change the calling convention for
loadpriv.  Now that we only call loadpriv once, it is allowed to
modify the buffer contents (although nothing makes use of this
relaxation right now).

We change loadpriv's one call site in privcache.c and its (currently
only) implementation, in rsa.c.

In privcache, the error message now definitely means that the algid
was unrecognised, so change it.

In rsa.c we make the log level M_ERR unconditionally (although in fact
verror_tryload now always gets unsup==0).  We delete the now-unused
LDUNSUP from rsa.c, but there is some more intrusive refactoring to do
next to tidy up now-unused stuff.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
NOTES
privcache.c
rsa.c
secnet.h