]> git.ipfire.org Git - thirdparty/krb5.git/commit
Improve extended gic option support
authorGreg Hudson <ghudson@mit.edu>
Sat, 1 Mar 2014 05:35:50 +0000 (00:35 -0500)
committerGreg Hudson <ghudson@mit.edu>
Wed, 5 Mar 2014 21:48:50 +0000 (16:48 -0500)
commitc724843cb90cfed71d54eab94b68b0583c1d6dc5
tree5060aeaa8f07f514ffa665152fe96b02be0824b2
parent06817686bfdef99523f300464bcbb0c8b037a27d
Improve extended gic option support

The current extended gic option facility violates strict aliasing, is
not nestable (gic_opt_to_opte cannot be used on an extended options
structure casted back to krb5_get_init_creds_options), and requires
callers to use error-prone conversion functions.

Rewrite this code to use a new structure private to gic_opt.c, which
contains a krb5_get_init_creds_opt structure as its first member.  We
can cast between the extended structure and its first element without
violating strict aliasing (C99 6.7.2.1 paragraph 13 and the aggregate
type clause of 6.5 paragraph 7).  Define internal accessor functions
for the extended option fields.  Replace all uses of krb5_gic_opt_ext
in callers with krb5_get_init_creds_opt and the new accessors.  Bring
krb5_get_init_creds_opt_set_pa back into gic_opt.c (reverting
faa810c5b59fa33d9f7db837c5bb88df5436bb30) so that all of the code
which accesses the extended options structure can be in one file.

ticket: 6034
src/lib/krb5/krb/Makefile.in
src/lib/krb5/krb/deps
src/lib/krb5/krb/fast.c
src/lib/krb5/krb/fast.h
src/lib/krb5/krb/get_in_tkt.c
src/lib/krb5/krb/gic_opt.c
src/lib/krb5/krb/gic_opt_set_pa.c [deleted file]
src/lib/krb5/krb/gic_pwd.c
src/lib/krb5/krb/init_creds_ctx.h
src/lib/krb5/krb/int-proto.h
src/lib/krb5/krb/preauth2.c