2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2N/A * Copyright 1994, 2008 by the Massachusetts Institute of Technology. 2N/A * All Rights Reserved. 2N/A * Export of this software from the United States of America may 2N/A * require a specific license from the United States Government. 2N/A * It is the responsibility of any person or organization contemplating 2N/A * export to obtain such a license before exporting. 2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 2N/A * distribute this software and its documentation for any purpose and 2N/A * without fee is hereby granted, provided that the above copyright 2N/A * notice appear in all copies and that both that copyright notice and 2N/A * this permission notice appear in supporting documentation, and that 2N/A * the name of M.I.T. not be used in advertising or publicity pertaining 2N/A * to distribution of the software without specific, written prior 2N/A * permission. Furthermore if you modify this software you must label 2N/A * your software as modified software and not distribute it in such a 2N/A * fashion that it might be confused with the original M.I.T. software. 2N/A * M.I.T. makes no representations about the suitability of 2N/A * this software for any purpose. It is provided "as is" without express 2N/A * or implied warranty. 2N/A * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A/* Solaris Kerberos */ 2N/A/* setup *********************************************************/ 2N/A/* set up variables */ 2N/A * the setup* macros can return, but are always used at function start 2N/A * and thus need no malloc cleanup 2N/A/* helper macros for cleanup */ 2N/A/* alloc_field is the first thing to allocate storage that may need cleanup */ 2N/A * Allocate a principal and initialize enough fields for 2N/A * krb5_free_principal to have defined behavior. 2N/A/* process encoding header ***************************************/ 2N/A/* decode tag and check that it == [APPLICATION tagnum] */ 2N/A/* process a structure *******************************************/ 2N/A/* decode an explicit tag and place the number in tagnum */ 2N/A/* decode sequence header and initialize tagnum with the first field */ 2N/A/* process fields *******************************************/ 2N/A/* normal fields ************************/ 2N/A * Checks that the next tag is the expected one; returns with an error 2N/A * decode a field (<[UNIVERSAL id]> <length> <contents>) 2N/A * check that the id number == tagexpect then 2N/A/* decode (or skip, if not present) an optional field */ 2N/A/* field w/ accompanying length *********/ 2N/A/* decode a field w/ its length (for string types) */ 2N/A/* decode an optional field w/ length */ 2N/A/* clean up ******************************************************/ 2N/A/* to make things less painful, assume the cleanup is passed rep */ 2N/A /* Solaris Kerberos */ 2N/A /* Solaris Kerberos */ 2N/A * decode_krb5_safe_with_body 2N/A * Like decode_krb5_safe(), but grabs the encoding of the 2N/A * KRB-SAFE-BODY as well, in case re-encoding would produce a 2N/A * different encoding. (Yes, we're using DER, but there's this 2N/A * annoying problem with pre-1.3.x code using signed sequence numbers, 2N/A * which we permissively decode and cram into unsigned 32-bit numbers. 2N/A * When they're re-encoded, they're no longer negative if they started 2N/A * out negative, so checksum verification fails.) 2N/A * This does *not* perform any copying; the returned pointer to the 2N/A * encoded KRB-SAFE-BODY points into the input buffer. 2N/A * Gross kludge to extract pointer to encoded safe-body. Relies 2N/A * on tag prefetch done by next_tag(). Don't handle indefinite 2N/A * encoding, as it's too much work. 2N/A /* Despite the name, krb5_free_cred_enc_part is contents only. */ 2N/A#
endif /* DISABLE_PKINIT */