17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * src/lib/krb5/asn.1/asn1_get.h
3*1da57d55SToomas Soome  *
47c478bd9Sstevel@tonic-gate  * Copyright 1994 by the Massachusetts Institute of Technology.
57c478bd9Sstevel@tonic-gate  * All Rights Reserved.
67c478bd9Sstevel@tonic-gate  *
77c478bd9Sstevel@tonic-gate  * Export of this software from the United States of America may
87c478bd9Sstevel@tonic-gate  *   require a specific license from the United States Government.
97c478bd9Sstevel@tonic-gate  *   It is the responsibility of any person or organization contemplating
107c478bd9Sstevel@tonic-gate  *   export to obtain such a license before exporting.
11*1da57d55SToomas Soome  *
127c478bd9Sstevel@tonic-gate  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
137c478bd9Sstevel@tonic-gate  * distribute this software and its documentation for any purpose and
147c478bd9Sstevel@tonic-gate  * without fee is hereby granted, provided that the above copyright
157c478bd9Sstevel@tonic-gate  * notice appear in all copies and that both that copyright notice and
167c478bd9Sstevel@tonic-gate  * this permission notice appear in supporting documentation, and that
177c478bd9Sstevel@tonic-gate  * the name of M.I.T. not be used in advertising or publicity pertaining
187c478bd9Sstevel@tonic-gate  * to distribution of the software without specific, written prior
197c478bd9Sstevel@tonic-gate  * permission.  Furthermore if you modify this software you must label
207c478bd9Sstevel@tonic-gate  * your software as modified software and not distribute it in such a
217c478bd9Sstevel@tonic-gate  * fashion that it might be confused with the original M.I.T. software.
227c478bd9Sstevel@tonic-gate  * M.I.T. makes no representations about the suitability of
237c478bd9Sstevel@tonic-gate  * this software for any purpose.  It is provided "as is" without express
247c478bd9Sstevel@tonic-gate  * or implied warranty.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef __ASN1_GET_H__
287c478bd9Sstevel@tonic-gate #define __ASN1_GET_H__
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate /* ASN.1 substructure decoding procedures */
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include "k5-int.h"
337c478bd9Sstevel@tonic-gate #include "krbasn1.h"
347c478bd9Sstevel@tonic-gate #include "asn1buf.h"
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate typedef struct {
377c478bd9Sstevel@tonic-gate     asn1_class asn1class;
387c478bd9Sstevel@tonic-gate     asn1_construction construction;
397c478bd9Sstevel@tonic-gate     asn1_tagnum tagnum;
407c478bd9Sstevel@tonic-gate     unsigned int length;
417c478bd9Sstevel@tonic-gate     int indef;
427c478bd9Sstevel@tonic-gate } taginfo;
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate asn1_error_code asn1_get_tag_2 (asn1buf *buf, taginfo *tinfo);
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #if 0
477c478bd9Sstevel@tonic-gate asn1_error_code asn1_get_tag_indef
487c478bd9Sstevel@tonic-gate 	(asn1buf *buf,
497c478bd9Sstevel@tonic-gate 		   asn1_class *Class,
507c478bd9Sstevel@tonic-gate 		   asn1_construction *construction,
517c478bd9Sstevel@tonic-gate 		   asn1_tagnum *tagnum,
527c478bd9Sstevel@tonic-gate 		   unsigned int *retlen, int *indef);
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate asn1_error_code asn1_get_tag
557c478bd9Sstevel@tonic-gate 	(asn1buf *buf,
567c478bd9Sstevel@tonic-gate 		   asn1_class *Class,
577c478bd9Sstevel@tonic-gate 		   asn1_construction *construction,
587c478bd9Sstevel@tonic-gate 		   asn1_tagnum *tagnum,
597c478bd9Sstevel@tonic-gate 		   unsigned int *retlen);
607c478bd9Sstevel@tonic-gate /* requires  *buf is allocated
617c478bd9Sstevel@tonic-gate    effects   Decodes the tag in *buf.  If class != NULL, returns
627c478bd9Sstevel@tonic-gate               the class in *Class.  Similarly, the construction,
637c478bd9Sstevel@tonic-gate 	      tag number, and length are returned in *construction,
647c478bd9Sstevel@tonic-gate 	      *tagnum, and *retlen, respectively.
657c478bd9Sstevel@tonic-gate 	     If *buf is empty to begin with,
667c478bd9Sstevel@tonic-gate 	      *tagnum is set to ASN1_TAGNUM_CEILING.
677c478bd9Sstevel@tonic-gate 	     Returns ASN1_OVERRUN if *buf is exhausted during the parse. */
687c478bd9Sstevel@tonic-gate #endif
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate asn1_error_code asn1_get_sequence
717c478bd9Sstevel@tonic-gate 	(asn1buf *buf, unsigned int *retlen, int *indef);
727c478bd9Sstevel@tonic-gate /* requires  *buf is allocated
737c478bd9Sstevel@tonic-gate    effects   Decodes a tag from *buf and returns ASN1_BAD_ID if it
747c478bd9Sstevel@tonic-gate               doesn't have a sequence ID.  If retlen != NULL, the
757c478bd9Sstevel@tonic-gate 	      associated length is returned in *retlen. */
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate #endif
78