17 lines
438 B
C
17 lines
438 B
C
#include "asn1.h"
|
|
|
|
unsigned int scan_asn1ENUMERATED(const char* src,const char* max,unsigned long* l) {
|
|
unsigned int tmp;
|
|
unsigned long tag;
|
|
enum asn1_tagclass tc;
|
|
enum asn1_tagtype tt;
|
|
long ltmp;
|
|
if ((tmp=scan_asn1int(src,max,&tc,&tt,&tag,<mp)))
|
|
if (tc==UNIVERSAL && tt==PRIMITIVE && tag==ENUMERATED) {
|
|
if (ltmp<0 || src+tmp+ltmp>max) return 0;
|
|
*l=(unsigned long)ltmp;
|
|
return tmp;
|
|
}
|
|
return 0;
|
|
}
|