derparse.h revision 4bff34e37def8a90f9194d81bc345c52ba20086a
// Copyright (C) 2002 Microsoft Corporation
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS"
// WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
// OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY
//
// Date - 10/08/2002
// Author - Sanj Surati
/////////////////////////////////////////////////////////////
//
// DERPARSE.H
//
// SPNEGO Token Handler Header File
//
// Contains the definitions required to properly parse the
// SPNEGO DER encoding.
//
/////////////////////////////////////////////////////////////
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef __DERPARSE_H__
#define __DERPARSE_H__
// C++ Specific
#if defined(__cplusplus)
extern "C"
{
#endif
/* Identifier Types */
/* Encoding type */
/* Universal tags */
/* Length encoding */
//
// SPNEGO Token Parsing Constants
//
// Fixed Length of NegTokenInit ReqFlags field
#define SPNEGO_NEGINIT_MAXLEN_REQFLAGS 2
// Difference in bits for ReqFlags token
#define SPNEGO_NEGINIT_REQFLAGS_BITDIFF 1
// Fixed Length of NegTokenTarg NegResult field
#define SPNEGO_NEGTARG_MAXLEN_NEGRESULT 1
// Application Specific Construct - Always at the start of a NegTokenInit
// Constructed Sequence token - after the actual token identifier token
// MechList Type Identifier
//
// NegTokenInit - Token Identifier and Elements
//
// NegTokenInit - 0xa0
// Structure elements for NegTokenInit
// MechTypes element is 0xa0
// ReqFlags element is 0xa1
// MechToken element is 0xa2
// MechListMIC element is 0xa3
//
// NegTokenTarg - Token Identifier and Elements
//
// NegTokenTarg - 0xa1
// Structure elements for NegTokenTarg
// NegResult element is 0xa0
// SupportedMech element is 0xa1
// ResponseToken element is 0xa2
// MechListMIC element is 0xa3
//
// Defines a GSS Mechanism OID. We keep a single static array
// of these which we'll use for validation/searches/parsing.
//
typedef struct _mechOID
{
unsigned char* ucOid; // Byte representation of OID
int iLen; // Length of the OID, length and identifier
int iActualDataLen; // Length of the actual OID
} MECH_OID;
//
// ASN Der functions
//
long* pnNumLengthBytes );
long* pnTokenLength );
long* pnTokenLength );
int ASNDerCalcNumLengthBytes( long nLength );
unsigned char* pbTokenValue, long nLength );
// C++ Specific
#if defined(__cplusplus)
}
#endif
#endif