=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tcfs/Attic/tcfs_keymaint.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/tcfs/Attic/tcfs_keymaint.c 2000/06/18 22:07:24 1.1 --- src/usr.bin/tcfs/Attic/tcfs_keymaint.c 2000/06/19 03:23:03 1.2 *************** *** 59,65 **** { int i = 0; char pass[_PASSWORD_LEN], *cypher; ! char tcfskey[KEYSIZE + 2]; des_key_schedule ks; int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE; --- 59,65 ---- { int i = 0; char pass[_PASSWORD_LEN], *cypher; ! char tcfskey[2*KEYSIZE]; des_key_schedule ks; int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE; *************** *** 68,75 **** strcpy (pass, pwd); ! if (uudecode ((char *)t, tcfskey, sizeof(tcfskey)) == -1) return 0; while (strlen (pass) < 8) { char tmp[_PASSWORD_LEN]; --- 68,77 ---- strcpy (pass, pwd); ! if (uudecode ((char *)t, tcfskey, sizeof(tcfskey)) == -1) { ! fprintf(stderr, "tcfs_decrypt_key: uudecode failed\n"); return 0; + } while (strlen (pass) < 8) { char tmp[_PASSWORD_LEN]; *************** *** 99,104 **** --- 101,108 ---- char pass[_PASSWORD_LEN]; des_key_schedule ks; int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE; + int uulen = (flag == GROUPKEY) ? UUGKEYSIZE : UUKEYSIZE; + int res; if (!ek) return 0; *************** *** 120,131 **** i++; } ! uuencode (key, keysize, ek, UUKEYSIZE); return 1; } ! int tcfs_user_enable(char *filesystem, uid_t user, u_char *key) { struct tcfs_args a; a.user = user; --- 124,140 ---- i++; } ! res = uuencode (key, keysize, ek, uulen + 1); ! if (res != uulen) { ! fprintf(stderr, "tcfs_encrypt_key: uuencode length wrong\n"); ! return (0); ! } return 1; } ! int ! tcfs_user_enable(char *filesystem, uid_t user, u_char *key) { struct tcfs_args a; a.user = user; *************** *** 134,140 **** return tcfs_callfunction(filesystem,&a); } ! int tcfs_user_disable(char *filesystem, uid_t user) { struct tcfs_args a; a.user = user; --- 143,150 ---- return tcfs_callfunction(filesystem,&a); } ! int ! tcfs_user_disable(char *filesystem, uid_t user) { struct tcfs_args a; a.user = user; *************** *** 142,148 **** return tcfs_callfunction(filesystem, &a); } ! int tcfs_proc_enable(char *filesystem, uid_t user, pid_t pid, char *key) { struct tcfs_args a; a.user = user; --- 152,159 ---- return tcfs_callfunction(filesystem, &a); } ! int ! tcfs_proc_enable(char *filesystem, uid_t user, pid_t pid, char *key) { struct tcfs_args a; a.user = user; *************** *** 152,158 **** return tcfs_callfunction(filesystem, &a); } ! int tcfs_proc_disable(char *filesystem, uid_t user, pid_t pid) { struct tcfs_args a; a.user = user; --- 163,170 ---- return tcfs_callfunction(filesystem, &a); } ! int ! tcfs_proc_disable(char *filesystem, uid_t user, pid_t pid) { struct tcfs_args a; a.user = user; *************** *** 161,168 **** return tcfs_callfunction(filesystem, &a); } ! int tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid, ! int tre, char *key) { struct tcfs_args a; a.cmd = TCFS_PUT_GIDKEY; --- 173,181 ---- return tcfs_callfunction(filesystem, &a); } ! int ! tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid, ! int tre, char *key) { struct tcfs_args a; a.cmd = TCFS_PUT_GIDKEY;