X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.orig;a=blobdiff_plain;f=util.h;h=246da381483c3d6fe939c6801e6681b42066c5c4;hp=f06288820865f3e10083310386d11b2e2883d8d0;hb=807a70e820e7e10df65ed14bc722b77b3f58c3df;hpb=2d03b9a4f3bfa3101c52a4fd0af72195f7c04772 diff --git a/util.h b/util.h index f062888..246da38 100644 --- a/util.h +++ b/util.h @@ -144,6 +144,10 @@ int sequenceInit(void **vqueue, uint64_t seqnum, int do_replay, int do_sequence, int wide_nums); +/* util_token.c */ +size_t +tokenSize(const gss_OID_desc *mech, size_t body_size); + /* Helper macros */ #define GSSEAP_CALLOC(count, size) (calloc((count), (size))) #define GSSEAP_FREE(ptr) (free((ptr))) @@ -218,4 +222,11 @@ load_uint64_be(const void *cvp) return ((uint64_t)load_uint32_be(p) << 32) | load_uint32_be(p + 4); } +static inline int +oidEqual(const gss_OID_desc *o1, const gss_OID_desc *o2) +{ + return (o1->length == o2->length && + memcmp(o1->elements, o2->elements, o1->length) == 0); +} + #endif /* _UTIL_H_ */