From d8ffd27ca667751bc6b60b546224a80143c353fe Mon Sep 17 00:00:00 2001 From: mar Date: Tue, 13 Mar 1990 13:17:23 +0000 Subject: [PATCH] support for enrollment operations --- reg_svr/reg_svr.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/reg_svr/reg_svr.c b/reg_svr/reg_svr.c index 1b2b75ff..919eeef2 100644 --- a/reg_svr/reg_svr.c +++ b/reg_svr/reg_svr.c @@ -148,8 +148,8 @@ int parse_encrypted(message,data) zero and initializes all the fields of the formatted packet structure that depend on the encrypted information. */ { - C_Block key; /* The key for DES en/decryption */ - Key_schedule sched; /* En/decryption schedule */ + des_cblock key; /* The key for DES en/decryption */ + des_key_schedule sched; /* En/decryption schedule */ static char decrypt[BUFSIZ]; /* Buffer to hold decrypted information */ long decrypt_len; /* Length of decypted ID information */ char recrypt[14]; /* Buffer to hold re-encrypted information */ @@ -169,13 +169,14 @@ int parse_encrypted(message,data) decrypt_len = (long)message->encrypted_len; /* Get key from the one-way encrypted ID in the Moira database */ - string_to_key(data->mit_id, key); + des_string_to_key(data->mit_id, key); /* Get schedule from key */ - key_sched(key, sched); + des_key_sched(key, sched); /* Decrypt information from packet using this key. Since decrypt_len is an integral multiple of eight bytes, it will probably be null- padded. */ - pcbc_encrypt(message->encrypted,decrypt, decrypt_len, sched, key, DECRYPT); + des_pcbc_encrypt(message->encrypted, decrypt, decrypt_len, + sched, key, DES_DECRYPT); /* Extract the plain text and encrypted ID fields from the decrypted packet information. */ @@ -398,6 +399,9 @@ int verify_user(message,retval) case US_ENROLL_NOT_ALLOWED: status = UREG_ENROLL_NOT_ALLOWED; break; + case US_HALF_ENROLLED: + status = UREG_HALF_ENROLLED; + break; default: status = UREG_MISC_ERROR; critical_alert(FAIL_INST,"Bad user state %d for login %s.", @@ -718,7 +722,10 @@ int set_password(message,retval) is that he exists and has no password. */ if (status == SUCCESS) status = UREG_NO_LOGIN_YET; - if (status == UREG_NO_PASSWD_YET) + if (((int)message->request == UREG_SET_PASSWORD && + status == UREG_NO_PASSWD_YET) || + ((int)message->request == UREG_GET_KRB && + status == UREG_HALF_ENROLLED)) { /* User is in proper state for this transaction. */ @@ -825,6 +832,7 @@ char *retval; return(status); } q_argv[U_NAME+1] = login; + q_argv[U_STATE+1] = "7"; status = sms_query("update_user", U_MODTIME+1, q_argv, null_callproc, NULL); switch (status) -- 2.45.2