[BACK]Return to tcfs_keymaint.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tcfs

Diff for /src/usr.bin/tcfs/Attic/tcfs_keymaint.c between version 1.1 and 1.2

version 1.1, 2000/06/18 22:07:24 version 1.2, 2000/06/19 03:23:03
Line 59 
Line 59 
 {  {
         int i = 0;          int i = 0;
         char pass[_PASSWORD_LEN], *cypher;          char pass[_PASSWORD_LEN], *cypher;
         char tcfskey[KEYSIZE + 2];          char tcfskey[2*KEYSIZE];
         des_key_schedule ks;          des_key_schedule ks;
         int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE;          int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE;
   
Line 68 
Line 68 
   
         strcpy (pass, pwd);          strcpy (pass, pwd);
   
         if (uudecode ((char *)t, tcfskey, sizeof(tcfskey)) == -1)          if (uudecode ((char *)t, tcfskey, sizeof(tcfskey)) == -1) {
                   fprintf(stderr, "tcfs_decrypt_key: uudecode failed\n");
                 return 0;                  return 0;
           }
   
         while (strlen (pass) < 8) {          while (strlen (pass) < 8) {
                 char tmp[_PASSWORD_LEN];                  char tmp[_PASSWORD_LEN];
Line 99 
Line 101 
         char pass[_PASSWORD_LEN];          char pass[_PASSWORD_LEN];
         des_key_schedule ks;          des_key_schedule ks;
         int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE;          int keysize = (flag == GROUPKEY) ? KEYSIZE + KEYSIZE/8 : KEYSIZE;
           int uulen = (flag == GROUPKEY) ? UUGKEYSIZE : UUKEYSIZE;
           int res;
   
         if (!ek)          if (!ek)
                 return 0;                  return 0;
Line 120 
Line 124 
                 i++;                  i++;
         }          }
   
         uuencode (key, keysize, ek, UUKEYSIZE);          res = uuencode (key, keysize, ek, uulen + 1);
           if (res != uulen) {
                   fprintf(stderr, "tcfs_encrypt_key: uuencode length wrong\n");
                   return (0);
           }
   
         return 1;          return 1;
 }  }
   
 int tcfs_user_enable(char *filesystem, uid_t user, u_char *key)  int
   tcfs_user_enable(char *filesystem, uid_t user, u_char *key)
 {  {
         struct tcfs_args a;          struct tcfs_args a;
         a.user = user;          a.user = user;
Line 134 
Line 143 
         return tcfs_callfunction(filesystem,&a);          return tcfs_callfunction(filesystem,&a);
 }  }
   
 int tcfs_user_disable(char *filesystem, uid_t user)  int
   tcfs_user_disable(char *filesystem, uid_t user)
 {  {
         struct tcfs_args a;          struct tcfs_args a;
         a.user = user;          a.user = user;
Line 142 
Line 152 
         return tcfs_callfunction(filesystem, &a);          return tcfs_callfunction(filesystem, &a);
 }  }
   
 int tcfs_proc_enable(char *filesystem, uid_t user, pid_t pid, char *key)  int
   tcfs_proc_enable(char *filesystem, uid_t user, pid_t pid, char *key)
 {  {
         struct tcfs_args a;          struct tcfs_args a;
         a.user = user;          a.user = user;
Line 152 
Line 163 
         return tcfs_callfunction(filesystem, &a);          return tcfs_callfunction(filesystem, &a);
 }  }
   
 int tcfs_proc_disable(char *filesystem, uid_t user, pid_t pid)  int
   tcfs_proc_disable(char *filesystem, uid_t user, pid_t pid)
 {  {
         struct tcfs_args a;          struct tcfs_args a;
         a.user = user;          a.user = user;
Line 161 
Line 173 
         return tcfs_callfunction(filesystem, &a);          return tcfs_callfunction(filesystem, &a);
 }  }
   
 int tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid,  int
                       int tre, char *key)  tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid,
                     int tre, char *key)
 {  {
         struct tcfs_args a;          struct tcfs_args a;
         a.cmd = TCFS_PUT_GIDKEY;          a.cmd = TCFS_PUT_GIDKEY;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2