summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/pgp/pgp_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/pgp/pgp_utils.c')
-rw-r--r--src/libstrongswan/plugins/pgp/pgp_utils.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstrongswan/plugins/pgp/pgp_utils.c b/src/libstrongswan/plugins/pgp/pgp_utils.c
index 1658f3232..2d85cc0c8 100644
--- a/src/libstrongswan/plugins/pgp/pgp_utils.c
+++ b/src/libstrongswan/plugins/pgp/pgp_utils.c
@@ -79,7 +79,7 @@ bool pgp_read_scalar(chunk_t *blob, size_t bytes, u_int32_t *scalar)
if (bytes > blob->len)
{
- DBG1("PGP data too short to read %d byte scalar", bytes);
+ DBG1(DBG_LIB, "PGP data too short to read %d byte scalar", bytes);
return FALSE;
}
while (bytes-- > 0)
@@ -100,13 +100,13 @@ bool pgp_read_mpi(chunk_t *blob, chunk_t *mpi)
if (!pgp_read_scalar(blob, 2, &bits))
{
- DBG1("PGP data too short to read MPI length");
+ DBG1(DBG_LIB, "PGP data too short to read MPI length");
return FALSE;
}
bytes = (bits + 7) / 8;
if (bytes > blob->len)
{
- DBG1("PGP data too short to read %d byte MPI", bytes);
+ DBG1(DBG_LIB, "PGP data too short to read %d byte MPI", bytes);
return FALSE;
}
*mpi = chunk_create(blob->ptr, bytes);
@@ -146,7 +146,7 @@ bool pgp_read_packet(chunk_t *blob, chunk_t *data, pgp_packet_tag_t *tag)
if (!blob->len)
{
- DBG1("missing input");
+ DBG1(DBG_LIB, "missing input");
return FALSE;
}
t = blob->ptr[0];
@@ -154,27 +154,27 @@ bool pgp_read_packet(chunk_t *blob, chunk_t *data, pgp_packet_tag_t *tag)
/* bit 7 must be set */
if (!(t & 0x80))
{
- DBG1("invalid packet tag");
+ DBG1(DBG_LIB, "invalid packet tag");
return FALSE;
}
/* bit 6 set defines new packet format */
if (t & 0x40)
{
- DBG1("new PGP packet format not supported");
+ DBG1(DBG_LIB, "new PGP packet format not supported");
return FALSE;
}
t = (t & 0x3C) >> 2;
if (!pgp_old_packet_length(blob, &len) || len > blob->len)
{
- DBG1("invalid packet length");
+ DBG1(DBG_LIB, "invalid packet length");
return FALSE;
}
*data = chunk_create(blob->ptr, len);
*blob = chunk_skip(*blob, len);
*tag = t;
- DBG2("L1 - PGP %N (%u bytes)", pgp_packet_tag_names, t, len);
- DBG3("%B", data);
+ DBG2(DBG_LIB, "L1 - PGP %N (%u bytes)", pgp_packet_tag_names, t, len);
+ DBG3(DBG_LIB, "%B", data);
return TRUE;
}