export_sec_context.c revision 159d09a20817016f09b3ea28d1bdada4a336bb91
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * Copyright 1995 by the Massachusetts Institute of Technology.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * All Rights Reserved.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * Export of this software from the United States of America may
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * require a specific license from the United States Government.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * It is the responsibility of any person or organization contemplating
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * export to obtain such a license before exporting.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * distribute this software and its documentation for any purpose and
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * without fee is hereby granted, provided that the above copyright
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * notice appear in all copies and that both that copyright notice and
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * this permission notice appear in supporting documentation, and that
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * the name of M.I.T. not be used in advertising or publicity pertaining
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * to distribution of the software without specific, written prior
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * permission. Furthermore if you modify this software you must label
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * your software as modified software and not distribute it in such a
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * fashion that it might be confused with the original M.I.T. software.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * M.I.T. makes no representations about the suitability of
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * this software for any purpose. It is provided "as is" without express
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * or implied warranty.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim * export_sec_context.c - Externalize the security context.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimkrb5_gss_export_sec_context(minor_status, context_handle, interprocess_token)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /* Assume a tragic failure */
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /* Determine size needed for externalization of context */
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim if ((kret = kg_ctx_size(context, (krb5_pointer) ctx,
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /* Allocate the buffer */
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim if ((obuffer = (krb5_octet *) xmalloc(bufsize)) == NULL) {
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /* Externalize the context */
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /* Success! Return the buffer */
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /* Now, clean up the context state */