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>
Mon, 30 Dec 2019 13:15:50 +0000 (13:15 +0000)
commit8721ac4bacac8dd050235f79617daa9d64a52725
tree6e8c6da2ccfb775a39ba53af89138f964f3c1df3
parent140b4e1425d1b2b39ebb64b60851c81a3e15a6d0
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