nshlib:add platform challenge function for nsh login

Signed-off-by: huangjian <huangjian@xiaomi.com>
This commit is contained in:
huangjian
2022-11-04 20:35:07 +08:00
committed by Xiang Xiao
parent 05eadd1bd6
commit 5a623cc9e3
4 changed files with 73 additions and 2 deletions

View File

@@ -192,6 +192,26 @@ int nsh_telnetstart(sa_family_t family);
void platform_motd(FAR char *buffer, size_t buflen);
#endif
/****************************************************************************
* Name: platform_challenge
*
* Description:
* If CONFIG_NSH_PLATFORM_CHALLENGE is defined, then platform-specific
* logic must provide this function in order get the challenge.
*
* Input Parameters:
* buffer - A caller allocated buffer in which to receive the challenge
* buflen - The length in bytes of the caller allocated buffer
*
* Returned value:
* None
*
****************************************************************************/
#ifdef CONFIG_NSH_PLATFORM_CHALLENGE
void platform_challenge(FAR char *buffer, size_t buflen);
#endif
/****************************************************************************
* Name: platform_user_verify
*
@@ -211,8 +231,13 @@ void platform_motd(FAR char *buffer, size_t buflen);
****************************************************************************/
#ifdef CONFIG_NSH_LOGIN_PLATFORM
#ifdef CONFIG_NSH_PLATFORM_CHALLENGE
int platform_user_verify(FAR const char *username, FAR const char *challenge,
FAR const char *password);
#else
int platform_user_verify(FAR const char *username, FAR const char *password);
#endif
#endif
/****************************************************************************
* Name: nsh_system