if (asn1_unwrap(&blob, &blob) == ASN1_SEQUENCE)
{
- DBG2(DBG_ASN, "L%d - algorithmIdentifier:", level0);
+ if (level0 >= 0)
+ {
+ DBG2(DBG_ASN, "L%d - algorithmIdentifier:", level0);
+ }
if (asn1_unwrap(&blob, &object) == ASN1_OID)
{
- DBG2(DBG_ASN, "L%d - algorithm:", level0+1);
- asn1_debug_simple_object(object, ASN1_OID, FALSE);
+ if (level0 >= 0)
+ {
+ DBG2(DBG_ASN, "L%d - algorithm:", level0+1);
+ asn1_debug_simple_object(object, ASN1_OID, FALSE);
+ }
alg = asn1_known_oid(object);
if (blob.len)
{
- DBG2(DBG_ASN, "L%d - parameters:", level0+1);
- DBG3(DBG_ASN, "%B", &blob);
+ if (level0 >= 0)
+ {
+ DBG2(DBG_ASN, "L%d - parameters:", level0+1);
+ DBG3(DBG_ASN, "%B", &blob);
+ }
if (parameters)
{
*parameters = blob;
* Parses an ASN.1 algorithmIdentifier object
*
* @param blob ASN.1 coded blob
- * @param level0 top-most level offset
+ * @param level0 top-most level offset (-1 to suppress log messages)
* @param params returns optional [ASN.1 coded] parameters
* @return known OID index or OID_UNKNOWN
*/
parameters = chunk_empty;
if (i == 2)
{
- alg = asn1_parse_algorithmIdentifier(algid, 0, NULL);
+ alg = asn1_parse_algorithmIdentifier(algid, _i, NULL);
}
else
{
- alg = asn1_parse_algorithmIdentifier(algid, 0, ¶meters);
+ alg = asn1_parse_algorithmIdentifier(algid, _i, ¶meters);
if (test[i].empty)
{
ck_assert(parameters.len == 0 && parameters.ptr == NULL);
suite_add_tcase(s, tc);
tc = tcase_create("parse_algorithmIdentifier");
- tcase_add_test(tc, test_asn1_parse_algorithmIdentifier);
+ tcase_add_loop_test(tc, test_asn1_parse_algorithmIdentifier, -1, 1);
suite_add_tcase(s, tc);
tc = tcase_create("known_oid");