Move DH parameter generation outside of TIDC Instance creation.
[trust_router.git] / tid / tidc.c
index 345c1b3..764990f 100644 (file)
 #include <tr_msg.h>
 #include <gsscon.h>
 
-/* char tmp_key[32] = 
-  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 
-   0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-   0x19, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
-*/
-
 int tmp_len = 32;
 
 TIDC_INSTANCE *tidc_create ()
@@ -60,16 +53,6 @@ TIDC_INSTANCE *tidc_create ()
   else
     return NULL;
 
- // TBD -- Add a flag, so we don't do this for the trust router */
-  if (NULL == (tidc->priv_dh = tr_create_dh_params(NULL, 0))) {
-    free (tidc);
-    return NULL;
-  }
-
-  fprintf(stderr, "TIDC DH Parameters:\n");
-  DHparams_print_fp(stdout, tidc->priv_dh);
-  fprintf(stderr, "\n");
-
   return tidc;
 }
 
@@ -134,8 +117,8 @@ int tidc_send_request (TIDC_INSTANCE *tidc,
   tid_req->realm = tr_new_name(realm);
   tid_req->comm = tr_new_name(comm);
 
-  tid_req->tidc_dh = tidc->priv_dh;
-  
+  tid_req->tidc_dh = tidc->client_dh;
+
   tid_req->resp_func = resp_handler;
   tid_req->cookie = cookie;