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 */
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. */
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.",
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. */
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)