2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2N/A#ifndef __KRBASN1_H__
2N/A#define __KRBASN1_H__
2N/A
2N/A#include "k5-int.h"
2N/A#include <stdio.h>
2N/A#include <errno.h>
2N/A#include <limits.h> /* For INT_MAX */
2N/A#ifdef HAVE_STDLIB_H
2N/A#include <stdlib.h>
2N/A#endif
2N/A
2N/A/*
2N/A * If KRB5_MSGTYPE_STRICT is defined, then be strict about checking
2N/A * the msgtype fields. Unfortunately, there old versions of Kerberos
2N/A * don't set these fields correctly, so we have to make allowances for
2N/A * them.
2N/A */
2N/A/* #define KRB5_MSGTYPE_STRICT */
2N/A
2N/A/*
2N/A * If KRB5_GENEROUS_LR_TYPE is defined, then we are generous about
2N/A * accepting a one byte negative lr_type - which is not sign
2N/A * extended. Prior to July 2000, we were sending a negative lr_type as
2N/A * a positve single byte value - instead of a signed integer. This
2N/A * allows us to receive the old value and deal
2N/A */
2N/A#define KRB5_GENEROUS_LR_TYPE
2N/A
2N/Atypedef krb5_octet asn1_octet;
2N/Atypedef krb5_error_code asn1_error_code;
2N/A
2N/Atypedef enum { PRIMITIVE = 0x00, CONSTRUCTED = 0x20 } asn1_construction;
2N/A
2N/Atypedef enum { UNIVERSAL = 0x00, APPLICATION = 0x40,
2N/A CONTEXT_SPECIFIC = 0x80, PRIVATE = 0xC0 } asn1_class;
2N/A
2N/Atypedef INT64_TYPE asn1_intmax;
2N/Atypedef UINT64_TYPE asn1_uintmax;
2N/A
2N/Atypedef int asn1_tagnum;
2N/A#define ASN1_TAGNUM_CEILING INT_MAX
2N/A#define ASN1_TAGNUM_MAX (ASN1_TAGNUM_CEILING-1)
2N/A
2N/A/* This is Kerberos Version 5 */
2N/A#define KVNO 5
2N/A
2N/A/* Universal Tag Numbers */
2N/A#define ASN1_BOOLEAN 1
2N/A#define ASN1_INTEGER 2
2N/A#define ASN1_BITSTRING 3
2N/A#define ASN1_OCTETSTRING 4
2N/A#define ASN1_NULL 5
2N/A#define ASN1_OBJECTIDENTIFIER 6
2N/A#define ASN1_ENUMERATED 10
2N/A#define ASN1_SEQUENCE 16
2N/A#define ASN1_SET 17
2N/A#define ASN1_PRINTABLESTRING 19
2N/A#define ASN1_IA5STRING 22
2N/A#define ASN1_UTCTIME 23
2N/A#define ASN1_GENERALTIME 24
2N/A#define ASN1_GENERALSTRING 27
2N/A
2N/A/* Kerberos Message Types */
2N/A#define ASN1_KRB_AS_REQ 10
2N/A#define ASN1_KRB_AS_REP 11
2N/A#define ASN1_KRB_TGS_REQ 12
2N/A#define ASN1_KRB_TGS_REP 13
2N/A#define ASN1_KRB_AP_REQ 14
2N/A#define ASN1_KRB_AP_REP 15
2N/A#define ASN1_KRB_SAFE 20
2N/A#define ASN1_KRB_PRIV 21
2N/A#define ASN1_KRB_CRED 22
2N/A#define ASN1_KRB_ERROR 30
2N/A
2N/A#endif