[Spice-devel] [RFCv5 45/47] (temp) server/reds: DEBUG: add a define for working with no SSL (good for valgrind)

Alon Levy alevy at redhat.com
Sun May 8 06:11:41 PDT 2011


---
 server/reds.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index f977b4c..283b7be 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1417,7 +1417,9 @@ static int reds_send_link_ack(RedLinkInfo *link)
     SpiceLinkReply ack;
     Channel caps = { 0, };
     Channel *channel;
+#ifndef DEBUG_GENERATE_NULL_KEY
     BUF_MEM *bmBuf;
+#endif
     BIO *bio;
     int ret = FALSE;
 
@@ -1450,13 +1452,17 @@ static int reds_send_link_ack(RedLinkInfo *link)
         return FALSE;
     }
 
+#ifdef DEBUG_GENERATE_NULL_KEY
+    link->tiTicketing.rsa_size = SPICE_TICKET_KEY_PAIR_LENGTH / 8;
+    bzero(ack.pub_key, sizeof(ack.pub_key));
+#else
     RSA_generate_key_ex(link->tiTicketing.rsa, SPICE_TICKET_KEY_PAIR_LENGTH, link->tiTicketing.bn,
                         NULL);
     link->tiTicketing.rsa_size = RSA_size(link->tiTicketing.rsa);
-
     i2d_RSA_PUBKEY_bio(bio, link->tiTicketing.rsa);
     BIO_get_mem_ptr(bio, &bmBuf);
     memcpy(ack.pub_key, bmBuf->data, sizeof(ack.pub_key));
+#endif
 
     if (!sync_write(link->stream, &header, sizeof(header)))
         goto end;
@@ -1697,6 +1703,7 @@ static void reds_handle_link(RedLinkInfo *link)
 static void reds_handle_ticket(void *opaque)
 {
     RedLinkInfo *link = (RedLinkInfo *)opaque;
+#ifndef DEBUG_GENERATE_NULL_KEY
     char password[SPICE_MAX_PASSWORD_LENGTH];
     time_t ltime;
 
@@ -1724,6 +1731,7 @@ static void reds_handle_ticket(void *opaque)
             return;
         }
     }
+#endif
 
     reds_handle_link(link);
 }
-- 
1.7.5.1



More information about the Spice-devel mailing list