firnsy/yubipam — pull request #7 by calmofthestorm (2013-04-17 16:37:46+00:00)
Title: Added Dvorak and Colemak support.

This adds support for Dvorak and Colemak, and an easy way for users to add additional layouts that are not directly compatible with modhex.

The change is implemented by adding an array of modhex strings to src/utils/yk_chkpwd.c, and then looping over the array and authenticating if ANY of them can parse the OTP as valid, and fails only if none of them can.

Routines that handle OTP validation and parsing have been modified to take an additional parameter, trans, representing the translation string to use for the verification (eg, for modhex this would just be the MODHEX constant cbdefgh...)

To ensure that users enroll the key they intend to in the presence of two keymaps which are permutations of each other, ykpasswd will still only accept keys in modhex, and thus a script is provided to easily convert a OTP from any layout to modhex.