introduced ASN1_EXIT command in ASN.1 object syntax definition

This commit is contained in:
Andreas Steffen
2008-04-28 16:00:52 +00:00
parent 63cdbca211
commit 460025e253
13 changed files with 178 additions and 229 deletions
+5 -9
View File
@@ -45,11 +45,6 @@ struct private_asn1_parser_t {
*/
asn1Object_t const *objects;
/**
* Total number of syntax definition lines
*/
int roof;
/**
* Current syntax definition line
*/
@@ -98,12 +93,14 @@ static bool iterate(private_asn1_parser_t *this, int *objectID, chunk_t *object)
*object = chunk_empty;
/* Advance to the next object syntax definition line */
obj = this->objects[++(this->line)];
/* Terminate if the end of the object syntax definition has been reached */
if (++(this->line) >= this->roof)
if (obj.flags & ASN1_EXIT)
{
return FALSE;
}
obj = this->objects[this->line];
if (obj.flags & ASN1_END) /* end of loop or option found */
{
@@ -284,7 +281,7 @@ static void destroy(private_asn1_parser_t *this)
/**
* Defined in header.
*/
asn1_parser_t* asn1_parser_create(asn1Object_t const *objects, int roof, chunk_t blob)
asn1_parser_t* asn1_parser_create(asn1Object_t const *objects, chunk_t blob)
{
private_asn1_parser_t *this = malloc_thing(private_asn1_parser_t);
@@ -292,7 +289,6 @@ asn1_parser_t* asn1_parser_create(asn1Object_t const *objects, int roof, chunk_t
this->objects = objects;
this->blobs[0] = blob;
this->line = -1;
this->roof = roof;
this->success = TRUE;
this->public.iterate = (bool (*)(asn1_parser_t*, int*, chunk_t*))iterate;