Lines 207-215
fb64_start(struct fb *fbp, int dir, int server __unused)
Link Here
|
207 |
/* |
207 |
/* |
208 |
* Create a random feed and send it over. |
208 |
* Create a random feed and send it over. |
209 |
*/ |
209 |
*/ |
210 |
des_random_key((Block *)fbp->temp_feed); |
210 |
DES_random_key((Block *)fbp->temp_feed); |
211 |
des_ecb_encrypt((Block *)fbp->temp_feed, (Block *)fbp->temp_feed, |
211 |
DES_ecb_encrypt((Block *)fbp->temp_feed, (Block *)fbp->temp_feed, |
212 |
fbp->krbdes_sched, 1); |
212 |
&fbp->krbdes_sched, 1); |
213 |
p = fbp->fb_feed + 3; |
213 |
p = fbp->fb_feed + 3; |
214 |
*p++ = ENCRYPT_IS; |
214 |
*p++ = ENCRYPT_IS; |
215 |
p++; |
215 |
p++; |
Lines 393-399
fb64_session(Session_Key *key, int server, struct fb *fbp)
Link Here
|
393 |
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_ENCRYPT-1]); |
393 |
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_ENCRYPT-1]); |
394 |
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]); |
394 |
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]); |
395 |
|
395 |
|
396 |
des_key_sched((Block *)fbp->krbdes_key, fbp->krbdes_sched); |
396 |
DES_key_sched((Block *)fbp->krbdes_key, &fbp->krbdes_sched); |
397 |
/* |
397 |
/* |
398 |
* Now look to see if krbdes_start() was was waiting for |
398 |
* Now look to see if krbdes_start() was was waiting for |
399 |
* the key to show up. If so, go ahead an call it now |
399 |
* the key to show up. If so, go ahead an call it now |
Lines 499-505
fb64_stream_iv(Block seed, struct stinfo *stp)
Link Here
|
499 |
memmove((void *)stp->str_iv, (void *)seed, sizeof(Block)); |
499 |
memmove((void *)stp->str_iv, (void *)seed, sizeof(Block)); |
500 |
memmove((void *)stp->str_output, (void *)seed, sizeof(Block)); |
500 |
memmove((void *)stp->str_output, (void *)seed, sizeof(Block)); |
501 |
|
501 |
|
502 |
des_key_sched((Block *)stp->str_ikey, stp->str_sched); |
502 |
DES_key_sched((Block *)stp->str_ikey, &stp->str_sched); |
503 |
|
503 |
|
504 |
stp->str_index = sizeof(Block); |
504 |
stp->str_index = sizeof(Block); |
505 |
} |
505 |
} |
Lines 508-514
void
Link Here
|
508 |
fb64_stream_key(Block key, struct stinfo *stp) |
508 |
fb64_stream_key(Block key, struct stinfo *stp) |
509 |
{ |
509 |
{ |
510 |
memmove((void *)stp->str_ikey, (void *)key, sizeof(Block)); |
510 |
memmove((void *)stp->str_ikey, (void *)key, sizeof(Block)); |
511 |
des_key_sched((Block *)key, stp->str_sched); |
511 |
DES_key_sched((Block *)key, &stp->str_sched); |
512 |
|
512 |
|
513 |
memmove((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block)); |
513 |
memmove((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block)); |
514 |
|
514 |
|
Lines 547-553
cfb64_encrypt(unsigned char *s, int c)
Link Here
|
547 |
while (c-- > 0) { |
547 |
while (c-- > 0) { |
548 |
if (idx == sizeof(Block)) { |
548 |
if (idx == sizeof(Block)) { |
549 |
Block b; |
549 |
Block b; |
550 |
des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1); |
550 |
DES_ecb_encrypt((Block *)stp->str_output, (Block *)b, &stp->str_sched, 1); |
551 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
551 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
552 |
idx = 0; |
552 |
idx = 0; |
553 |
} |
553 |
} |
Lines 580-586
cfb64_decrypt(int data)
Link Here
|
580 |
idx = stp->str_index++; |
580 |
idx = stp->str_index++; |
581 |
if (idx == sizeof(Block)) { |
581 |
if (idx == sizeof(Block)) { |
582 |
Block b; |
582 |
Block b; |
583 |
des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1); |
583 |
DES_ecb_encrypt((Block *)stp->str_output, (Block *)b, &stp->str_sched, 1); |
584 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
584 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
585 |
stp->str_index = 1; /* Next time will be 1 */ |
585 |
stp->str_index = 1; /* Next time will be 1 */ |
586 |
idx = 0; /* But now use 0 */ |
586 |
idx = 0; /* But now use 0 */ |
Lines 620-626
ofb64_encrypt(unsigned char *s, int c)
Link Here
|
620 |
while (c-- > 0) { |
620 |
while (c-- > 0) { |
621 |
if (idx == sizeof(Block)) { |
621 |
if (idx == sizeof(Block)) { |
622 |
Block b; |
622 |
Block b; |
623 |
des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1); |
623 |
DES_ecb_encrypt((Block *)stp->str_feed, (Block *)b, &stp->str_sched, 1); |
624 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
624 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
625 |
idx = 0; |
625 |
idx = 0; |
626 |
} |
626 |
} |
Lines 650-656
ofb64_decrypt(int data)
Link Here
|
650 |
idx = stp->str_index++; |
650 |
idx = stp->str_index++; |
651 |
if (idx == sizeof(Block)) { |
651 |
if (idx == sizeof(Block)) { |
652 |
Block b; |
652 |
Block b; |
653 |
des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1); |
653 |
DES_ecb_encrypt((Block *)stp->str_feed, (Block *)b, &stp->str_sched, 1); |
654 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
654 |
memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); |
655 |
stp->str_index = 1; /* Next time will be 1 */ |
655 |
stp->str_index = 1; /* Next time will be 1 */ |
656 |
idx = 0; /* But now use 0 */ |
656 |
idx = 0; /* But now use 0 */ |