Moved log message for unexpected ASN.1 objects to level 2.
[strongswan.git] / src / libstrongswan / asn1 / asn1_parser.c
index 5c9be2c..40e11b3 100644 (file)
@@ -120,7 +120,7 @@ METHOD(asn1_parser_t, iterate, bool,
        if ((obj.flags & ASN1_DEF) && (blob->len == 0 || *start_ptr != obj.type) )
        {
                /* field is missing */
-               DBG2(DBG_LIB, "L%d - %s:", level, obj.name);
+               DBG2(DBG_ASN, "L%d - %s:", level, obj.name);
                if (obj.type & ASN1_CONSTRUCTED)
                {
                        this->line++ ;  /* skip context-specific tag */
@@ -147,7 +147,7 @@ METHOD(asn1_parser_t, iterate, bool,
 
        if (blob->len < 2)
        {
-               DBG1(DBG_LIB, "L%d - %s:  ASN.1 object smaller than 2 octets",
+               DBG1(DBG_ASN, "L%d - %s:  ASN.1 object smaller than 2 octets",
                                        level, obj.name);
                this->success = FALSE;
                goto end;
@@ -157,7 +157,7 @@ METHOD(asn1_parser_t, iterate, bool,
 
        if (blob1->len == ASN1_INVALID_LENGTH)
        {
-               DBG1(DBG_LIB, "L%d - %s:  length of ASN.1 object invalid or too large",
+               DBG1(DBG_ASN, "L%d - %s:  length of ASN.1 object invalid or too large",
                                        level, obj.name);
                this->success = FALSE;
        }
@@ -170,7 +170,7 @@ METHOD(asn1_parser_t, iterate, bool,
 
        if (obj.flags & ASN1_RAW)
        {
-               DBG2(DBG_LIB, "L%d - %s:", level, obj.name);
+               DBG2(DBG_ASN, "L%d - %s:", level, obj.name);
                object->ptr = start_ptr;
                object->len = (size_t)(blob->ptr - start_ptr);
                goto end;
@@ -178,14 +178,14 @@ METHOD(asn1_parser_t, iterate, bool,
 
        if (*start_ptr != obj.type && !(this->implicit && this->line == 0))
        {
-               DBG1(DBG_LIB, "L%d - %s: ASN1 tag 0x%02x expected, but is 0x%02x",
+               DBG2(DBG_ASN, "L%d - %s: ASN1 tag 0x%02x expected, but is 0x%02x",
                                        level, obj.name, obj.type, *start_ptr);
-               DBG3(DBG_LIB, "%b", start_ptr, (u_int)(blob->ptr - start_ptr));
+               DBG3(DBG_ASN, "%b", start_ptr, (u_int)(blob->ptr - start_ptr));
                this->success = FALSE;
                goto end;
        }
 
-       DBG2(DBG_LIB, "L%d - %s:", level, obj.name);
+       DBG2(DBG_ASN, "L%d - %s:", level, obj.name);
 
        /* In case of "SEQUENCE OF" or "SET OF" start a loop */
        if (obj.flags & ASN1_LOOP)
@@ -214,11 +214,11 @@ METHOD(asn1_parser_t, iterate, bool,
                object->len = (size_t)(blob->ptr - start_ptr);
                if (this->private)
                {
-                       DBG4(DBG_LIB, "%B", object);
+                       DBG4(DBG_ASN, "%B", object);
                }
                else
                {
-                       DBG3(DBG_LIB, "%B", object);
+                       DBG3(DBG_ASN, "%B", object);
                }
        }
        else if (obj.flags & ASN1_BODY)
@@ -278,7 +278,7 @@ asn1_parser_t* asn1_parser_create(asn1Object_t const *objects, chunk_t blob)
                        .set_flags = _set_flags,
                        .success = _success,
                        .destroy = _destroy,
-               },              
+               },
                .objects = objects,
                .blobs[0] = blob,
                .line = -1,