Skip to content
Snippets Groups Projects
Commit 6c27d51c authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Improved debug.

Rev: lib/modules/SSL.pmod/connection.pike:1.9
Rev: lib/modules/SSL.pmod/handshake.pike:1.11
Rev: lib/modules/SSL.pmod/sslfile.pike:1.13
parent 3af19039
No related branches found
Tags roxen/1.2.44
No related merge requests found
/* $Id: connection.pike,v 1.8 1998/05/20 23:13:52 grubba Exp $ /* $Id: connection.pike,v 1.9 1998/08/26 11:44:24 grubba Exp $
* *
* SSL packet layer * SSL packet layer
*/ */
...@@ -90,7 +90,11 @@ void send_packet(object packet, int|void priority) ...@@ -90,7 +90,11 @@ void send_packet(object packet, int|void priority)
PACKET_handshake : PRI_urgent, PACKET_handshake : PRI_urgent,
PACKET_application_data : PRI_application ])[packet->content_type]; PACKET_application_data : PRI_application ])[packet->content_type];
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror(sprintf("SSL.connection->send_packet: type %d, %d, '%s'\n", if (packet->content_type == 22)
werror(sprintf("SSL.connection->send_packet() called from:\n"
"%s\n", describe_backtrace(backtrace())));
werror(sprintf("SSL.connection->send_packet: type %d, %d, '%O'\n",
packet->content_type, priority, packet->fragment[..5])); packet->content_type, priority, packet->fragment[..5]));
#endif #endif
switch (priority) switch (priority)
......
/* $Id: handshake.pike,v 1.10 1998/08/26 07:10:36 nisse Exp $ /* $Id: handshake.pike,v 1.11 1998/08/26 11:42:44 grubba Exp $
* *
*/ */
...@@ -75,7 +75,7 @@ object server_hello_packet() ...@@ -75,7 +75,7 @@ object server_hello_packet()
string data = struct->pop_data(); string data = struct->pop_data();
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror(sprintf("SSL.handshake: Server hello: '%s'\n", data)); werror(sprintf("SSL.handshake: Server hello: '%O'\n", data));
#endif #endif
return handshake_packet(HANDSHAKE_server_hello, data); return handshake_packet(HANDSHAKE_server_hello, data);
} }
...@@ -157,8 +157,8 @@ int reply_new_session(array(int) cipher_suites, array(int) compression_methods) ...@@ -157,8 +157,8 @@ int reply_new_session(array(int) cipher_suites, array(int) compression_methods)
object s = context->rsa->raw_sign(digest); object s = context->rsa->raw_sign(digest);
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror(sprintf(" Digest: '%s'\n" werror(sprintf(" Digest: '%O'\n"
" Signature: '%s'\n", " Signature: '%O'\n",
digest, s->digits(256))); digest, s->digits(256)));
#endif #endif
...@@ -222,7 +222,7 @@ string server_derive_master_secret(string data) ...@@ -222,7 +222,7 @@ string server_derive_master_secret(string data)
{ {
/* Decrypt the pre_master_secret */ /* Decrypt the pre_master_secret */
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror(sprintf("encrypted premaster_secret: '%s'\n", data)); werror(sprintf("encrypted premaster_secret: '%O'\n", data));
#endif #endif
// trace(1); // trace(1);
string s = (temp_key || context->rsa)->decrypt(data); string s = (temp_key || context->rsa)->decrypt(data);
...@@ -260,7 +260,7 @@ string server_derive_master_secret(string data) ...@@ -260,7 +260,7 @@ string server_derive_master_secret(string data)
} }
} }
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
// werror(sprintf("master: '%s'\n", res)); // werror(sprintf("master: '%O'\n", res));
#endif #endif
return res; return res;
} }
...@@ -329,13 +329,13 @@ int handle_handshake(int type, string data, string raw) ...@@ -329,13 +329,13 @@ int handle_handshake(int type, string data, string raw)
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
if (strlen(id)) if (strlen(id))
werror(sprintf("SSL.handshake: Looking up session %s\n", id)); werror(sprintf("SSL.handshake: Looking up session %O\n", id));
#endif #endif
session = strlen(id) && context->lookup_session(id); session = strlen(id) && context->lookup_session(id);
if (session) if (session)
{ {
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror(sprintf("SSL.handshake: Reusing session %s\n", id)); werror(sprintf("SSL.handshake: Reusing session %O\n", id));
#endif #endif
/* Reuse session */ /* Reuse session */
reuse = 1; reuse = 1;
...@@ -560,7 +560,7 @@ int handle_handshake(int type, string data, string raw) ...@@ -560,7 +560,7 @@ int handle_handshake(int type, string data, string raw)
} }
} }
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
// werror(sprintf("SSL.handshake: messages = '%s'\n", handshake_messages)); // werror(sprintf("SSL.handshake: messages = '%O'\n", handshake_messages));
#endif #endif
return 0; return 0;
} }
......
/* $Id: sslfile.pike,v 1.12 1998/06/11 18:50:56 grubba Exp $ /* $Id: sslfile.pike,v 1.13 1998/08/26 11:43:40 grubba Exp $
* *
*/ */
...@@ -57,7 +57,7 @@ private int queue_write() ...@@ -57,7 +57,7 @@ private int queue_write()
if (stringp(data)) if (stringp(data))
write_buffer += data; write_buffer += data;
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror(sprintf("SSL.sslfile->queue_write: buffer = '%s'\n", write_buffer)); werror(sprintf("SSL.sslfile->queue_write: buffer = '%O'\n", write_buffer));
#endif #endif
if (catch { if (catch {
...@@ -127,7 +127,7 @@ private void ssl_read_callback(mixed id, string s) ...@@ -127,7 +127,7 @@ private void ssl_read_callback(mixed id, string s)
if (stringp(data)) if (stringp(data))
{ {
#ifdef SSL3_DEBUG #ifdef SSL3_DEBUG
werror(sprintf("SSL.sslfile->ssl_read_callback: application_data: '%s'\n", data)); werror(sprintf("SSL.sslfile->ssl_read_callback: application_data: '%O'\n", data));
#endif #endif
if (!connected && handshake_finished) if (!connected && handshake_finished)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment