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

Diff for /src/usr.bin/skeyinit/skeyinit.c between version 1.12 and 1.13

version 1.12, 1996/10/02 03:49:34 version 1.13, 1996/10/02 18:11:30
Line 172 
Line 172 
         n = 99;          n = 99;
   
         /* Set hash type if asked to */          /* Set hash type if asked to */
         if (ht)          if (ht) {
                 skey_set_algorithm(ht);                  /* Need to zero out old key when changing algorithm */
                   if (strcmp(ht, skey_get_algorithm()) && skey_set_algorithm(ht))
                           zerokey = 1;
           }
   
         if (!defaultsetup) {          if (!defaultsetup) {
                 (void)printf("You need the 6 english words generated from the \"skey\" command.\n");                  (void)printf("You need the 6 english words generated from the \"skey\" command.\n");
Line 283 
Line 286 
         if ((skey.val = (char *)malloc(16 + 1)) == NULL)          if ((skey.val = (char *)malloc(16 + 1)) == NULL)
                 err(1, "Can't allocate memory");                  err(1, "Can't allocate memory");
   
           /* Zero out old key if necesary (entry would change size) */
           if (zerokey) {
                   (void)skeyzero(&skey, pp->pw_name);
                   /* Re-open keys file and seek to the end */
                   if (skeylookup(&skey, pp->pw_name) == -1)
                           err(1, "cannot open database");
           }
   
         btoa8(skey.val, key);          btoa8(skey.val, key);
   
         /* Don't save algorithm type for md4 (keep record length same) */          /* Don't save algorithm type for md4 (keep record length same) */
         if (strcmp(skey_get_algorithm(), "md4") == 0)          if (strcmp(skey_get_algorithm(), "md4") == 0)
                 (void)fprintf(skey.keyfile, "%s s %04d %-16s %s %-21s\n",                  (void)fprintf(skey.keyfile, "%s %04d %-16s %s %-21s\n",
                     pp->pw_name, n, seed, skey.val, tbuf);                      pp->pw_name, n, seed, skey.val, tbuf);
         else          else
                 (void)fprintf(skey.keyfile, "%s %s %04d %-16s %s %-21s\n",                  (void)fprintf(skey.keyfile, "%s %s %04d %-16s %s %-21s\n",

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13