Variable encrypt_verbose had to be turned on in main.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@253 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Unknown User d91-jda
1996-02-11 09:50:08 +00:00
parent da3520c703
commit a9e3c2cdb5
3 changed files with 86 additions and 109 deletions

View File

@@ -70,6 +70,7 @@ void encrypt_send_supprt P((void));
void encrypt_auto P((int)); void encrypt_auto P((int));
void decrypt_auto P((int)); void decrypt_auto P((int));
void encrypt_not P((void)); void encrypt_not P((void));
void encrypt_verbose_quiet P((int));
void encrypt_is P((unsigned char *, int)); void encrypt_is P((unsigned char *, int));
void encrypt_reply P((unsigned char *, int)); void encrypt_reply P((unsigned char *, int));
void encrypt_start_input P((int)); void encrypt_start_input P((int));

View File

@@ -84,7 +84,7 @@ char *nclearto;
int encrypt_debug_mode = 0; int encrypt_debug_mode = 0;
static int decrypt_mode = 0; static int decrypt_mode = 0;
static int encrypt_mode = 0; static int encrypt_mode = 0;
static int encrypt_verbose = 1; static int encrypt_verbose = 0;
static int autoencrypt = 0; static int autoencrypt = 0;
static int autodecrypt = 0; static int autodecrypt = 0;
static int havesessionkey = 0; static int havesessionkey = 0;
@@ -137,9 +137,8 @@ static unsigned char str_suplen = 0;
static unsigned char str_start[72] = { IAC, SB, TELOPT_ENCRYPT }; static unsigned char str_start[72] = { IAC, SB, TELOPT_ENCRYPT };
static unsigned char str_end[] = { IAC, SB, TELOPT_ENCRYPT, 0, IAC, SE }; static unsigned char str_end[] = { IAC, SB, TELOPT_ENCRYPT, 0, IAC, SE };
Encryptions * Encryptions *
findencryption(type) findencryption(int type)
int type;
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -150,9 +149,8 @@ findencryption(type)
return(ep->type ? ep : 0); return(ep->type ? ep : 0);
} }
Encryptions * Encryptions *
finddecryption(type) finddecryption(int type)
int type;
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -176,10 +174,8 @@ static struct key_info {
{ { 0 }, 0, DIR_DECRYPT, &decrypt_mode, finddecryption }, { { 0 }, 0, DIR_DECRYPT, &decrypt_mode, finddecryption },
}; };
void void
encrypt_init(name, server) encrypt_init(char *name, int server)
char *name;
int server;
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -214,8 +210,8 @@ encrypt_init(name, server)
str_send[str_suplen++] = SE; str_send[str_suplen++] = SE;
} }
void void
encrypt_list_types() encrypt_list_types(void)
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -226,9 +222,8 @@ encrypt_list_types()
} }
} }
int int
EncryptEnable(type, mode) EncryptEnable(char *type, char *mode)
char *type, *mode;
{ {
if (isprefix(type, "help") || isprefix(type, "?")) { if (isprefix(type, "help") || isprefix(type, "?")) {
printf("Usage: encrypt enable <type> [input|output]\n"); printf("Usage: encrypt enable <type> [input|output]\n");
@@ -240,9 +235,8 @@ EncryptEnable(type, mode)
return(0); return(0);
} }
int int
EncryptDisable(type, mode) EncryptDisable(char *type, char *mode)
char *type, *mode;
{ {
register Encryptions *ep; register Encryptions *ep;
int ret = 0; int ret = 0;
@@ -274,10 +268,8 @@ EncryptDisable(type, mode)
return(ret); return(ret);
} }
int int
EncryptType(type, mode) EncryptType(char *type, char *mode)
char *type;
char *mode;
{ {
register Encryptions *ep; register Encryptions *ep;
int ret = 0; int ret = 0;
@@ -307,9 +299,8 @@ EncryptType(type, mode)
return(ret); return(ret);
} }
int int
EncryptStart(mode) EncryptStart(char *mode)
char *mode;
{ {
register int ret = 0; register int ret = 0;
if (mode) { if (mode) {
@@ -329,8 +320,8 @@ EncryptStart(mode)
return(ret); return(ret);
} }
int int
EncryptStartInput() EncryptStartInput(void)
{ {
if (decrypt_mode) { if (decrypt_mode) {
encrypt_send_request_start(); encrypt_send_request_start();
@@ -340,8 +331,8 @@ EncryptStartInput()
return(0); return(0);
} }
int int
EncryptStartOutput() EncryptStartOutput(void)
{ {
if (encrypt_mode) { if (encrypt_mode) {
encrypt_start_output(encrypt_mode); encrypt_start_output(encrypt_mode);
@@ -351,9 +342,8 @@ EncryptStartOutput()
return(0); return(0);
} }
int int
EncryptStop(mode) EncryptStop(char *mode)
char *mode;
{ {
int ret = 0; int ret = 0;
if (mode) { if (mode) {
@@ -373,22 +363,22 @@ EncryptStop(mode)
return(ret); return(ret);
} }
int int
EncryptStopInput() EncryptStopInput(void)
{ {
encrypt_send_request_end(); encrypt_send_request_end();
return(1); return(1);
} }
int int
EncryptStopOutput() EncryptStopOutput(void)
{ {
encrypt_send_end(); encrypt_send_end();
return(1); return(1);
} }
void void
encrypt_display() encrypt_display(void)
{ {
printf("Autoencrypt for output is %s. Autodecrypt for input is %s.\r\n", printf("Autoencrypt for output is %s. Autodecrypt for input is %s.\r\n",
autoencrypt?"on":"off", autodecrypt?"on":"off"); autoencrypt?"on":"off", autodecrypt?"on":"off");
@@ -406,8 +396,8 @@ encrypt_display()
printf("Currently not decrypting input\r\n"); printf("Currently not decrypting input\r\n");
} }
int int
EncryptStatus() EncryptStatus(void)
{ {
printf("Autoencrypt for output is %s. Autodecrypt for input is %s.\r\n", printf("Autoencrypt for output is %s. Autodecrypt for input is %s.\r\n",
autoencrypt?"on":"off", autodecrypt?"on":"off"); autoencrypt?"on":"off", autodecrypt?"on":"off");
@@ -435,8 +425,8 @@ EncryptStatus()
return 1; return 1;
} }
void void
encrypt_send_support() encrypt_send_support(void)
{ {
if (str_suplen) { if (str_suplen) {
/* /*
@@ -452,9 +442,8 @@ encrypt_send_support()
} }
} }
int int
EncryptDebug(on) EncryptDebug(int on)
int on;
{ {
if (on < 0) if (on < 0)
encrypt_debug_mode ^= 1; encrypt_debug_mode ^= 1;
@@ -465,22 +454,27 @@ EncryptDebug(on)
return(1); return(1);
} }
int /* turn on verbose encryption, but dont keep telling the whole world
EncryptVerbose(on) */
int on; void encrypt_verbose_quiet(int on)
{ {
if (on < 0) if(on < 0)
encrypt_verbose ^= 1; encrypt_verbose ^= 1;
else else
encrypt_verbose = on; encrypt_verbose = on ? 1 : 0;
}
int
EncryptVerbose(int on)
{
encrypt_verbose_quiet(on);
printf("Encryption %s verbose\r\n", printf("Encryption %s verbose\r\n",
encrypt_verbose ? "is" : "is not"); encrypt_verbose ? "is" : "is not");
return(1); return(1);
} }
int int
EncryptAutoEnc(on) EncryptAutoEnc(int on)
int on;
{ {
encrypt_auto(on); encrypt_auto(on);
printf("Automatic encryption of output is %s\r\n", printf("Automatic encryption of output is %s\r\n",
@@ -488,9 +482,8 @@ EncryptAutoEnc(on)
return(1); return(1);
} }
int int
EncryptAutoDec(on) EncryptAutoDec(int on)
int on;
{ {
decrypt_auto(on); decrypt_auto(on);
printf("Automatic decryption of input is %s\r\n", printf("Automatic decryption of input is %s\r\n",
@@ -510,10 +503,8 @@ encrypt_not(void)
/* /*
* Called when ENCRYPT SUPPORT is received. * Called when ENCRYPT SUPPORT is received.
*/ */
void void
encrypt_support(typelist, cnt) encrypt_support(unsigned char *typelist, int cnt)
unsigned char *typelist;
int cnt;
{ {
register int type, use_type = 0; register int type, use_type = 0;
Encryptions *ep; Encryptions *ep;
@@ -552,10 +543,8 @@ encrypt_support(typelist, cnt)
} }
} }
void void
encrypt_is(data, cnt) encrypt_is(unsigned char *data, int cnt)
unsigned char *data;
int cnt;
{ {
Encryptions *ep; Encryptions *ep;
register int type, ret; register int type, ret;
@@ -598,10 +587,8 @@ encrypt_is(data, cnt)
} }
} }
void void
encrypt_reply(data, cnt) encrypt_reply(unsigned char *data, int cnt)
unsigned char *data;
int cnt;
{ {
Encryptions *ep; Encryptions *ep;
register int ret, type; register int ret, type;
@@ -648,10 +635,8 @@ encrypt_reply(data, cnt)
/* /*
* Called when a ENCRYPT START command is received. * Called when a ENCRYPT START command is received.
*/ */
void void
encrypt_start(data, cnt) encrypt_start(unsigned char *data, int cnt)
unsigned char *data;
int cnt;
{ {
Encryptions *ep; Encryptions *ep;
@@ -686,10 +671,8 @@ encrypt_start(data, cnt)
} }
} }
void void
encrypt_session_key(key, server) encrypt_session_key(Session_Key *key, int server)
Session_Key *key;
int server;
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -705,8 +688,8 @@ encrypt_session_key(key, server)
/* /*
* Called when ENCRYPT END is received. * Called when ENCRYPT END is received.
*/ */
void void
encrypt_end() encrypt_end(void)
{ {
decrypt_input = 0; decrypt_input = 0;
if (encrypt_debug_mode) if (encrypt_debug_mode)
@@ -718,8 +701,8 @@ encrypt_end()
/* /*
* Called when ENCRYPT REQUEST-END is received. * Called when ENCRYPT REQUEST-END is received.
*/ */
void void
encrypt_request_end() encrypt_request_end(void)
{ {
encrypt_send_end(); encrypt_send_end();
} }
@@ -730,10 +713,8 @@ encrypt_request_end()
* other side wants us to start encrypting data as soon as we * other side wants us to start encrypting data as soon as we
* can. * can.
*/ */
void void
encrypt_request_start(data, cnt) encrypt_request_start(unsigned char *data, int cnt)
unsigned char *data;
int cnt;
{ {
if (encrypt_mode == 0) { if (encrypt_mode == 0) {
if (Server) if (Server)
@@ -817,9 +798,8 @@ void encrypt_send_keyid(int dir, unsigned char *keyid, int keylen, int saveit)
printsub('>', &str_keyid[2], strp - str_keyid - 2); printsub('>', &str_keyid[2], strp - str_keyid - 2);
} }
void void
encrypt_auto(on) encrypt_auto(int on)
int on;
{ {
if (on < 0) if (on < 0)
autoencrypt ^= 1; autoencrypt ^= 1;
@@ -827,9 +807,8 @@ encrypt_auto(on)
autoencrypt = on ? 1 : 0; autoencrypt = on ? 1 : 0;
} }
void void
decrypt_auto(on) decrypt_auto(int on)
int on;
{ {
if (on < 0) if (on < 0)
autodecrypt ^= 1; autodecrypt ^= 1;
@@ -837,9 +816,8 @@ decrypt_auto(on)
autodecrypt = on ? 1 : 0; autodecrypt = on ? 1 : 0;
} }
void void
encrypt_start_output(type) encrypt_start_output(int type)
int type;
{ {
Encryptions *ep; Encryptions *ep;
register unsigned char *p; register unsigned char *p;
@@ -894,8 +872,8 @@ encrypt_start_output(type)
ENCTYPE_NAME(type)); ENCTYPE_NAME(type));
} }
void void
encrypt_send_end() encrypt_send_end(void)
{ {
if (!encrypt_output) if (!encrypt_output)
return; return;
@@ -915,8 +893,8 @@ encrypt_send_end()
printf("[ Output is now clear text ]\r\n"); printf("[ Output is now clear text ]\r\n");
} }
void void
encrypt_send_request_start() encrypt_send_request_start(void)
{ {
register unsigned char *p; register unsigned char *p;
register int i; register int i;
@@ -935,8 +913,8 @@ encrypt_send_request_start()
printf(">>>%s: Request input to be encrypted\r\n", Name); printf(">>>%s: Request input to be encrypted\r\n", Name);
} }
void void
encrypt_send_request_end() encrypt_send_request_end(void)
{ {
str_end[3] = ENCRYPT_REQEND; str_end[3] = ENCRYPT_REQEND;
net_write(str_end, sizeof(str_end)); net_write(str_end, sizeof(str_end));
@@ -958,9 +936,8 @@ void encrypt_wait(void)
return; return;
} }
void void
encrypt_debug(mode) encrypt_debug(int mode)
int mode;
{ {
encrypt_debug_mode = mode; encrypt_debug_mode = mode;
} }
@@ -985,10 +962,8 @@ void encrypt_gen_printsub(unsigned char *data, int cnt,
*buf = '\0'; *buf = '\0';
} }
void void
encrypt_printsub(data, cnt, buf, buflen) encrypt_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
unsigned char *data, *buf;
int cnt, buflen;
{ {
Encryptions *ep; Encryptions *ep;
register int type = data[1]; register int type = data[1];

View File

@@ -255,6 +255,7 @@ int main(int argc, char **argv)
} }
} }
encrypt_verbose_quiet(1);
if (autologin == -1) { /* esc@magic.fi; force */ if (autologin == -1) { /* esc@magic.fi; force */
#if defined(AUTHENTICATION) #if defined(AUTHENTICATION)
autologin = 1; autologin = 1;