Also log PGP parsing in ASN log group.

This commit is contained in:
Tobias Brunner
2011-12-16 16:44:38 +01:00
parent b6e0784385
commit cc4b48e886
2 changed files with 19 additions and 19 deletions
+10 -10
View File
@@ -286,18 +286,18 @@ static bool parse_public_key(private_pgp_cert_t *this, chunk_t packet)
}
break;
default:
DBG1(DBG_LIB, "PGP packet version V%d not supported",
DBG1(DBG_ASN, "PGP packet version V%d not supported",
this->version);
return FALSE;
}
if (this->valid)
{
DBG2(DBG_LIB, "L2 - created %T, valid %d days", &this->created, FALSE,
DBG2(DBG_ASN, "L2 - created %T, valid %d days", &this->created, FALSE,
this->valid);
}
else
{
DBG2(DBG_LIB, "L2 - created %T, never expires", &this->created, FALSE);
DBG2(DBG_ASN, "L2 - created %T, never expires", &this->created, FALSE);
}
DESTROY_IF(this->key);
this->key = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
@@ -318,13 +318,13 @@ static bool parse_public_key(private_pgp_cert_t *this, chunk_t packet)
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA1);
if (hasher == NULL)
{
DBG1(DBG_LIB, "no SHA-1 hasher available");
DBG1(DBG_ASN, "no SHA-1 hasher available");
return FALSE;
}
hasher->allocate_hash(hasher, pubkey_packet_header, NULL);
hasher->allocate_hash(hasher, pubkey_packet, &this->fingerprint);
hasher->destroy(hasher);
DBG2(DBG_LIB, "L2 - v4 fingerprint %#B", &this->fingerprint);
DBG2(DBG_ASN, "L2 - v4 fingerprint %#B", &this->fingerprint);
}
else
{
@@ -335,7 +335,7 @@ static bool parse_public_key(private_pgp_cert_t *this, chunk_t packet)
return FALSE;
}
this->fingerprint = chunk_clone(this->fingerprint);
DBG2(DBG_LIB, "L2 - v3 fingerprint %#B", &this->fingerprint);
DBG2(DBG_ASN, "L2 - v3 fingerprint %#B", &this->fingerprint);
}
return TRUE;
}
@@ -355,7 +355,7 @@ static bool parse_signature(private_pgp_cert_t *this, chunk_t packet)
/* we parse only v3 or v4 signature packets */
if (version != 3 && version != 4)
{
DBG2(DBG_LIB, "L2 - v%d signature ignored", version);
DBG2(DBG_ASN, "L2 - v%d signature ignored", version);
return TRUE;
}
if (version == 4)
@@ -364,7 +364,7 @@ static bool parse_signature(private_pgp_cert_t *this, chunk_t packet)
{
return FALSE;
}
DBG2(DBG_LIB, "L2 - v%d signature of type 0x%02x", version, type);
DBG2(DBG_ASN, "L2 - v%d signature of type 0x%02x", version, type);
}
else
{
@@ -377,7 +377,7 @@ static bool parse_signature(private_pgp_cert_t *this, chunk_t packet)
{
return FALSE;
}
DBG2(DBG_LIB, "L2 - v3 signature of type 0x%02x, created %T", type,
DBG2(DBG_ASN, "L2 - v3 signature of type 0x%02x, created %T", type,
&created, FALSE);
}
/* TODO: parse and save signature to a list */
@@ -391,7 +391,7 @@ static bool parse_user_id(private_pgp_cert_t *this, chunk_t packet)
{
DESTROY_IF(this->user_id);
this->user_id = identification_create_from_encoding(ID_KEY_ID, packet);
DBG2(DBG_LIB, "L2 - '%Y'", this->user_id);
DBG2(DBG_ASN, "L2 - '%Y'", this->user_id);
return TRUE;
}