mirror of https://github.com/wolfSSL/wolfssh.git
cleanup accept state machine
parent
ccc1101612
commit
718a4f4b40
|
@ -251,8 +251,7 @@ int wolfSSH_accept(WOLFSSH* ssh)
|
||||||
|
|
||||||
case ACCEPT_BEGIN:
|
case ACCEPT_BEGIN:
|
||||||
if ( (ssh->error = SendServerVersion(ssh)) < WS_SUCCESS) {
|
if ( (ssh->error = SendServerVersion(ssh)) < WS_SUCCESS) {
|
||||||
WLOG(WS_LOG_DEBUG, acceptError,
|
WLOG(WS_LOG_DEBUG, acceptError, "BEGIN", ssh->error);
|
||||||
"CLIENT_VERSION_DONE", ssh->error);
|
|
||||||
return WS_FATAL_ERROR;
|
return WS_FATAL_ERROR;
|
||||||
}
|
}
|
||||||
ssh->acceptState = ACCEPT_SERVER_VERSION_SENT;
|
ssh->acceptState = ACCEPT_SERVER_VERSION_SENT;
|
||||||
|
@ -261,7 +260,8 @@ int wolfSSH_accept(WOLFSSH* ssh)
|
||||||
case ACCEPT_SERVER_VERSION_SENT:
|
case ACCEPT_SERVER_VERSION_SENT:
|
||||||
while (ssh->clientState < CLIENT_VERSION_DONE) {
|
while (ssh->clientState < CLIENT_VERSION_DONE) {
|
||||||
if ( (ssh->error = ProcessClientVersion(ssh)) < WS_SUCCESS) {
|
if ( (ssh->error = ProcessClientVersion(ssh)) < WS_SUCCESS) {
|
||||||
WLOG(WS_LOG_DEBUG, acceptError, "BEGIN", ssh->error);
|
WLOG(WS_LOG_DEBUG, acceptError,
|
||||||
|
"SERVER_VERSION_SENT", ssh->error);
|
||||||
return WS_FATAL_ERROR;
|
return WS_FATAL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ int wolfSSH_accept(WOLFSSH* ssh)
|
||||||
while (ssh->keyingState < KEYING_KEYED) {
|
while (ssh->keyingState < KEYING_KEYED) {
|
||||||
if ( (ssh->error = DoReceive(ssh)) < WS_SUCCESS) {
|
if ( (ssh->error = DoReceive(ssh)) < WS_SUCCESS) {
|
||||||
WLOG(WS_LOG_DEBUG, acceptError,
|
WLOG(WS_LOG_DEBUG, acceptError,
|
||||||
"SERVER_VERSION_SENT", ssh->error);
|
"CLIENT_VERSION_DONE", ssh->error);
|
||||||
return WS_FATAL_ERROR;
|
return WS_FATAL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -342,8 +342,8 @@ enum KeyingStates {
|
||||||
|
|
||||||
enum AcceptStates {
|
enum AcceptStates {
|
||||||
ACCEPT_BEGIN = 0,
|
ACCEPT_BEGIN = 0,
|
||||||
ACCEPT_CLIENT_VERSION_DONE,
|
|
||||||
ACCEPT_SERVER_VERSION_SENT,
|
ACCEPT_SERVER_VERSION_SENT,
|
||||||
|
ACCEPT_CLIENT_VERSION_DONE,
|
||||||
ACCEPT_KEYED,
|
ACCEPT_KEYED,
|
||||||
ACCEPT_CLIENT_USERAUTH_REQUEST_DONE,
|
ACCEPT_CLIENT_USERAUTH_REQUEST_DONE,
|
||||||
ACCEPT_SERVER_USERAUTH_ACCEPT_SENT,
|
ACCEPT_SERVER_USERAUTH_ACCEPT_SENT,
|
||||||
|
|
Loading…
Reference in New Issue