]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix warnings.
authorSimon Josefsson <simon@josefsson.org>
Wed, 12 Nov 2008 15:49:10 +0000 (16:49 +0100)
committerSimon Josefsson <simon@josefsson.org>
Wed, 12 Nov 2008 15:49:10 +0000 (16:49 +0100)
lib/ext_server_name.c
lib/gnutls_cipher.c
lib/gnutls_constate.c
lib/gnutls_extensions.c
lib/gnutls_handshake.c
lib/gnutls_record.c
lib/gnutls_supplemental.c
lib/gnutls_v2_compat.c

index 12c6fa449377b9d48c26c6321b2c3fd78dc01dad..9eab7e9db323788bc373a5aca71bd055f9228b1e 100644 (file)
@@ -82,7 +82,7 @@ _gnutls_server_name_recv_params (gnutls_session_t session,
            }
          else
            _gnutls_handshake_log
-             ("HSK[%x]: Received zero size server name (under attack?)\n",
+             ("HSK[%p]: Received zero size server name (under attack?)\n",
               session);
 
        }
@@ -92,7 +92,7 @@ _gnutls_server_name_recv_params (gnutls_session_t session,
       if (server_names > MAX_SERVER_NAME_EXTENSIONS)
        {
          _gnutls_handshake_log
-           ("HSK[%x]: Too many server names received (under attack?)\n",
+           ("HSK[%p]: Too many server names received (under attack?)\n",
             session);
          server_names = MAX_SERVER_NAME_EXTENSIONS;
        }
index 00a97584fd42f620686785707a0a97dddc878ddd..8defc2bff668f3d6909cad713dabdedb3a850a90 100644 (file)
@@ -515,7 +515,7 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
        {
          gnutls_assert ();
          _gnutls_record_log
-           ("REC[%x]: Short record length %d > %d - %d (under attack?)\n",
+           ("REC[%p]: Short record length %d > %d - %d (under attack?)\n",
             session, pad, ciphertext.size, hash_size);
          /* We do not fail here. We check below for the
           * the pad_failed. If zero means success.
index fc9757e8c0a6975b33d5c1558f14ba4e3a231ae8..521e55f54210208e022474637d03bc2aed1f7f85 100644 (file)
@@ -496,7 +496,7 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
   if (rc < 0)
     return rc;
 
-  _gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n",
+  _gnutls_handshake_log ("HSK[%p]: Cipher Suite: %s\n",
                         session,
                         _gnutls_cipher_suite_get_name
                         (&session->security_parameters.
@@ -532,7 +532,7 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
                               read_mac_algorithm);
 
   _gnutls_handshake_log
-    ("HSK[%x]: Initializing internal [read] cipher sessions\n", session);
+    ("HSK[%p]: Initializing internal [read] cipher sessions\n", session);
 
   switch (session->security_parameters.entity)
     {
@@ -677,7 +677,7 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
   if (rc < 0)
     return rc;
 
-  _gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n", session,
+  _gnutls_handshake_log ("HSK[%p]: Cipher Suite: %s\n", session,
                         _gnutls_cipher_suite_get_name
                         (&session->security_parameters.
                          current_cipher_suite));
@@ -714,7 +714,7 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
                               write_mac_algorithm);
 
   _gnutls_handshake_log
-    ("HSK[%x]: Initializing internal [write] cipher sessions\n", session);
+    ("HSK[%p]: Initializing internal [write] cipher sessions\n", session);
 
   switch (session->security_parameters.entity)
     {
index 16e58373d744fbe2edf5238777478bdc9e188007..0e705a178c22b5a3427179136fb7d3cf03a87cbf 100644 (file)
@@ -133,7 +133,7 @@ _gnutls_parse_extensions (gnutls_session_t session,
       type = _gnutls_read_uint16 (&data[pos]);
       pos += 2;
 
-      _gnutls_debug_log ("EXT[%x]: Received extension '%s/%d'\n", session,
+      _gnutls_debug_log ("EXT[%p]: Received extension '%s/%d'\n", session,
                         _gnutls_extension_get_name (type), type);
 
       if ((ret = _gnutls_extension_list_check (session, type)) < 0)
@@ -249,7 +249,7 @@ _gnutls_gen_extensions (gnutls_session_t session, opaque * data,
           */
          _gnutls_extension_list_add (session, p->type);
 
-         _gnutls_debug_log ("EXT[%x]: Sending extension %s\n",
+         _gnutls_debug_log ("EXT[%p]: Sending extension %s\n",
                             session, p->name);
        }
       else if (size < 0)
index c9c4b1ef8d6fe508398e9344f3b51d5b5c465859..8efd7827707a9d1d69fdd662a41ed3f26f81da52 100644 (file)
@@ -54,7 +54,7 @@
 #include <random.h>
 
 #ifdef HANDSHAKE_DEBUG
-#define ERR(x, y) _gnutls_handshake_log( "HSK[%x]: %s (%d)\n", session, x,y)
+#define ERR(x, y) _gnutls_handshake_log("HSK[%p]: %s (%d)\n", session, x,y)
 #else
 #define ERR(x, y)
 #endif
@@ -362,7 +362,7 @@ _gnutls_read_client_hello (gnutls_session_t session, opaque * data,
     }
   DECR_LEN (len, 2);
 
-  _gnutls_handshake_log ("HSK[%x]: Client's version: %d.%d\n", session,
+  _gnutls_handshake_log ("HSK[%p]: Client's version: %d.%d\n", session,
                         data[pos], data[pos + 1]);
 
   adv_version = _gnutls_version_get (data[pos], data[pos + 1]);
@@ -735,13 +735,13 @@ _gnutls_server_select_suite (gnutls_session_t session, opaque * data,
     }
 #ifdef HANDSHAKE_DEBUG
 
-  _gnutls_handshake_log ("HSK[%x]: Requested cipher suites: \n", session);
+  _gnutls_handshake_log ("HSK[%p]: Requested cipher suites: \n", session);
   for (j = 0; j < datalen; j += 2)
     {
       memcpy (&cs.suite, &data[j], 2);
       _gnutls_handshake_log ("\t%s\n", _gnutls_cipher_suite_get_name (&cs));
     }
-  _gnutls_handshake_log ("HSK[%x]: Supported cipher suites: \n", session);
+  _gnutls_handshake_log ("HSK[%p]: Supported cipher suites: \n", session);
   for (j = 0; j < x; j++)
     _gnutls_handshake_log ("\t%s\n",
                           _gnutls_cipher_suite_get_name (&ciphers[j]));
@@ -759,7 +759,7 @@ _gnutls_server_select_suite (gnutls_session_t session, opaque * data,
              memcpy (&cs.suite, &data[j], 2);
 
              _gnutls_handshake_log
-               ("HSK[%x]: Selected cipher suite: %s\n", session,
+               ("HSK[%p]: Selected cipher suite: %s\n", session,
                 _gnutls_cipher_suite_get_name (&cs));
              memcpy (session->security_parameters.current_cipher_suite.suite,
                      ciphers[i].suite, 2);
@@ -803,7 +803,7 @@ finish:
     {
 
       _gnutls_handshake_log
-       ("HSK[%x]: Cannot find the appropriate handler for the KX algorithm\n",
+       ("HSK[%p]: Cannot find the appropriate handler for the KX algorithm\n",
         session);
       gnutls_assert ();
       return GNUTLS_E_INTERNAL_ERROR;
@@ -846,7 +846,7 @@ _gnutls_server_select_comp_method (gnutls_session_t session,
              gnutls_free (comps);
 
              _gnutls_handshake_log
-               ("HSK[%x]: Selected Compression Method: %s\n", session,
+               ("HSK[%p]: Selected Compression Method: %s\n", session,
                 gnutls_compression_get_name (session->internals.
                                              compression_method));
 
@@ -960,7 +960,7 @@ _gnutls_send_handshake (gnutls_session_t session, void *i_data,
   if (i_datasize > 0)
     memcpy (&data[pos], i_data, i_datasize);
 
-  _gnutls_handshake_log ("HSK[%x]: %s was send [%ld bytes]\n",
+  _gnutls_handshake_log ("HSK[%p]: %s was send [%ld bytes]\n",
                         session, _gnutls_handshake2str (type),
                         (long) datasize);
 
@@ -1021,7 +1021,7 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
        {
          gnutls_assert ();
          _gnutls_handshake_log
-           ("HSK[%x]: Handshake type mismatch (under attack?)\n", session);
+           ("HSK[%p]: Handshake type mismatch (under attack?)\n", session);
          return GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET;
        }
 
@@ -1088,7 +1088,7 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
       length32 = _gnutls_read_uint24 (&dataptr[1]);
       handshake_header_size = HANDSHAKE_HEADER_SIZE;
 
-      _gnutls_handshake_log ("HSK[%x]: %s was received [%ld bytes]\n",
+      _gnutls_handshake_log ("HSK[%p]: %s was received [%ld bytes]\n",
                             session, _gnutls_handshake2str (dataptr[0]),
                             length32 + HANDSHAKE_HEADER_SIZE);
 
@@ -1101,7 +1101,7 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
 
       *recv_type = dataptr[0];
 
-      _gnutls_handshake_log ("HSK[%x]: %s(v2) was received [%ld bytes]\n",
+      _gnutls_handshake_log ("HSK[%p]: %s(v2) was received [%ld bytes]\n",
                             session, _gnutls_handshake2str (*recv_type),
                             length32 + handshake_header_size);
 
@@ -1342,7 +1342,7 @@ _gnutls_client_set_ciphersuite (gnutls_session_t session, opaque suite[2])
 
   memcpy (session->security_parameters.current_cipher_suite.suite, suite, 2);
 
-  _gnutls_handshake_log ("HSK[%x]: Selected cipher suite: %s\n", session,
+  _gnutls_handshake_log ("HSK[%p]: Selected cipher suite: %s\n", session,
                         _gnutls_cipher_suite_get_name
                         (&session->security_parameters.
                          current_cipher_suite));
@@ -1375,7 +1375,7 @@ _gnutls_client_set_ciphersuite (gnutls_session_t session, opaque suite[2])
     {
 
       _gnutls_handshake_log
-       ("HSK[%x]: Cannot find the appropriate handler for the KX algorithm\n",
+       ("HSK[%p]: Cannot find the appropriate handler for the KX algorithm\n",
         session);
       gnutls_assert ();
       return GNUTLS_E_INTERNAL_ERROR;
@@ -1436,9 +1436,9 @@ _gnutls_client_check_if_resuming (gnutls_session_t session,
 {
   opaque buf[2 * TLS_MAX_SESSION_ID_SIZE + 1];
 
-  _gnutls_handshake_log ("HSK[%x]: SessionID length: %d\n", session,
+  _gnutls_handshake_log ("HSK[%p]: SessionID length: %d\n", session,
                         session_id_len);
-  _gnutls_handshake_log ("HSK[%x]: SessionID: %s\n", session,
+  _gnutls_handshake_log ("HSK[%p]: SessionID: %s\n", session,
                         _gnutls_bin2hex (session_id, session_id_len, buf,
                                          sizeof (buf)));
 
@@ -1491,7 +1491,7 @@ _gnutls_read_server_hello (gnutls_session_t session,
       return GNUTLS_E_UNEXPECTED_PACKET_LENGTH;
     }
 
-  _gnutls_handshake_log ("HSK[%x]: Server's version: %d.%d\n",
+  _gnutls_handshake_log ("HSK[%p]: Server's version: %d.%d\n",
                         session, data[pos], data[pos + 1]);
 
   DECR_LEN (len, 2);
@@ -1962,7 +1962,7 @@ _gnutls_send_server_hello (gnutls_session_t session, int again)
        }
       pos += session_id_len;
 
-      _gnutls_handshake_log ("HSK[%x]: SessionID: %s\n", session,
+      _gnutls_handshake_log ("HSK[%p]: SessionID: %s\n", session,
                             _gnutls_bin2hex (SessionID, session_id_len,
                                              buf, sizeof (buf)));
 
@@ -2164,7 +2164,7 @@ _gnutls_send_supplemental (gnutls_session_t session, int again)
 {
   int ret = 0;
 
-  _gnutls_debug_log ("EXT[%x]: Sending supplemental data\n", session);
+  _gnutls_debug_log ("EXT[%p]: Sending supplemental data\n", session);
 
   if (again)
     ret = _gnutls_send_handshake (session, NULL, 0,
@@ -2196,7 +2196,7 @@ _gnutls_recv_supplemental (gnutls_session_t session)
   int datalen = 0;
   int ret;
 
-  _gnutls_debug_log ("EXT[%x]: Expecting supplemental data\n", session);
+  _gnutls_debug_log ("EXT[%p]: Expecting supplemental data\n", session);
 
   ret = _gnutls_recv_handshake (session, &data, &datalen,
                                GNUTLS_HANDSHAKE_SUPPLEMENTAL,
@@ -2318,7 +2318,7 @@ _gnutls_handshake_client (gnutls_session_t session)
   char buf[64];
 
   if (session->internals.resumed_security_parameters.session_id_size > 0)
-    _gnutls_handshake_log ("HSK[%x]: Ask to resume: %s\n", session,
+    _gnutls_handshake_log ("HSK[%p]: Ask to resume: %s\n", session,
                           _gnutls_bin2hex (session->internals.
                                            resumed_security_parameters.
                                            session_id,
@@ -2954,7 +2954,7 @@ _gnutls_remove_unwanted_ciphersuites (gnutls_session_t session,
       if (delete == 0)
        {
 
-         _gnutls_handshake_log ("HSK[%x]: Keeping ciphersuite: %s\n",
+         _gnutls_handshake_log ("HSK[%p]: Keeping ciphersuite: %s\n",
                                 session,
                                 _gnutls_cipher_suite_get_name (&cs));
 
@@ -2963,7 +2963,7 @@ _gnutls_remove_unwanted_ciphersuites (gnutls_session_t session,
        }
       else
        {
-         _gnutls_handshake_log ("HSK[%x]: Removing ciphersuite: %s\n",
+         _gnutls_handshake_log ("HSK[%p]: Removing ciphersuite: %s\n",
                                 session,
                                 _gnutls_cipher_suite_get_name (&cs));
 
index 091728a351360d54f988e0042bc9cfc7443e1fae..96d2630d05e102f6c257f5e79fa0a7440c975388 100644 (file)
@@ -370,7 +370,7 @@ _gnutls_send_int (gnutls_session_t session, content_type_t type,
 
 
   _gnutls_record_log
-    ("REC[%x]: Sending Packet[%d] %s(%d) with length: %d\n", session,
+    ("REC[%p]: Sending Packet[%d] %s(%d) with length: %d\n", session,
      (int) _gnutls_uint64touint32 (&session->connection_state.
                                   write_sequence_number),
      _gnutls_packet2str (type), type, sizeofdata);
@@ -464,7 +464,7 @@ _gnutls_send_int (gnutls_session_t session, content_type_t type,
 
   session->internals.record_send_buffer_user_size = 0;
 
-  _gnutls_record_log ("REC[%x]: Sent Packet[%d] %s(%d) with length: %d\n",
+  _gnutls_record_log ("REC[%p]: Sent Packet[%d] %s(%d) with length: %d\n",
                      session,
                      (int)
                      _gnutls_uint64touint32
@@ -482,7 +482,7 @@ _gnutls_send_change_cipher_spec (gnutls_session_t session, int again)
 {
   static const opaque data[1] = { GNUTLS_TYPE_CHANGE_CIPHER_SPEC };
 
-  _gnutls_handshake_log ("REC[%x]: Sent ChangeCipherSpec\n", session);
+  _gnutls_handshake_log ("REC[%p]: Sent ChangeCipherSpec\n", session);
 
   if (again == 0)
     return _gnutls_send_int (session, GNUTLS_CHANGE_CIPHER_SPEC, -1, data, 1);
@@ -587,7 +587,7 @@ record_check_headers (gnutls_session_t session,
        */
       session->internals.v2_hello = *length;
 
-      _gnutls_record_log ("REC[%x]: V2 packet received. Length: %d\n",
+      _gnutls_record_log ("REC[%p]: V2 packet received. Length: %d\n",
                          session, *length);
 
     }
@@ -622,7 +622,7 @@ record_check_version (gnutls_session_t session,
        {
          gnutls_assert ();
          _gnutls_record_log
-           ("REC[%x]: INVALID VERSION PACKET: (%d) %d.%d\n", session,
+           ("REC[%p]: INVALID VERSION PACKET: (%d) %d.%d\n", session,
             htype, version[0], version[1]);
          return GNUTLS_E_UNSUPPORTED_VERSION_PACKET;
        }
@@ -636,7 +636,7 @@ record_check_version (gnutls_session_t session,
        * mac. I don't really think that this check serves any purpose.
        */
       gnutls_assert ();
-      _gnutls_record_log ("REC[%x]: INVALID VERSION PACKET: (%d) %d.%d\n",
+      _gnutls_record_log ("REC[%p]: INVALID VERSION PACKET: (%d) %d.%d\n",
                          session, htype, version[0], version[1]);
 
       return GNUTLS_E_UNSUPPORTED_VERSION_PACKET;
@@ -670,7 +670,7 @@ record_check_type (gnutls_session_t session,
        case GNUTLS_ALERT:
 
          _gnutls_record_log
-           ("REC[%x]: Alert[%d|%d] - %s - was received\n", session,
+           ("REC[%p]: Alert[%d|%d] - %s - was received\n", session,
             data[0], data[1], gnutls_alert_get_name ((int) data[1]));
 
          session->internals.last_alert = data[1];
@@ -771,7 +771,7 @@ record_check_type (gnutls_session_t session,
        default:
 
          _gnutls_record_log
-           ("REC[%x]: Received Unknown packet %d expecting %d\n",
+           ("REC[%p]: Received Unknown packet %d expecting %d\n",
             session, recv_type, type);
 
          gnutls_assert ();
@@ -938,11 +938,11 @@ begin:
     }
 
   _gnutls_record_log
-    ("REC[%x]: Expected Packet[%d] %s(%d) with length: %d\n", session,
+    ("REC[%p]: Expected Packet[%d] %s(%d) with length: %d\n", session,
      (int) _gnutls_uint64touint32 (&session->connection_state.
                                   read_sequence_number),
      _gnutls_packet2str (type), type, sizeofdata);
-  _gnutls_record_log ("REC[%x]: Received Packet[%d] %s(%d) with length: %d\n",
+  _gnutls_record_log ("REC[%p]: Received Packet[%d] %s(%d) with length: %d\n",
                      session,
                      (int)
                      _gnutls_uint64touint32 (&session->connection_state.
@@ -952,7 +952,7 @@ begin:
   if (length > MAX_RECV_SIZE)
     {
       _gnutls_record_log
-       ("REC[%x]: FATAL ERROR: Received packet with length: %d\n",
+       ("REC[%p]: FATAL ERROR: Received packet with length: %d\n",
         session, length);
 
       session_unresumable (session);
@@ -1011,7 +1011,7 @@ begin:
     {
 
       _gnutls_record_log
-       ("REC[%x]: ChangeCipherSpec Packet was received\n", session);
+       ("REC[%p]: ChangeCipherSpec Packet was received\n", session);
 
       if ((size_t) ret != sizeofdata)
        {                       /* sizeofdata should be 1 */
@@ -1024,7 +1024,7 @@ begin:
     }
 
   _gnutls_record_log
-    ("REC[%x]: Decrypted Packet[%d] %s(%d) with length: %d\n", session,
+    ("REC[%p]: Decrypted Packet[%d] %s(%d) with length: %d\n", session,
      (int) _gnutls_uint64touint32 (&session->connection_state.
                                   read_sequence_number),
      _gnutls_packet2str (recv_type), recv_type, decrypted_length);
index f0ea269dd79cb8455448484dc1bf5e6786ad4e45..b8c732c37e063f2a94d45ab68b4e5fa1c1ea03d9 100644 (file)
@@ -140,7 +140,7 @@ _gnutls_gen_supplemental (gnutls_session_t session, gnutls_buffer * buf)
   buf->data[1] = ((buf->length - 3) >> 8) & 0xFF;
   buf->data[2] = (buf->length - 3) & 0xFF;
 
-  _gnutls_debug_log ("EXT[%x]: Sending %d bytes of supplemental data\n",
+  _gnutls_debug_log ("EXT[%p]: Sending %d bytes of supplemental data\n",
                     session, buf->length);
 
   return buf->length;
@@ -178,7 +178,7 @@ _gnutls_parse_supplemental (gnutls_session_t session,
       supp_data_length = _gnutls_read_uint16 (p);
       p += 2;
 
-      _gnutls_debug_log ("EXT[%x]: Got supplemental type=%02x length=%d\n",
+      _gnutls_debug_log ("EXT[%p]: Got supplemental type=%02x length=%d\n",
                         session, supp_data_type, supp_data_length);
 
       recv_func = get_supp_func_recv (supp_data_type);
index 0579fd67210ec1c767fe991deefcb7c65cae4993..577e949821e8c1f5f7531ac32487f3924d48363d 100644 (file)
@@ -51,7 +51,7 @@ _gnutls_handshake_select_v2_suite (gnutls_session_t session,
   opaque *_data;
   int _datalen;
 
-  _gnutls_handshake_log ("HSK[%x]: Parsing a version 2.0 client hello.\n",
+  _gnutls_handshake_log ("HSK[%p]: Parsing a version 2.0 client hello.\n",
                         session);
 
   _data = gnutls_malloc (datalen);
@@ -110,7 +110,7 @@ _gnutls_read_client_hello_v2 (gnutls_session_t session, opaque * data,
   DECR_LEN (len, 2);
 
   _gnutls_handshake_log
-    ("HSK[%x]: SSL 2.0 Hello: Client's version: %d.%d\n", session,
+    ("HSK[%p]: SSL 2.0 Hello: Client's version: %d.%d\n", session,
      data[pos], data[pos + 1]);
 
   set_adv_version (session, data[pos], data[pos + 1]);
@@ -198,7 +198,7 @@ _gnutls_read_client_hello_v2 (gnutls_session_t session, opaque * data,
     {
 
       _gnutls_handshake_log
-       ("HSK[%x]: SSL 2.0 Hello: Cannot find the appropriate handler for the KX algorithm\n",
+       ("HSK[%p]: SSL 2.0 Hello: Cannot find the appropriate handler for the KX algorithm\n",
         session);
 
       gnutls_assert ();