Menu

#7 Error Connecting to Yubikey

2.0
closed
Ben
2014-10-31
2014-08-29
Mike
No

When using KeeChallenge 1.0.2 on KP 2.27 (latest) on Win7, I get an error "Error connecting to YubiKey," which then loops through the "please insert your Yubikey" and "Error..." windows, until the hitting the cancel button throws an unhandled exception (System.NullReferenceException) error, killing KeePass.

Cannot replicate on Win8. I have a feeling this may have something to do with the system USB Input Device driver (6.1 in Win7, vs 6.3 in Win8). This happens with the YubiKey both inserted and not inserted. Inserting after the fact does not change the error. Tried multiple USB ports, both directly and indirectly (via keyboard or monitor USB port) to the USB card.

Thoughts?

3 Attachments

Discussion

  • Ben

    Ben - 2014-08-29

    Hmm, that's an odd one. Your suggestion about the USB driver is plausible, but I did have it running on Win7 for quite a while. Could you please try replacing your install of keechallenge with the attached one? I doubt it will fix the error, but it should give a more verbose error (hopefully).

     
  • Mike

    Mike - 2014-08-29

    Right. See the attached error.

     
  • Ben

    Ben - 2014-08-29

    Oh ok, this is actually a simple fix. You're running win7 32bit, correct? If so, please replace the yubikey libraries with the ones attached here. In the next release I'll provide a distinct 32bit package. Sorry about that.

     
  • Mike

    Mike - 2014-08-29

    Yep - that did the trick on the 32bit system, but now (probably as expected), I get the same error on my 64bit system. Any way to get those to switch between the two (i.e., "if 32bit, use [x] package, if 64bit, use [y] package?

    My entire KeePass install is in Google Drive, so all computers use the same install (considered a portable install).

     
  • Ben

    Ben - 2014-08-29

    This is an interesting challenge, but I think I may have a solution working. Please copy the contents of the zip (including the 32bit and 64bit subdirectories) into the keepass.exe folder. Then delete the following files from the keepass.exe directory:
    libjson-0.dll
    libjson-c-2.dll
    libykpers-1-1.dll
    libyubikey-0.dll
    Copies of these files will remain in the 32bit and 64bit subdirectories. Hopefully it should work cross-platform now; I can't test easily on my end but fingers are crossed.

     
  • Mike

    Mike - 2014-08-29

    Happy to oblige. Will report back.

    Update: Works like a charm. "Now we can watch Jackie Gleason while we eat!"

    Another thing to look at: If I don't have the YubiKey inserted, a prompt "Insert YubiKey to Continue (sic)" comes up, but if you hit cancel instead of okay, the program crashes (happened before this recent release).

     

    Last edit: Mike 2014-08-29
  • Ben

    Ben - 2014-08-29

    Glad to hear it. I've fixed that error too. I should be putting out a release containing these fixes and a few others in the next few days.

     
    • Mike

      Mike - 2014-08-29

      Excellent. Thanks very much for the fix. Now I actually have a use for my YubiKey! Cheers!

       
  • Ben

    Ben - 2014-08-29
    • status: open --> closed
     
  • RopoMen

    RopoMen - 2014-10-27

    Hi,

    I think my problem goes to this ticket. I'm using OSX Mavericks (10.9.4). I have problem to get the Yubikey to work with KeeChallenge plugin, I did get the messages "Yubikey not connected" (or similar) and "Please insert Yubikey", but I was unable to get the Yubikey to work with KeeChalenge.

    I installed that debug version on the KeeChallenge and got message which is shown in screenshot.

    If you need more help, just ask. I would like to get this work on Mac as well, so I could share my Keepass db with all the platform via git repository :)

     
  • Ben

    Ben - 2014-10-27

    I've never gotten it up and running on a Mac, but in principal there's no reason it won't work. A good place to start is grabbing the libraries from here. I'm not sure where exactly they get installed on a mac; you could probably put them in the keechallenge directory as a last resort. From there you just need to add the dllmap entries to KeeChallenge.dll.config as in the keechallenge readme file. I'm pretty sure that will get it running for you.

     
  • RopoMen

    RopoMen - 2014-10-31

    HI,

    Finally I had the time to look in to this issue. First I was like "What dll.config?", but then I quickly made one Googling and it hit to Mono and then I realised that it was Mono thing :)

    Ok, so tonight I was able to make that .config file for that libykpers. I placed those Mac libs under ~/lib/ykpers-1.16.0-mac/ and then I needed to add 'DYLD_LIBRARY_PATH' env variable to my ~/.bash_profile and point it to ~/lib/ykpers-1.16.0-mac/lib/

    Well, it didn't work so I did try that your old debug version and added that config and it was still saying "System.DllNotFoundException libykpers-1.1.dylib" (yea, note .dylib =). So it did actually see that dll.config.

    To get more information about this issue I ran Mono in debug mode and that opened the whole issue. (Note: Informations below are from the release version of the KeeChallenge plugin)

    /* Mono debug info ***/
    Mono: DllImport error loading library '/Applications/KeePass2.23.app/Contents/MacOS/KeeChallenge_1.1_win/libykpers-1.1.dylib': 'dlopen(/Applications/KeePass2.23.app/Contents/MacOS/KeeChallenge_1.1_win/libykpers-1.1.dylib, 9): no suitable image found. Did find:
    /Users/Me/lib/ykpers-1.16.0-mac/lib//libykpers-1.1.dylib: mach-o, but wrong architecture'.

    /* Mono version info ***/
    mono --version
    Mono JIT compiler version 3.2.3 ((no/8d3b4b7 Mon Sep 16 23:46:28 EDT 2013)
    Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS: normal
    SIGSEGV: altstack
    Notification: kqueue
    Architecture: x86
    Disabled: none
    Misc: softdebug
    LLVM: yes(3.3svn-mono)
    GC: sgen

    /* libykpers library info ***/
    lipo -info libykpers-1.1.dylib
    Non-fat file: libykpers-1.1.dylib is architecture: x86_64

    Ok, So my Mavericks is 64-bit, Mono is 32-bit and libykpers-1.1.dylib is 32-bit. There are two options.

    1. Compile libykpers-1.1.dylib to 32-bit, I think this could be easiest solution, because 64-bit OS X should be able to use 32-bit libs?
    2. Compile Mono 64-bit version.

    I Don't have a much of the experience of compiling stuff for OS X so I need to ask help from the Yubico team or Mono team. Or could you probably help me? :)

    Yubico doesn't have separate 32 bit version available for the OS X, but I will ask if someone could compile it for me. I'll try to explain the situation clearly as possible why they should make that 32 bit version. ( https://developers.yubico.com/yubikey-personalization/Make-Release.html )

    Mono doesn't have 64 bit version available atm. but it is possible to build it from source, I did actually try that when I was trying to get KeePass official build working on this OS X, but I was unable to make the successful build. ( http://www.mono-project.com/docs/about-mono/supported-platforms/osx/ )
    "Support for 64-bit VMs as of Mono 2.10 is only available if you build Mono from source code and install your own copy of the VM. In the future we will ship both mono and mono64 binaries for our users."

    I could also ask help for Mono 64 bit build from owner of this project https://github.com/Monobjc/mono-macosx-64

    At least now you know how this KeeChallenge plugin is working on OS X 10.9.4 =)

    Br,
    Markku Roponen

     
  • Ben

    Ben - 2014-10-31

    Thanks, this is very interesting. I would love to help you build the yubico libraries, but unfortunately I don't have access to a mac and cross-compiling has always been a dicey proposition. I'd say that getting somebody from yubico to help is a good bet. It looks like this is a starting place for building them yourself. Hopefully the mac build process is similar to the one for linux, but I don't really have any experience with it.

     

Log in to post a comment.

MongoDB Logo MongoDB