From: mar Date: Thu, 2 Jan 1992 17:30:45 +0000 (+0000) Subject: encrypt ID if necessary to use as encryption key X-Git-Tag: release77~621 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/4a1ed563d6c11858400220f53bab116a2626e59b encrypt ID if necessary to use as encryption key --- diff --git a/reg_svr/reg_svr.c b/reg_svr/reg_svr.c index 2dc21565..9b89b1a9 100644 --- a/reg_svr/reg_svr.c +++ b/reg_svr/reg_svr.c @@ -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