Skip to content

Commit 8399f78

Browse files
Merge pull request #461 from ejohnstown/clear-alarm
Clear Alarm
2 parents 54de718 + d61cb26 commit 8399f78

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

apps/wolfsshd/wolfsshd.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ static byte* getBufferFromFile(const char* fileName, word32* bufSz, void* heap)
230230
}
231231
#endif /* NO_FILESYSTEM */
232232

233+
234+
static int UserAuthResult(byte result,
235+
WS_UserAuthData* authData, void* userAuthResultCtx);
236+
237+
233238
/* Initializes and sets up the WOLFSSH_CTX struct based on the configure options
234239
* return WS_SUCCESS on success
235240
*/
@@ -252,6 +257,7 @@ static int SetupCTX(WOLFSSHD_CONFIG* conf, WOLFSSH_CTX** ctx)
252257
/* setup authority callback for checking peer connections */
253258
if (ret == WS_SUCCESS) {
254259
wolfSSH_SetUserAuth(*ctx, DefaultUserAuth);
260+
wolfSSH_SetUserAuthResult(*ctx, UserAuthResult);
255261
}
256262

257263
/* set banner to display on connection */
@@ -776,6 +782,19 @@ static void alarmCatch(int signum)
776782
(void)signum;
777783
}
778784

785+
static int UserAuthResult(byte result,
786+
WS_UserAuthData* authData, void* userAuthResultCtx)
787+
{
788+
(void)authData;
789+
(void)userAuthResultCtx;
790+
791+
if (result == WOLFSSH_USERAUTH_SUCCESS) {
792+
alarm(0);
793+
}
794+
795+
return WS_SUCCESS;
796+
}
797+
779798
/* handle wolfSSH accept and directing to correct subsystem */
780799
static void* HandleConnection(void* arg)
781800
{

0 commit comments

Comments
 (0)