]> andersk Git - moira.git/commitdiff
encrypt ID if necessary to use as encryption key
authormar <mar>
Thu, 2 Jan 1992 17:30:45 +0000 (17:30 +0000)
committermar <mar>
Thu, 2 Jan 1992 17:30:45 +0000 (17:30 +0000)
reg_svr/reg_svr.c

index 2dc21565f7b76a8d833a59bd50d8382a2675b12c..9b89b1a9af16f80a64acc465583b29eff2582f5a 100644 (file)
@@ -172,8 +172,15 @@ int parse_encrypted(message,data)
        because of the DES encryption routines. */
     decrypt_len = (long)message->encrypted_len;
     
-    /* Get key from the one-way encrypted ID in the Moira database */
-    des_string_to_key(data->mit_id, key);
+    /* Get key from the possibly one-way encrypted ID in the Moira database */
+    if (data->mit_id[0] >= '0' && data->mit_id[0] <= '9') {
+       char buf[32];
+
+       EncryptID(buf, data->mit_id, message->first, message->last);
+       des_string_to_key(buf, key);
+    } else
+      des_string_to_key(data->mit_id, key);
+
     /* Get schedule from key */
     des_key_sched(key, sched);
     /* Decrypt information from packet using this key.  Since decrypt_len
This page took 0.041319 seconds and 5 git commands to generate.