Fix the latest telnet breakage. Obviously this was never compiled.
This commit is contained in:
parent
40c65ba9c7
commit
d48d5be0d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76711
@ -142,6 +142,8 @@ void getseed(seed, seedsize)
|
||||
seed[i] = (lrand48() & 0xff);
|
||||
}
|
||||
#else
|
||||
int i;
|
||||
|
||||
srandomdev();
|
||||
for (i = 0; i < seedsize; i++) {
|
||||
seed[i] = random() & 0xff;
|
||||
@ -231,8 +233,7 @@ DesData *key;
|
||||
memset(buf,0,sizeof(buf));
|
||||
deslen = ((strlen(in) + 7)/8)*8;
|
||||
des_key_sched(key, k);
|
||||
des_cbc_encrypt((des_cblock *)in,(des_cblock *)buf,deslen,
|
||||
k,&i,DES_ENCRYPT);
|
||||
des_cbc_encrypt(in,buf,deslen, k,&i,DES_ENCRYPT);
|
||||
for (l=0,op=0;l<deslen;l++) {
|
||||
out[op++] = hextab[(buf[l] & 0xf0) >> 4];
|
||||
out[op++] = hextab[(buf[l] & 0x0f)];
|
||||
@ -268,7 +269,6 @@ DesData *key;
|
||||
buf[l] = n1*16 +n2;
|
||||
}
|
||||
des_key_sched(key, k);
|
||||
des_cbc_encrypt((des_cblock *)buf,(des_cblock *)out,strlen(in)/2,
|
||||
k,&i,DES_DECRYPT);
|
||||
des_cbc_encrypt(buf,out,strlen(in)/2, k,&i,DES_DECRYPT);
|
||||
out[strlen(in)/2] = '\0';
|
||||
}
|
||||
|
@ -142,6 +142,8 @@ void getseed(seed, seedsize)
|
||||
seed[i] = (lrand48() & 0xff);
|
||||
}
|
||||
#else
|
||||
int i;
|
||||
|
||||
srandomdev();
|
||||
for (i = 0; i < seedsize; i++) {
|
||||
seed[i] = random() & 0xff;
|
||||
@ -231,8 +233,7 @@ DesData *key;
|
||||
memset(buf,0,sizeof(buf));
|
||||
deslen = ((strlen(in) + 7)/8)*8;
|
||||
des_key_sched(key, k);
|
||||
des_cbc_encrypt((des_cblock *)in,(des_cblock *)buf,deslen,
|
||||
k,&i,DES_ENCRYPT);
|
||||
des_cbc_encrypt(in,buf,deslen, k,&i,DES_ENCRYPT);
|
||||
for (l=0,op=0;l<deslen;l++) {
|
||||
out[op++] = hextab[(buf[l] & 0xf0) >> 4];
|
||||
out[op++] = hextab[(buf[l] & 0x0f)];
|
||||
@ -268,7 +269,6 @@ DesData *key;
|
||||
buf[l] = n1*16 +n2;
|
||||
}
|
||||
des_key_sched(key, k);
|
||||
des_cbc_encrypt((des_cblock *)buf,(des_cblock *)out,strlen(in)/2,
|
||||
k,&i,DES_DECRYPT);
|
||||
des_cbc_encrypt(buf,out,strlen(in)/2, k,&i,DES_DECRYPT);
|
||||
out[strlen(in)/2] = '\0';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user