xref: /titanic_44/usr/src/lib/gss_mechs/mech_krb5/krb5/asn.1/asn1_get.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 /*
4  * src/lib/krb5/asn.1/asn1_get.h
5  *
6  * Copyright 1994 by the Massachusetts Institute of Technology.
7  * All Rights Reserved.
8  *
9  * Export of this software from the United States of America may
10  *   require a specific license from the United States Government.
11  *   It is the responsibility of any person or organization contemplating
12  *   export to obtain such a license before exporting.
13  *
14  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
15  * distribute this software and its documentation for any purpose and
16  * without fee is hereby granted, provided that the above copyright
17  * notice appear in all copies and that both that copyright notice and
18  * this permission notice appear in supporting documentation, and that
19  * the name of M.I.T. not be used in advertising or publicity pertaining
20  * to distribution of the software without specific, written prior
21  * permission.  Furthermore if you modify this software you must label
22  * your software as modified software and not distribute it in such a
23  * fashion that it might be confused with the original M.I.T. software.
24  * M.I.T. makes no representations about the suitability of
25  * this software for any purpose.  It is provided "as is" without express
26  * or implied warranty.
27  */
28 
29 #ifndef __ASN1_GET_H__
30 #define __ASN1_GET_H__
31 
32 /* ASN.1 substructure decoding procedures */
33 
34 #include "k5-int.h"
35 #include "krbasn1.h"
36 #include "asn1buf.h"
37 
38 typedef struct {
39     asn1_class asn1class;
40     asn1_construction construction;
41     asn1_tagnum tagnum;
42     unsigned int length;
43     int indef;
44 } taginfo;
45 
46 asn1_error_code asn1_get_tag_2 (asn1buf *buf, taginfo *tinfo);
47 
48 #if 0
49 asn1_error_code asn1_get_tag_indef
50 	(asn1buf *buf,
51 		   asn1_class *Class,
52 		   asn1_construction *construction,
53 		   asn1_tagnum *tagnum,
54 		   unsigned int *retlen, int *indef);
55 
56 asn1_error_code asn1_get_tag
57 	(asn1buf *buf,
58 		   asn1_class *Class,
59 		   asn1_construction *construction,
60 		   asn1_tagnum *tagnum,
61 		   unsigned int *retlen);
62 /* requires  *buf is allocated
63    effects   Decodes the tag in *buf.  If class != NULL, returns
64               the class in *Class.  Similarly, the construction,
65 	      tag number, and length are returned in *construction,
66 	      *tagnum, and *retlen, respectively.
67 	     If *buf is empty to begin with,
68 	      *tagnum is set to ASN1_TAGNUM_CEILING.
69 	     Returns ASN1_OVERRUN if *buf is exhausted during the parse. */
70 #endif
71 
72 asn1_error_code asn1_get_sequence
73 	(asn1buf *buf, unsigned int *retlen, int *indef);
74 /* requires  *buf is allocated
75    effects   Decodes a tag from *buf and returns ASN1_BAD_ID if it
76               doesn't have a sequence ID.  If retlen != NULL, the
77 	      associated length is returned in *retlen. */
78 
79 #endif
80