Switched to use the new session password field

This commit is contained in:
Michiel Broek 2002-06-15 14:06:29 +00:00
parent 6824b44975
commit ef92dc3316
4 changed files with 19 additions and 19 deletions

View File

@ -440,9 +440,9 @@ SM_STATE(waitconn)
SM_STATE(sendpass)
if (strlen(nodes.Epasswd)) {
if (strlen(nodes.Spasswd)) {
SendPass = TRUE;
binkp_send_control(MM_PWD, "%s", nodes.Epasswd);
binkp_send_control(MM_PWD, "%s", nodes.Spasswd);
} else {
binkp_send_control(MM_PWD, "-");
}
@ -714,11 +714,11 @@ SM_STATE(pwdack)
Syslog('+', "Node not in setup, unprotected BINKP session");
binkp_send_control(MM_OK, "");
SM_SUCCESS;
} else if ((strcmp(&rbuf[1], "-") == 0) && Loaded && !strlen(nodes.Epasswd)) {
} else if ((strcmp(&rbuf[1], "-") == 0) && Loaded && !strlen(nodes.Spasswd)) {
Syslog('+', "Node in setup but no session password, unprotected BINKP session");
binkp_send_control(MM_OK, "");
SM_SUCCESS;
} else if ((strcmp(&rbuf[1], nodes.Epasswd) == 0) && Loaded) {
} else if ((strcmp(&rbuf[1], nodes.Spasswd) == 0) && Loaded) {
Syslog('+', "Password OK, protected BINKP session");
if (inbound)
free(inbound);
@ -726,7 +726,7 @@ SM_STATE(pwdack)
binkp_send_control(MM_OK, "");
SM_SUCCESS;
} else {
Syslog('?', "Password error: expected \"%s\", got \"%s\"", nodes.Epasswd, &rbuf[1]);
Syslog('?', "Password error: expected \"%s\", got \"%s\"", nodes.Spasswd, &rbuf[1]);
binkp_send_control(MM_ERR, "*** Password error, check setup ***");
SM_ERROR;
}

View File

@ -155,17 +155,17 @@ int rx_emsi(char *data)
if (localoptions & NOFREQS)
emsi_local_opts |= OPT_NRQ;
if (strlen(nodes.Epasswd)) {
if ((strncasecmp(emsi_remote_password, nodes.Epasswd, strlen(nodes.Epasswd)) == 0) &&
(strlen(emsi_remote_password) == strlen(nodes.Epasswd))) {
emsi_local_password = xstrcpy(nodes.Epasswd);
if (strlen(nodes.Spasswd)) {
if ((strncasecmp(emsi_remote_password, nodes.Spasswd, strlen(nodes.Spasswd)) == 0) &&
(strlen(emsi_remote_password) == strlen(nodes.Spasswd))) {
emsi_local_password = xstrcpy(nodes.Spasswd);
if (inbound)
free(inbound);
inbound = xstrcpy(CFG.pinbound);
Syslog('+', "Password correct, protected EMSI session");
} else {
denypw = 1;
Syslog('?', "Remote password \"%s\", expected \"%s\"", MBSE_SS(emsi_remote_password), nodes.Epasswd);
Syslog('?', "Remote password \"%s\", expected \"%s\"", MBSE_SS(emsi_remote_password), nodes.Spasswd);
emsi_local_password = xstrcpy((char *)"BAD_PASS");
emsi_local_lcodes = LCODE_HAT;
}

View File

@ -107,8 +107,8 @@ char *mkemsidat(int caller)
if (emsi_local_password)
p=xstrcat(p,emsi_local_password);
else
if (strlen(nodes.Epasswd)) {
p = xstrcat(p, nodes.Epasswd);
if (strlen(nodes.Spasswd)) {
p = xstrcat(p, nodes.Spasswd);
}
if (emsi_local_opts & OPT_EII) {

View File

@ -167,17 +167,17 @@ int rx_yoohoo(void)
if (nlent)
rdoptions(Loaded);
if (strlen(nodes.Epasswd)) {
if ((strncasecmp((char*)hello2.my_password, nodes.Epasswd, strlen(nodes.Epasswd)) == 0) &&
(strlen((char*)hello2.my_password) == strlen(nodes.Epasswd))) {
if (strlen(nodes.Spasswd)) {
if ((strncasecmp((char*)hello2.my_password, nodes.Spasswd, strlen(nodes.Spasswd)) == 0) &&
(strlen((char*)hello2.my_password) == strlen(nodes.Spasswd))) {
Syslog('+', "Password correct, protected mail session");
if (inbound)
free(inbound);
inbound = xstrcpy(CFG.pinbound);
pwd = xstrcpy(nodes.Epasswd);
pwd = xstrcpy(nodes.Spasswd);
} else {
pwd = (char *)"BAD_PASS";
Syslog('?', "Remote password \"%s\", expected \"%s\"", (char*)hello2.my_password, nodes.Epasswd);
Syslog('?', "Remote password \"%s\", expected \"%s\"", (char*)hello2.my_password, nodes.Spasswd);
localcaps = 0;
}
} else
@ -224,8 +224,8 @@ int tx_yoohoo(void)
Syslog('+', "Start outbound YooHoo session");
if (strlen(nodes.Epasswd))
pwd = xstrcpy(nodes.Epasswd);
if (strlen(nodes.Spasswd))
pwd = xstrcpy(nodes.Spasswd);
else
pwd = NULL;