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;
@@ -138,8 +138,7 @@ 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;
@@ -151,8 +150,7 @@ findencryption(type)
} }
Encryptions * Encryptions *
finddecryption(type) finddecryption(int type)
int type;
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -177,9 +175,7 @@ static struct key_info {
}; };
void void
encrypt_init(name, server) encrypt_init(char *name, int server)
char *name;
int server;
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -215,7 +211,7 @@ encrypt_init(name, server)
} }
void void
encrypt_list_types() encrypt_list_types(void)
{ {
Encryptions *ep = encryptions; Encryptions *ep = encryptions;
@@ -227,8 +223,7 @@ 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");
@@ -241,8 +236,7 @@ EncryptEnable(type, mode)
} }
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;
@@ -275,9 +269,7 @@ EncryptDisable(type, mode)
} }
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;
@@ -308,8 +300,7 @@ EncryptType(type, mode)
} }
int int
EncryptStart(mode) EncryptStart(char *mode)
char *mode;
{ {
register int ret = 0; register int ret = 0;
if (mode) { if (mode) {
@@ -330,7 +321,7 @@ EncryptStart(mode)
} }
int int
EncryptStartInput() EncryptStartInput(void)
{ {
if (decrypt_mode) { if (decrypt_mode) {
encrypt_send_request_start(); encrypt_send_request_start();
@@ -341,7 +332,7 @@ EncryptStartInput()
} }
int int
EncryptStartOutput() EncryptStartOutput(void)
{ {
if (encrypt_mode) { if (encrypt_mode) {
encrypt_start_output(encrypt_mode); encrypt_start_output(encrypt_mode);
@@ -352,8 +343,7 @@ EncryptStartOutput()
} }
int int
EncryptStop(mode) EncryptStop(char *mode)
char *mode;
{ {
int ret = 0; int ret = 0;
if (mode) { if (mode) {
@@ -374,21 +364,21 @@ EncryptStop(mode)
} }
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");
@@ -407,7 +397,7 @@ encrypt_display()
} }
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");
@@ -436,7 +426,7 @@ EncryptStatus()
} }
void void
encrypt_send_support() encrypt_send_support(void)
{ {
if (str_suplen) { if (str_suplen) {
/* /*
@@ -453,8 +443,7 @@ 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",
@@ -489,8 +483,7 @@ EncryptAutoEnc(on)
} }
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",
@@ -511,9 +504,7 @@ 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;
@@ -553,9 +544,7 @@ 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;
@@ -599,9 +588,7 @@ 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;
@@ -649,9 +636,7 @@ 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;
@@ -687,9 +672,7 @@ 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;
@@ -706,7 +689,7 @@ 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)
@@ -719,7 +702,7 @@ 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();
} }
@@ -731,9 +714,7 @@ encrypt_request_end()
* 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)
@@ -818,8 +799,7 @@ void encrypt_send_keyid(int dir, unsigned char *keyid, int keylen, int saveit)
} }
void void
encrypt_auto(on) encrypt_auto(int on)
int on;
{ {
if (on < 0) if (on < 0)
autoencrypt ^= 1; autoencrypt ^= 1;
@@ -828,8 +808,7 @@ encrypt_auto(on)
} }
void void
decrypt_auto(on) decrypt_auto(int on)
int on;
{ {
if (on < 0) if (on < 0)
autodecrypt ^= 1; autodecrypt ^= 1;
@@ -838,8 +817,7 @@ decrypt_auto(on)
} }
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;
@@ -895,7 +873,7 @@ encrypt_start_output(type)
} }
void void
encrypt_send_end() encrypt_send_end(void)
{ {
if (!encrypt_output) if (!encrypt_output)
return; return;
@@ -916,7 +894,7 @@ encrypt_send_end()
} }
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;
@@ -936,7 +914,7 @@ encrypt_send_request_start()
} }
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));
@@ -959,8 +937,7 @@ void encrypt_wait(void)
} }
void void
encrypt_debug(mode) encrypt_debug(int mode)
int mode;
{ {
encrypt_debug_mode = mode; encrypt_debug_mode = mode;
} }
@@ -986,9 +963,7 @@ void encrypt_gen_printsub(unsigned char *data, int cnt,
} }
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;