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