]> git.ipfire.org Git - thirdparty/krb5.git/commit
Improve type safety of serialization code 1011/head
authorGreg Hudson <ghudson@mit.edu>
Tue, 3 Dec 2019 20:32:29 +0000 (15:32 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 6 Dec 2019 15:28:53 +0000 (10:28 -0500)
commit81e47875e3de0e52fbb11d61ef30a9406497af73
tree98dbcb5982bfbe05a5640870f09c7cc84586440a
parentab5c4259bdbe51dd3f4b5c5aff22628188d04322
Improve type safety of serialization code

Remove the serialization table from krb5_context, the functions to
find and register serializers, and the polymorphic serialization
functions.  Instead, directly call per-type serialization functions
for the type of object we need to serialize.

Remove the krb5_context parameter from most serialization functions as
the interfaces are not public and the context is not needed.

Remove the ccache, keytab, and rcache serialization handlers as they
were not used.

In t_ser.c, repeat the externalize-internalize-reexternalize logic for
each type, but simplify the code by aborting on failure and removing
the verbose flag.

The krb5_context and krb5_keyblock sizing functions both reported an
extra four bytes.  The new test program does not tolerate that
inconsistency, so fix them.
33 files changed:
src/include/k5-int.h
src/lib/gssapi/krb5/export_sec_context.c
src/lib/gssapi/krb5/gssapiP_krb5.h
src/lib/gssapi/krb5/gssapi_krb5.c
src/lib/gssapi/krb5/import_sec_context.c
src/lib/gssapi/krb5/ser_sctx.c
src/lib/kdb/keytab.c
src/lib/krb5/ccache/Makefile.in
src/lib/krb5/ccache/deps
src/lib/krb5/ccache/ser_cc.c [deleted file]
src/lib/krb5/keytab/kt_file.c
src/lib/krb5/keytab/kt_memory.c
src/lib/krb5/keytab/ktbase.c
src/lib/krb5/krb/authdata.c
src/lib/krb5/krb/copy_ctx.c
src/lib/krb5/krb/init_ctx.c
src/lib/krb5/krb/s4u_authdata.c
src/lib/krb5/krb/ser_actx.c
src/lib/krb5/krb/ser_adata.c
src/lib/krb5/krb/ser_addr.c
src/lib/krb5/krb/ser_auth.c
src/lib/krb5/krb/ser_cksum.c
src/lib/krb5/krb/ser_ctx.c
src/lib/krb5/krb/ser_key.c
src/lib/krb5/krb/ser_princ.c
src/lib/krb5/krb/serialize.c
src/lib/krb5/krb/t_copy_context.c
src/lib/krb5/krb/t_ser.c
src/lib/krb5/libkrb5.exports
src/lib/krb5/rcache/Makefile.in
src/lib/krb5/rcache/deps
src/lib/krb5/rcache/ser_rc.c [deleted file]
src/lib/krb5_32.def