mainOATH Toolkit - Support: sr #108042, try_first_pass/use_first_pass with...

 
 

sr #108042: try_first_pass/use_first_pass with password and otp problem

Submitter:  None
Submitted:  Tue 01 May 2012 07:19:24 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  jas
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 31 May 2012 01:58:47 PM UTC, comment #1: 

Thank you Thomas.  This has been resolved with 1.12.3, please test it.

/Simon

Simon Josefsson <jas>
Group administrator
Tue 01 May 2012 07:19:24 PM UTC, original submission:  

Hello,

if one of the options try_first_pass and use_first_pass is used with two factor authentication, the OTP becomes empty.


debug output:
...
get user returned: <user>
get password returned: <password><otp>
Password: <password>
OTP: <nothing!>
...

The reason seems to be, that the pam_set_item function gets the password by ref.

This patch seems to work for me:


--- a/pam_oath/pam_oath.c
+++ b/pam_oath/pam_oath.c
@@ -272,15 +272,15 @@ pam_sm_authenticate (pam_handle_t * pamh,
 
       DBG (("Password: %s ", onlypasswd));
 
+      strncpy (otp, password + password_len - cfg.digits, cfg.digits);
+      otp[cfg.digits] = '\0';
+
       retval = pam_set_item (pamh, PAM_AUTHTOK, onlypasswd);
       if (retval != PAM_SUCCESS)
        {
          DBG (("set_item returned error: %s", pam_strerror (pamh, retval)));
          goto done;
        }
-
-      strncpy (otp, password + password_len - cfg.digits, cfg.digits);
-      otp[cfg.digits] = '\0';
     }
   else
     {


Best regards.





Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jas (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-31 jas StatusNone Done
        Assigned toNone jas
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code