365 };
366
367
368 char *afs_crypt(const char *pw, const char *salt,
369 /* must be at least 16 bytes */
370 char *iobuf)
371 {
372 int i, j, c;
373 int temp;
374 char block[66];
375 char E[48];
376 /*
377 * The key schedule.
378 * Generated from the key.
379 */
380 char KS[16][48];
381
382 for(i=0; i<66; i++)
383 block[i] = 0;
384 /* Solaris Kerberos */
385 for(i=0; ((c= *pw) != NULL) && i<64; pw++){
386 for(j=0; j<7; j++, i++)
387 block[i] = (c>>(6-j)) & 01;
388 i++;
389 }
390
391 krb5_afs_crypt_setkey(block, E, KS);
392
393 for(i=0; i<66; i++)
394 block[i] = 0;
395
396 for(i=0;i<2;i++){
397 c = *salt++;
398 iobuf[i] = c;
399 if(c>'Z') c -= 6;
400 if(c>'9') c -= 7;
401 c -= '.';
402 for(j=0;j<6;j++){
403 if((c>>j) & 01){
404 temp = E[6*i+j];
405 E[6*i+j] = E[6*i+j+24];
|
365 };
366
367
368 char *afs_crypt(const char *pw, const char *salt,
369 /* must be at least 16 bytes */
370 char *iobuf)
371 {
372 int i, j, c;
373 int temp;
374 char block[66];
375 char E[48];
376 /*
377 * The key schedule.
378 * Generated from the key.
379 */
380 char KS[16][48];
381
382 for(i=0; i<66; i++)
383 block[i] = 0;
384 /* Solaris Kerberos */
385 for(i=0; ((c= *pw) != 0) && i<64; pw++){
386 for(j=0; j<7; j++, i++)
387 block[i] = (c>>(6-j)) & 01;
388 i++;
389 }
390
391 krb5_afs_crypt_setkey(block, E, KS);
392
393 for(i=0; i<66; i++)
394 block[i] = 0;
395
396 for(i=0;i<2;i++){
397 c = *salt++;
398 iobuf[i] = c;
399 if(c>'Z') c -= 6;
400 if(c>'9') c -= 7;
401 c -= '.';
402 for(j=0;j<6;j++){
403 if((c>>j) & 01){
404 temp = E[6*i+j];
405 E[6*i+j] = E[6*i+j+24];
|