Skip to content

Commit

Permalink
Add cred marshalling functions
Browse files Browse the repository at this point in the history
Add a new file ccmarshal.c containing functions to marshal and
unmarshal credentials in file formats version 1-4.  These will replace
the functions in cc_file.c and cc_keyring.c, and can be used for KCM
in the future.
  • Loading branch information
greghudson committed May 17, 2014
1 parent 1263ed2 commit 99e1d7a
Show file tree
Hide file tree
Showing 3 changed files with 495 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/krb5/ccache/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ STLIBOBJS= \
cccursor.o \
ccdefault.o \
ccdefops.o \
ccmarshal.o \
ccselect.o \
ccselect_k5identity.o \
ccselect_realm.o \
Expand All @@ -37,6 +38,7 @@ OBJS= $(OUTPRE)ccbase.$(OBJEXT) \
$(OUTPRE)cccursor.$(OBJEXT) \
$(OUTPRE)ccdefault.$(OBJEXT) \
$(OUTPRE)ccdefops.$(OBJEXT) \
$(OUTPRE)ccmarshal.$(OBJEXT) \
$(OUTPRE)ccselect.$(OBJEXT) \
$(OUTPRE)ccselect_k5identity.$(OBJEXT) \
$(OUTPRE)ccselect_realm.$(OBJEXT) \
Expand All @@ -53,6 +55,7 @@ SRCS= $(srcdir)/ccbase.c \
$(srcdir)/cccursor.c \
$(srcdir)/ccdefault.c \
$(srcdir)/ccdefops.c \
$(srcdir)/ccmarshal.c \
$(srcdir)/ccselect.c \
$(srcdir)/ccselect_k5identity.c \
$(srcdir)/ccselect_realm.c \
Expand Down
16 changes: 16 additions & 0 deletions src/lib/krb5/ccache/cc-int.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,22 @@ krb5_error_code
ccselect_k5identity_initvt(krb5_context context, int maj_ver, int min_ver,
krb5_plugin_vtable vtable);

krb5_error_code
k5_unmarshal_cred(const unsigned char *data, size_t len, int version,
krb5_creds *creds);

krb5_error_code
k5_unmarshal_princ(const unsigned char *data, size_t len, int version,
krb5_principal *princ_out);

krb5_error_code
k5_marshal_cred(krb5_creds *creds, int version, unsigned char **bytes_out,
size_t *len_out);

krb5_error_code
k5_marshal_princ(krb5_principal princ, int version, unsigned char **bytes_out,
size_t *len_out);

/*
* Per-type ccache cursor.
*/
Expand Down

0 comments on commit 99e1d7a

Please sign in to comment.