[Nym3-commit] r18 - in trunk: . crypto

nym3-devel@lists.noreply.org nym3-devel@lists.noreply.org
Thu, 13 May 2004 15:54:20 +0200


Author: laurent
Date: 2004-05-13 15:54:20 +0200 (Thu, 13 May 2004)
New Revision: 18

Modified:
   trunk/crypto/test.ml
   trunk/message.ml
Log:
Make message.ml compile.


Modified: trunk/crypto/test.ml
===================================================================
--- trunk/crypto/test.ml	2004-05-13 12:47:00 UTC (rev 17)
+++ trunk/crypto/test.ml	2004-05-13 13:54:20 UTC (rev 18)
@@ -2,7 +2,7 @@
  * 
  * Copyright (C) Erik Arneson 2004
  *
- * $Id: test.ml,v 1.1 2004/04/27 04:49:09 erik Exp $ *)
+ * $Id$ *)
 
 open Cryptokit
 open Num
@@ -97,6 +97,8 @@
 	Printf.printf "# Ciphertext check: %s (lc: %d  lt: %d)\n"
 	  (if ct = key.cipher then "OK" else "NOT OK")
 	  (String.length key.cipher) (String.length ct);
+	  print_string ("Ciphertext is " ^ (unhex ct));
+	  print_string ("Key.cipher is " ^ (unhex key.cipher));
 	let pt1 = decrypt rsa_key ct in
 	  Printf.printf "# Decryption check: %s (lc: %d  lt: %d)\n"
 	    (if pt1 = key.message then "OK" else "NOT OK")

Modified: trunk/message.ml
===================================================================
--- trunk/message.ml	2004-05-13 12:47:00 UTC (rev 17)
+++ trunk/message.ml	2004-05-13 13:54:20 UTC (rev 18)
@@ -49,7 +49,7 @@
 
 (* maybe it is too vicious to replace 2serv by C (from the client) *)
 type command =
-    CommandC of command2serv
+    CommandC of command2server
   | CommandS of command2client
 
 type message = header * (command list)
@@ -58,8 +58,8 @@
   0,[];;
 
 let read_command_list s start =
-  let aux buffer start accu =
-    if start > (string_length buffer) then
+  let rec aux buffer start accu =
+    if start > (String.length buffer) then
       accu
     else
       let n,e = read_command buffer start in