chiark / gitweb /
server/keymgmt.c: Refactor key loading.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 17 Apr 2013 19:51:01 +0000 (20:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 17 Apr 2013 19:51:01 +0000 (20:51 +0100)
commit4155aec42e2aa48af1ebe8f1197f58e2f5830ccf
tree68c3e6357102e3609966291b7180392c561bf49e
parentb2a72eca5851cfbd4146dd7e65867cd939b8f623
server/keymgmt.c: Refactor key loading.

The old code was rather formulaic and ripe for some abstraction.  The
new version is built out of some slightly hairy macros; the prototype is
in `udpkey'.  There is a small reduction in the raw size of the code,
but the main benefit is the better factoring.

Setting up of the public key slot `kd->kpub' is now done by the
individual methods rather than in `loadpriv'.  This makes it possible to
keep the on-error-cleanup code common between the private and public
key-loading methods, so we only need a single copy of the boilerplate.
There's still only one copy of this code in the source.
server/keymgmt.c