]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Increased log level of several messages.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 26 May 2010 07:04:16 +0000 (09:04 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 3 Jun 2010 17:54:55 +0000 (19:54 +0200)
lib/opencdk/armor.c
lib/opencdk/read-packet.c
lib/opencdk/stream.c
lib/opencdk/write-packet.c

index ad8c165a23d2cee50ced189fd7abdb4a98aa6d14..07d24b914bf5a86ebeb9f410d8717e83479e3cad 100644 (file)
@@ -283,7 +283,7 @@ compress_get_algo (cdk_stream_t inp, int *r_zipalgo)
          pkttype = *plain & 0x40 ? (*plain & 0x3f) : ((*plain >> 2) & 0xf);
          if (pkttype == CDK_PKT_COMPRESSED && r_zipalgo)
            {
-             _cdk_log_debug ("armor compressed (algo=%d)\n", *(plain + 1));
+             _gnutls_buffers_log ("armor compressed (algo=%d)\n", *(plain + 1));
              *r_zipalgo = *(plain + 1);
            }
          break;
@@ -380,7 +380,7 @@ armor_encode (void *data, FILE * in, FILE * out)
       return CDK_Inv_Value;
     }
 
-  _cdk_log_debug ("armor filter: encode\n");
+  _gnutls_buffers_log ("armor filter: encode\n");
 
   memset (crcbuf, 0, sizeof (crcbuf));
 
@@ -499,7 +499,7 @@ armor_decode (void *data, FILE * in, FILE * out)
       return CDK_Inv_Value;
     }
 
-  _cdk_log_debug ("armor filter: decode\n");
+  _gnutls_buffers_log ("armor filter: decode\n");
 
   fseek (in, 0, SEEK_SET);
   /* Search the begin of the message */
