{"action":"created","issue":{"url":"https://api.github.com/repos/keepassx/keepassx/issues/52","labels_url":"https://api.github.com/repos/keepassx/keepassx/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/keepassx/keepassx/issues/52/comments","events_url":"https://api.github.com/repos/keepassx/keepassx/issues/52/events","html_url":"https://github.com/keepassx/keepassx/pull/52","id":34323317,"number":52,"title":"RFC: Add YubiKey HMAC-SHA1 Challenge-Response","user":{"login":"kylemanna","id":936367,"avatar_url":"https://avatars.githubusercontent.com/u/936367?v=3","gravatar_id":"","url":"https://api.github.com/users/kylemanna","html_url":"https://github.com/kylemanna","followers_url":"https://api.github.com/users/kylemanna/followers","following_url":"https://api.github.com/users/kylemanna/following{/other_user}","gists_url":"https://api.github.com/users/kylemanna/gists{/gist_id}","starred_url":"https://api.github.com/users/kylemanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylemanna/subscriptions","organizations_url":"https://api.github.com/users/kylemanna/orgs","repos_url":"https://api.github.com/users/kylemanna/repos","events_url":"https://api.github.com/users/kylemanna/events{/privacy}","received_events_url":"https://api.github.com/users/kylemanna/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":41,"created_at":"2014-05-26T18:29:11Z","updated_at":"2015-01-30T04:35:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/keepassx/keepassx/pulls/52","html_url":"https://github.com/keepassx/keepassx/pull/52","diff_url":"https://github.com/keepassx/keepassx/pull/52.diff","patch_url":"https://github.com/keepassx/keepassx/pull/52.patch"},"body":"Overview\r\n--------\r\n\r\nThis pull request adds support for [YubiKey](https://yubico.com), a USB authentication device commonly used for 2FA.  Support is added by configuring a YubiKey slot to operate in HMAC-SHA1 challenge-response mode. The mechanism works by submitting the database master seed as a challenge to the YubiKey which replies with a HMAC-SHA1 cryptographic hash.  The resultant hash is then hashed with the other keys (password, keyfile) to generate the final key used to encrypt the database.\r\n\r\nI have uploaded a few [screenshots to imgur](https://imgur.com/a/NbtBf).\r\n\r\nDetails\r\n-------\r\n\r\n* Breaks the ability to open the KeePass2 database by anything other then KeePassX with YubiKey support.  Perhaps KeePass2 could open it with a plugin, but I didn't look at it.\r\n* Implemented using YubiKey HMAC-SHA1 configuration and operates completely offline.\r\n* The master seed is used as the challenge and changes on every write to help partially combat replay attacks as it's regenerated every time the database is saved.\r\n* YubiKey User Input Mode can be configured in a blocking or non-blocking mode.\r\n  * Non-blocking mode is preferred such that the challenge-response can quickly be issued and returned despite being slightly less secure due to lack of user input.\r\n  * Blocking mode works, but doesn't provide feedback to the user, so the UI appears to hang even though it's waiting.  I preferred simplicity for the initial code.\r\n* Upon generation of the HMAC key, it can be saved and cloned to other YubiKey devices to prevent loss of database access to loss or destruction of the YubiKey hardware.  This is highly recommended.\r\n* Only supports the first detected YubiKey Plugged in, but does enumerate both configuration slots on the device.  I only have one YubiKey and can't test multiple (yet).\r\n* The `libyubikey` and `ykpers-1` libraries are necessary for support. These libraries are detected at compile time to enable support and necessary at run-time.\r\n* Tested on Arch Linux and Mac OS X Mavericks with and without YubiKey support\r\n  * Arch Linux via AUR:\r\n     * libyubikey: 1.11-1\r\n     * yubico-c-client-git: 2.12.r2.g539af75-1 and 2.12.r3.g262a19c-1\r\n     * yubikey-personalization-git: 1.14.2.r5.ga7392f0-1 and 1.15.1.r10.g52890f6-1\r\n  * Mac OS X Mavericks via Homebrew:\r\n     * libyubikey: stable 1.11\r\n     * ykpers: stable 1.15.1\r\n  * Test hardware is a YubiKey Standard with firmware version 2.2.3.\r\n* Adds challenge-response combo box to support other mechanisms in the future\r\n* Can be disabled explicitly at compile time with `cmake -DCMAKE_DISABLE_FIND_PACKAGE_YubiKey=TRUE`\r\n\r\n\r\nQuick Start Guide\r\n-----------------\r\n\r\n1. Install necessary libraries to appease KeePassX's CMake configuration step\r\n\r\n        -- The following OPTIONAL packages have been found:\r\n        * YubiKey\r\n\r\n2. Install [yubikey-personalization-gui](https://github.com/Yubico/yubikey-personalization-gui) and configure slot 2 for HMAC-SHA1 challenge-response.  Be sure to write the configuration.  Optionally it can be programmed via the command line.\r\n3. Start up KeePassX with the YubiKey inserted and the challenge-response form of the DatabaseOpenWidget ChangeMasterKeyWidget should enable themselves asynchronously listing the inserted YubiKey.  Review [screenshots on imgur](https://imgur.com/a/NbtBf) for the configuration tool.\r\n\r\n\r\nUpstream / Reference\r\n--------------------\r\n\r\n* [yubico open source software](https://www.yubico.com/develop/open-source-software/)\r\n* [libyubikey](https://github.com/Yubico/yubico-c)\r\n* [yubico-c-client](https://github.com/Yubico/yubico-c-client)\r\n* [yubikey-personalization-gui](https://github.com/Yubico/yubikey-personalization-gui)\r\n"},"comment":{"url":"https://api.github.com/repos/keepassx/keepassx/issues/comments/72153022","html_url":"https://github.com/keepassx/keepassx/pull/52#issuecomment-72153022","issue_url":"https://api.github.com/repos/keepassx/keepassx/issues/52","id":72153022,"user":{"login":"kylemanna","id":936367,"avatar_url":"https://avatars.githubusercontent.com/u/936367?v=3","gravatar_id":"","url":"https://api.github.com/users/kylemanna","html_url":"https://github.com/kylemanna","followers_url":"https://api.github.com/users/kylemanna/followers","following_url":"https://api.github.com/users/kylemanna/following{/other_user}","gists_url":"https://api.github.com/users/kylemanna/gists{/gist_id}","starred_url":"https://api.github.com/users/kylemanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylemanna/subscriptions","organizations_url":"https://api.github.com/users/kylemanna/orgs","repos_url":"https://api.github.com/users/kylemanna/repos","events_url":"https://api.github.com/users/kylemanna/events{/privacy}","received_events_url":"https://api.github.com/users/kylemanna/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T04:35:09Z","updated_at":"2015-01-30T04:35:09Z","body":"@FrostbittenKing Thanks for the trick.  I integrated your suggestion.  It's annoying that `pkgver()` is called before `prepare()` which results in an incorrect `pkgver`.  Sigh. Nevertheless, I'll accept it for now.  If you have any more comments w.r.t. the `PKGBUILD`, post a comment on AUR there so that we don't create too much Arch noise here."}}