mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-02-01 01:52:17 +01:00
Indent.
This commit is contained in:
parent
af09b5499c
commit
02c8dce53f
24
pam_yubico.c
24
pam_yubico.c
@ -90,8 +90,7 @@
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
check_user_token (const char *authfile,
|
check_user_token (const char *authfile,
|
||||||
const char *username,
|
const char *username, const char *usertoken)
|
||||||
const char *usertoken)
|
|
||||||
{
|
{
|
||||||
static char buf[1024];
|
static char buf[1024];
|
||||||
char *s_user, *s_token;
|
char *s_user, *s_token;
|
||||||
@ -137,8 +136,7 @@ check_user_token (const char *authfile,
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
validate_user_token (const char *authfile,
|
validate_user_token (const char *authfile,
|
||||||
const char *username,
|
const char *username, const char *usertoken)
|
||||||
const char *usertoken)
|
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
@ -303,16 +301,20 @@ pam_sm_authenticate (pam_handle_t * pamh,
|
|||||||
password_len = strlen (token_otp_with_password);
|
password_len = strlen (token_otp_with_password);
|
||||||
|
|
||||||
/* Getting Token value and SSH password */
|
/* Getting Token value and SSH password */
|
||||||
strncpy((char *)token_otp, token_otp_with_password + ( password_len - TOKEN_LEN ), TOKEN_LEN);
|
strncpy ((char *) token_otp,
|
||||||
token_password = malloc((password_len - TOKEN_LEN) + 1); // need to free this memory
|
token_otp_with_password + (password_len - TOKEN_LEN), TOKEN_LEN);
|
||||||
|
token_password = malloc ((password_len - TOKEN_LEN) + 1);
|
||||||
|
|
||||||
if (token_password != NULL)
|
if (token_password != NULL)
|
||||||
{
|
{
|
||||||
strncpy(token_password, token_otp_with_password, (password_len - TOKEN_LEN));
|
strncpy (token_password, token_otp_with_password,
|
||||||
|
(password_len - TOKEN_LEN));
|
||||||
token_password[(password_len - TOKEN_LEN)] = 0;
|
token_password[(password_len - TOKEN_LEN)] = 0;
|
||||||
password = token_password;
|
password = token_password;
|
||||||
}
|
}
|
||||||
strncpy((char *)token_id, token_otp_with_password + ( password_len - TOKEN_LEN ), TOKEN_ID_LEN);
|
strncpy ((char *) token_id,
|
||||||
|
token_otp_with_password + (password_len - TOKEN_LEN),
|
||||||
|
TOKEN_ID_LEN);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -321,7 +323,9 @@ pam_sm_authenticate (pam_handle_t * pamh,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* validate the user with supplied token id */
|
/* validate the user with supplied token id */
|
||||||
valid_token = validate_user_token(auth_file, (const char *)user, (const char *)token_id);
|
valid_token =
|
||||||
|
validate_user_token (auth_file, (const char *) user,
|
||||||
|
(const char *) token_id);
|
||||||
|
|
||||||
if (password != NULL)
|
if (password != NULL)
|
||||||
{
|
{
|
||||||
@ -345,9 +349,7 @@ pam_sm_authenticate (pam_handle_t * pamh,
|
|||||||
rc = yubikey_client_request (ykc, (const char *) token_otp);
|
rc = yubikey_client_request (ykc, (const char *) token_otp);
|
||||||
|
|
||||||
if (token_password != NULL)
|
if (token_password != NULL)
|
||||||
{
|
|
||||||
free (token_password);
|
free (token_password);
|
||||||
}
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
D (("libyubikey-client return value (%d): %s", rc,
|
D (("libyubikey-client return value (%d): %s", rc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user