@@ -596,7 +596,7 @@ armor_decode (void *data, FILE * in, FILE * out)
   afx->crc_okay = (afx->crc == crc2) ? 1 : 0;
   if (!afx->crc_okay && !rc)
     {
-      _cdk_log_debug ("file crc=%08X afx_crc=%08X\n", (unsigned int) crc2,
+      _gnutls_buffers_log ("file crc=%08X afx_crc=%08X\n", (unsigned int) crc2,
                      (unsigned int) afx->crc);
       rc = CDK_Armor_CRC_Error;
     }
@@ -724,7 +724,7 @@ _cdk_filter_armor (void *data, int ctl, FILE * in, FILE * out)
       armor_filter_t *afx = data;
       if (afx)
        {
-         _cdk_log_debug ("free armor filter\n");
+         _gnutls_buffers_log ("free armor filter\n");
          afx->idx = afx->idx2 = 0;
          afx->crc = afx->crc_okay = 0;
          return 0;
index c957a73908d0673092a18f9875b88de82c19fa23..21067c1c244628e4ae235d98e4b8fe5d91ef6762 100644 (file)
@@ -129,14 +129,14 @@ read_mpi (cdk_stream_t inp, bigint_t * ret_m, int secure)
 
   if (nbits > MAX_MPI_BITS || nbits == 0)
     {
-      _cdk_log_debug ("read_mpi: too large %d bits\n", (int) nbits);
+      _gnutls_write_log ("read_mpi: too large %d bits\n", (int) nbits);
       return CDK_MPI_Error;    /* Sanity check */
     }
 
   rc = stream_read (inp, buf + 2, nread, &nread);
   if (!rc && nread != ((nbits + 7) / 8))
     {
-      _cdk_log_debug ("read_mpi: too short %d < %d\n", (int) nread,
+      _gnutls_write_log ("read_mpi: too short %d < %d\n", (int) nread,
                      (int) ((nbits + 7) / 8));
       return CDK_MPI_Error;
     }
@@ -198,7 +198,7 @@ read_pubkey_enc (cdk_stream_t inp, size_t pktlen, cdk_pkt_pubkey_enc_t pke)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_pubkey_enc: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_pubkey_enc: %d octets\n", (int) pktlen);
 
   if (pktlen < 12)
     return CDK_Inv_Packet;
@@ -235,7 +235,7 @@ read_mdc (cdk_stream_t inp, cdk_pkt_mdc_t mdc)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_mdc:\n");
+    _gnutls_write_log ("read_mdc:\n");
 
   rc = stream_read (inp, mdc->hash, DIM (mdc->hash), &n);
   if (rc)
@@ -252,7 +252,7 @@ read_compressed (cdk_stream_t inp, size_t pktlen, cdk_pkt_compressed_t c)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_compressed: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_compressed: %d octets\n", (int) pktlen);
 
   c->algorithm = cdk_stream_getc (inp);
   if (c->algorithm > 3)
@@ -279,7 +279,7 @@ read_public_key (cdk_stream_t inp, size_t pktlen, cdk_pkt_pubkey_t pk)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_public_key: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_public_key: %d octets\n", (int) pktlen);
 
   pk->is_invalid = 1;          /* default to detect missing self signatures */
   pk->is_revoked = 0;
@@ -301,7 +301,7 @@ read_public_key (cdk_stream_t inp, size_t pktlen, cdk_pkt_pubkey_t pk)
   if (!npkey)
     {
       gnutls_assert ();
-      _cdk_log_debug ("invalid public key algorithm %d\n", pk->pubkey_algo);
+      _gnutls_write_log ("invalid public key algorithm %d\n", pk->pubkey_algo);
       return CDK_Inv_Algo;
     }
   for (i = 0; i < npkey; i++)
@@ -337,7 +337,7 @@ read_secret_key (cdk_stream_t inp, size_t pktlen, cdk_pkt_seckey_t sk)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_secret_key: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_secret_key: %d octets\n", (int) pktlen);
 
   p1 = cdk_stream_tell (inp);
   rc = read_public_key (inp, pktlen, sk->pk);
@@ -484,7 +484,7 @@ read_attribute (cdk_stream_t inp, size_t pktlen, cdk_pkt_userid_t attr)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_attribute: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_attribute: %d octets\n", (int) pktlen);
 
   strcpy (attr->name, "[attribute]");
   attr->len = strlen (attr->name);
@@ -553,7 +553,7 @@ read_user_id (cdk_stream_t inp, size_t pktlen, cdk_pkt_userid_t user_id)
     return CDK_Inv_Packet;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_user_id: %lu octets\n", pktlen);
+    _gnutls_write_log ("read_user_id: %lu octets\n", pktlen);
 
   user_id->len = pktlen;
   rc = stream_read (inp, user_id->name, pktlen, &nread);
@@ -578,7 +578,7 @@ read_subpkt (cdk_stream_t inp, cdk_subpkt_t * r_ctx, size_t * r_nbytes)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_subpkt:\n");
+    _gnutls_write_log ("read_subpkt:\n");
 
   n = 0;
   *r_nbytes = 0;
@@ -608,7 +608,7 @@ read_subpkt (cdk_stream_t inp, cdk_subpkt_t * r_ctx, size_t * r_nbytes)
   node->size = size;
   node->type = cdk_stream_getc (inp);
   if (DEBUG_PKT)
-    _cdk_log_debug (" %d octets %d type\n", node->size, node->type);
+    _gnutls_write_log (" %d octets %d type\n", node->size, node->type);
   n++;
   node->size--;
   rc = stream_read (inp, node->d, node->size, &nread);
@@ -631,7 +631,7 @@ read_onepass_sig (cdk_stream_t inp, size_t pktlen, cdk_pkt_onepass_sig_t sig)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_onepass_sig: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_onepass_sig: %d octets\n", (int) pktlen);
 
   if (pktlen != 13)
     return CDK_Inv_Packet;
@@ -730,7 +730,7 @@ read_signature (cdk_stream_t inp, size_t pktlen, cdk_pkt_signature_t sig)
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_signature: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_signature: %d octets\n", (int) pktlen);
 
   if (pktlen < 16)
     return CDK_Inv_Packet;
@@ -822,7 +822,7 @@ read_literal (cdk_stream_t inp, size_t pktlen,
     return CDK_Inv_Value;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("read_literal: %d octets\n", (int) pktlen);
+    _gnutls_write_log ("read_literal: %d octets\n", (int) pktlen);
 
   pt->mode = cdk_stream_getc (inp);
   if (pt->mode != 0x62 && pt->mode != 0x74 && pt->mode != 0x75)
index 4dfa8f1dbd259faa853865853e91ec021897375d..23931a843216723489b4f021d78818697ac9cd71 100644 (file)
@@ -84,7 +84,7 @@ _cdk_stream_open_mode (const char *file, const char *mode,
       return CDK_Inv_Value;
     }
 
-  _cdk_log_debug ("open stream `%s'\n", file);
+  _gnutls_read_log ("open stream `%s'\n", file);
   *ret_s = NULL;
   s = cdk_calloc (1, sizeof *s);
   if (!s)
@@ -107,7 +107,7 @@ _cdk_stream_open_mode (const char *file, const char *mode,
       gnutls_assert ();
       return CDK_File_Error;
     }
-  _cdk_log_debug ("open stream fd=%d\n", fileno (s->fp));
+  _gnutls_read_log ("open stream fd=%d\n", fileno (s->fp));
   s->flags.write = 0;
   *ret_s = s;
   return 0;
@@ -177,7 +177,7 @@ cdk_stream_new (const char *file, cdk_stream_t * ret_s)
       return CDK_Inv_Value;
     }
 
-  _cdk_log_debug ("new stream `%s'\n", file ? file : "[temp]");
+  _gnutls_read_log ("new stream `%s'\n", file ? file : "[temp]");
   *ret_s = NULL;
   s = cdk_calloc (1, sizeof *s);
   if (!s)
@@ -206,7 +206,7 @@ cdk_stream_new (const char *file, cdk_stream_t * ret_s)
       gnutls_assert ();
       return CDK_File_Error;
     }
-  _cdk_log_debug ("new stream fd=%d\n", fileno (s->fp));
+  _gnutls_read_log ("new stream fd=%d\n", fileno (s->fp));
   *ret_s = s;
   return 0;
 }
@@ -231,7 +231,7 @@ cdk_stream_create (const char *file, cdk_stream_t * ret_s)
       return CDK_Inv_Value;
     }
 
