asn1: Allow suppressing log messages when parsing algorithm identifiers
This commit is contained in:
@@ -648,18 +648,27 @@ int asn1_parse_algorithmIdentifier(chunk_t blob, int level0, chunk_t *parameters
|
||||
|
||||
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;
|
||||
|
||||
@@ -163,7 +163,7 @@ int asn1_unwrap(chunk_t *blob, chunk_t *content);
|
||||
* 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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user