-  _cdk_log_debug ("create stream `%s'\n", file);
+  _gnutls_read_log ("create stream `%s'\n", file);
   *ret_s = NULL;
   s = cdk_calloc (1, sizeof *s);
   if (!s)
@@ -256,7 +256,7 @@ cdk_stream_create (const char *file, cdk_stream_t * ret_s)
       gnutls_assert ();
       return CDK_File_Error;
     }
-  _cdk_log_debug ("stream create fd=%d\n", fileno (s->fp));
+  _gnutls_read_log ("stream create fd=%d\n", fileno (s->fp));
   *ret_s = s;
   return 0;
 }
@@ -325,7 +325,7 @@ _cdk_stream_fpopen (FILE * fp, unsigned write_mode, cdk_stream_t * ret_out)
       return CDK_Out_Of_Core;
     }
 
-  _cdk_log_debug ("stream ref fd=%d\n", fileno (fp));
+  _gnutls_read_log ("stream ref fd=%d\n", fileno (fp));
   s->fp = fp;
   s->fp_ref = 1;
   s->flags.filtrated = 1;
@@ -459,7 +459,7 @@ cdk_stream_close (cdk_stream_t s)
       return CDK_Inv_Value;
     }
 
-  _cdk_log_debug ("close stream ref=%d `%s'\n",
+  _gnutls_read_log ("close stream ref=%d `%s'\n",
                  s->fp_ref, s->fname ? s->fname : "[temp]");
 
   /* In the user callback mode, we call the release cb if possible
@@ -483,7 +483,7 @@ cdk_stream_close (cdk_stream_t s)
     {
       int err;
 
-      _cdk_log_debug ("close stream fd=%d\n", fileno (s->fp));
+      _gnutls_read_log ("close stream fd=%d\n", fileno (s->fp));
       err = fclose (s->fp);
       s->fp = NULL;
       if (err)
@@ -756,7 +756,7 @@ stream_fp_replace (cdk_stream_t s, FILE ** tmp)
 
   assert (s);
 
-  _cdk_log_debug ("replace stream fd=%d with fd=%d\n",
+  _gnutls_read_log ("replace stream fd=%d with fd=%d\n",
                  fileno (s->fp), fileno (*tmp));
   rc = fclose (s->fp);
   if (rc)
@@ -792,7 +792,7 @@ stream_filter_write (cdk_stream_t s)
       if (!f->flags.enabled)
        continue;
       /* if there is no next filter, create the final output file */
-      _cdk_log_debug ("filter [write]: last filter=%d fname=%s\n",
+      _gnutls_read_log ("filter [write]: last filter=%d fname=%s\n",
                      f->next ? 1 : 0, s->fname);
       if (!f->next && s->fname)
        f->tmp = fopen (s->fname, "w+b");
@@ -813,14 +813,14 @@ stream_filter_write (cdk_stream_t s)
            break;
        }
       rc = f->fnct (f->opaque, f->ctl, s->fp, f->tmp);
-      _cdk_log_debug ("filter [write]: type=%d rc=%d\n", f->type, rc);
+      _gnutls_read_log ("filter [write]: type=%d rc=%d\n", f->type, rc);
       if (!rc)
        rc = stream_fp_replace (s, &f->tmp);
       if (!rc)
        rc = cdk_stream_seek (s, 0);
       if (rc)
        {
-         _cdk_log_debug ("filter [close]: fd=%d\n", fileno (f->tmp));
+         _gnutls_read_log ("filter [close]: fd=%d\n", fileno (f->tmp));
          fclose (f->tmp);
          break;
        }
@@ -851,7 +851,7 @@ stream_filter_read (cdk_stream_t s)
        continue;
       if (f->flags.error)
        {
-         _cdk_log_debug ("filter %s [read]: has the error flag; skipped\n",
+         _gnutls_read_log ("filter %s [read]: has the error flag; skipped\n",
                          s->fname ? s->fname : "[temp]");
          continue;
        }
@@ -863,7 +863,7 @@ stream_filter_read (cdk_stream_t s)
          break;
        }
       rc = f->fnct (f->opaque, f->ctl, s->fp, f->tmp);
-      _cdk_log_debug ("filter %s [read]: type=%d rc=%d\n",
+      _gnutls_read_log ("filter %s [read]: type=%d rc=%d\n",
                      s->fname ? s->fname : "[temp]", f->type, rc);
       if (rc)
        {
@@ -1059,7 +1059,7 @@ cdk_stream_write (cdk_stream_t s, const void *buf, size_t count)
          s->cache.alloced += (count + STREAM_BUFSIZE);
          memcpy (s->cache.buf, old, s->cache.size);
          cdk_free (old);
-         _cdk_log_debug ("stream: enlarge cache to %d octets\n",
+         _gnutls_read_log ("stream: enlarge cache to %d octets\n",
                          (int) s->cache.alloced);
        }
       memcpy (s->cache.buf + s->cache.size, buf, count);
@@ -1197,7 +1197,7 @@ cdk_stream_set_literal_flag (cdk_stream_t s, cdk_lit_format_t mode,
   struct stream_filter_s *f;
   const char *orig_fname;
 
-  _cdk_log_debug ("stream: enable literal mode.\n");
+  _gnutls_read_log ("stream: enable literal mode.\n");
 
   if (!s)
     {
@@ -1349,7 +1349,7 @@ cdk_stream_enable_cache (cdk_stream_t s, int val)
     {
       s->cache.buf = cdk_calloc (1, STREAM_BUFSIZE);
       s->cache.alloced = STREAM_BUFSIZE;
-      _cdk_log_debug ("stream: allocate cache of %d octets\n",
+      _gnutls_read_log ("stream: allocate cache of %d octets\n",
                      STREAM_BUFSIZE);
     }
   return 0;
@@ -1455,7 +1455,7 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len,
   /* Memory mapping is not supported on custom I/O objects. */
   if (s->cbs_hd)
     {
-      _cdk_log_debug ("cdk_stream_mmap_part: not supported on callbacks\n");
+      _gnutls_read_log ("cdk_stream_mmap_part: not supported on callbacks\n");
       gnutls_assert ();
       return CDK_Inv_Mode;
     }
@@ -1477,7 +1477,7 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len,
     len = cdk_stream_get_length (s);
   if (!len)
     {
-      _cdk_log_debug ("cdk_stream_mmap_part: invalid file size %lu\n", len);
+      _gnutls_read_log ("cdk_stream_mmap_part: invalid file size %lu\n", len);
       gnutls_assert ();
       return s->error;
     }
@@ -1579,7 +1579,7 @@ _cdk_stream_set_blockmode (cdk_stream_t s, size_t nbytes)
 {
   assert (s);
 
-  _cdk_log_debug ("stream: activate block mode with blocksize %d\n",
+  _gnutls_read_log ("stream: activate block mode with blocksize %d\n",
                  (int) nbytes);
   s->blkmode = nbytes;
   return 0;
index 2c8e71334e2d14f779ea545f9597edbdfeb1fe6f..265c40ddcb714f0f0a33e02b0ef0dd31c8348e42 100644 (file)
@@ -268,7 +268,7 @@ write_pubkey_enc (cdk_stream_t out, cdk_pkt_pubkey_enc_t pke, int old_ctb)
     return CDK_Inv_Algo;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_pubkey_enc:\n");
+    _gnutls_write_log ("write_pubkey_enc:\n");
 
   nenc = cdk_pk_get_nenc (pke->pubkey_algo);
   size = 10 + calc_mpisize (pke->mpi, nenc);
@@ -298,7 +298,7 @@ write_mdc (cdk_stream_t out, cdk_pkt_mdc_t mdc)
   assert (out);
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_mdc:\n");
+    _gnutls_write_log ("write_mdc:\n");
 
   /* This packet requires a fixed header encoding */
   rc = stream_putc (out, 0xD3);        /* packet ID and 1 byte length */
@@ -374,7 +374,7 @@ write_signature (cdk_stream_t out, cdk_pkt_signature_t sig, int old_ctb)
     return CDK_Inv_Packet;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_signature:\n");
+    _gnutls_write_log ("write_signature:\n");
 
   nsig = cdk_pk_get_nsig (sig->pubkey_algo);
   if (!nsig)
@@ -438,7 +438,7 @@ write_public_key (cdk_stream_t out, cdk_pkt_pubkey_t pk,
     return CDK_Inv_Packet;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_public_key: subkey=%d\n", is_subkey);
+    _gnutls_write_log ("write_public_key: subkey=%d\n", is_subkey);
 
   pkttype = is_subkey ? CDK_PKT_PUBLIC_SUBKEY : CDK_PKT_PUBLIC_KEY;
   npkey = cdk_pk_get_npkey (pk->pubkey_algo);
@@ -515,7 +515,7 @@ write_secret_key (cdk_stream_t out, cdk_pkt_seckey_t sk,
     return CDK_Inv_Packet;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_secret_key:\n");
+    _gnutls_write_log ("write_secret_key:\n");
 
   npkey = cdk_pk_get_npkey (pk->pubkey_algo);
   nskey = cdk_pk_get_nskey (pk->pubkey_algo);
@@ -629,7 +629,7 @@ write_compressed (cdk_stream_t out, cdk_pkt_compressed_t cd)
   assert (cd);
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("packet: write_compressed\n");
+    _gnutls_write_log ("packet: write_compressed\n");
 
   /* Use an old (RFC1991) header for this packet. */
   rc = pkt_write_head (out, 1, 0, CDK_PKT_COMPRESSED);
@@ -655,7 +655,7 @@ write_literal (cdk_stream_t out, cdk_pkt_literal_t pt, int old_ctb)
     return CDK_Inv_Packet;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_literal:\n");
+    _gnutls_write_log ("write_literal:\n");
 
   size = 6 + pt->namelen + pt->len;
   rc = pkt_write_head (out, old_ctb, size, CDK_PKT_LITERAL);
@@ -700,7 +700,7 @@ write_onepass_sig (cdk_stream_t out, cdk_pkt_onepass_sig_t sig)
     return CDK_Inv_Packet;
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_onepass_sig:\n");
+    _gnutls_write_log ("write_onepass_sig:\n");
 
   rc = pkt_write_head (out, 0, 13, CDK_PKT_ONEPASS_SIG);
   if (!rc)
@@ -773,7 +773,7 @@ cdk_pkt_write (cdk_stream_t out, cdk_packet_t pkt)
   if (!out || !pkt)
     return CDK_Inv_Value;
 
-  _cdk_log_debug ("write packet pkttype=%d\n", pkt->pkttype);
+  _gnutls_write_log ("write packet pkttype=%d\n", pkt->pkttype);
   switch (pkt->pkttype)
     {
     case CDK_PKT_LITERAL:
@@ -816,7 +816,7 @@ cdk_pkt_write (cdk_stream_t out, cdk_packet_t pkt)
     }
 
   if (DEBUG_PKT)
-    _cdk_log_debug ("write_packet rc=%d pkttype=%d\n", rc, pkt->pkttype);
+    _gnutls_write_log ("write_packet rc=%d pkttype=%d\n", rc, pkt->pkttype);
   return rc;
 }