<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="https://forum.yubico.com/feed.php?f=2&amp;t=282" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2009-06-19T18:47:25+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=2&amp;t=282</id>
<entry>
<author><name><![CDATA[fortean]]></name></author>
<updated>2009-06-19T18:47:25+01:00</updated>
<published>2009-06-19T18:47:25+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1503#p1503</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1503#p1503"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1503#p1503"><![CDATA[
<div class="quotetitle">Greg Woods wrote:</div><div class="quotecontent"><br />Piper wrote:<br /><br />We can probably work around this by using an Ubuntu box for our development workstation, as Ubuntu appears to ship usbhid as a module so it can be loaded with parameters, but the above would be a lot easier for us if we can make it work.<br /></div><br /><br />Or by recompiling your kernel  <img src="https://forum.yubico.com/images/smilies/icon_e_wink.gif" alt=";)" title="Wink" /><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=682">fortean</a> — Fri Jun 19, 2009 6:47 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Greg Woods]]></name></author>
<updated>2009-06-18T21:26:57+01:00</updated>
<published>2009-06-18T21:26:57+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1501#p1501</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1501#p1501"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1501#p1501"><![CDATA[
Piper wrote:<br /><br />&gt; To replicate the quirks workaround:<br />&gt; as root:<br />&gt; echo -n 0x1050:0x0010:0x04 &gt; /sys/module/usbhid/parameters/quirks (although it did not work for me - probably a different format of <br />&gt; 0x1050:0x0010:0x04 is needed )<br /><br />It didn't work for me either. Has anybody figured out the exact format needed for this on Fedora 11, 2.6.29.4-167.fc11.i686.PAE<br /><br />We can probably work around this by using an Ubuntu box for our development workstation, as Ubuntu appears to ship usbhid as a module so it can be loaded with parameters, but the above would be a lot easier for us if we can make it work.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=356">Greg Woods</a> — Thu Jun 18, 2009 9:26 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Piper]]></name></author>
<updated>2009-04-28T05:06:20+01:00</updated>
<published>2009-04-28T05:06:20+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1417#p1417</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1417#p1417"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1417#p1417"><![CDATA[
<div class="quotetitle">Simon wrote:</div><div class="quotecontent"><br />Hi!  Thanks for testing this code!  I don't think many people have tested it, so we appreciate feedback here.  I think the problem you ran into is a device ownership problem which we know how to work around, please see:<br /><br /><!-- m --><a class="postlink" href="http://code.google.com/p/yubikey-core/source/browse/trunk/docs/quirks-and-workarounds.txt">http://code.google.com/p/yubikey-core/s ... rounds.txt</a><!-- m --><br /></div><br /><br />The rmmod/modprobe technique will no work if the usbhid module is compiled into the kernel, in such case the /sys files can be used (at least with kernels &gt; 2.6.20):<br /><br />To replicate the quirks workaround:<br />as root:<br /> echo -n 0x1050:0x0010:0x04 &gt; /sys/module/usbhid/parameters/quirks (although it did not work for me - probably a different format of 0x1050:0x0010:0x04 is needed )<br />or unbind the device:<br />/sys/module/usbhid/drivers/usb:usbhid - check the devices listed there, unplug YK, and check which device was removed, then plug the YK once more, and:<br />echo -n YK_device &gt; /sys/module/usbhid/drivers/usb:usbhid/unbind<br /><br />Hope this helps.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=592">Piper</a> — Tue Apr 28, 2009 5:06 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Greg Woods]]></name></author>
<updated>2009-03-27T17:58:20+01:00</updated>
<published>2009-03-27T17:58:20+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1348#p1348</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1348#p1348"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1348#p1348"><![CDATA[
Simon wrote:<br /><br />&gt; Interesting, I have heard that some redhat variations don't use a module for usbhid. Can you show us the output from the 'lsmod' command?<br /><br />OK, here it is, for my Fedora 10 workstation. I do have a flash drive plugged in (so usb_storage is loaded) and I am running VMware Workstation. However, nothing changes if I remove the flash drive and unload usb_storage and/or if I shut down VMware and unload all the vm* modules. The same problem also occurs on a CentOS box that has none of this extra baggage. Also, the lsmod output is the same whether or not the Yubikey is plugged in.<br /><br />usb_storage            86408  1 <br />vmnet                  37804  15 <br />parport_pc             25620  0 <br />vmblock                15780  3 <br />vmci                   46116  1 <br />vmmon                  63372  7 <br />nfs                   218296  1 <br />lockd                  57720  1 nfs<br />nfs_acl                 6656  1 nfs<br />ext2                   58760  1 <br />vfat                   12672  1 <br />fat                    42784  1 vfat<br />fuse                   49436  2 <br />bridge                 43668  0 <br />stp                     6148  1 bridge<br />bnep                   14848  2 <br />sco                    12932  2 <br />l2cap                  21504  3 bnep<br />bluetooth              48608  5 bnep,sco,l2cap<br />autofs4                21124  5 <br />sunrpc                156052  11 nfs,lockd,nfs_acl<br />ip6t_REJECT             7296  2 <br />nf_conntrack_ipv6      15864  4 <br />ip6table_filter         6400  1 <br />ip6_tables             14736  1 ip6table_filter<br />ipv6                  230260  50 ip6t_REJECT,nf_conntrack_ipv6<br />cpufreq_ondemand        9996  2 <br />acpi_cpufreq           12172  0 <br />dm_multipath           17164  0 <br />uinput                 10624  0 <br />snd_hda_intel         353812  3 <br />snd_seq_dummy           6660  0 <br />snd_seq_oss            30364  0 <br />snd_seq_midi_event      9600  1 snd_seq_oss<br />snd_seq                48576  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event<br />snd_seq_device         10124  3 snd_seq_dummy,snd_seq_oss,snd_seq<br />snd_pcm_oss            42496  0 <br />tg3                   107524  0 <br />snd_mixer_oss          16896  1 snd_pcm_oss<br />snd_pcm                65924  2 snd_hda_intel,snd_pcm_oss<br />snd_timer              22024  2 snd_seq,snd_pcm<br />snd_page_alloc         11144  2 snd_hda_intel,snd_pcm<br />iTCO_wdt               13732  0 <br />iTCO_vendor_support     6916  1 iTCO_wdt<br />libphy                 18560  1 tg3<br /><br /><br />&gt; Maybe you need to supply the parameters as kernel parameters when doing personalization. <img src="https://forum.yubico.com/images/smilies/icon_e_sad.gif" alt=":-(" title="Sad" /><br /><br />That's a workable option if I knew exactly what arguments to supply in grub.conf. In any case, we could work around this easily enough. We have a separate workstation that will be used for token initializations, and we could easily just run Ubuntu on it, which we know from other testing does have usbhid as a module.<br /><br /><br />&gt; Exploring whether using libhid rather than libusb would solve this problem looks more important now.<br /><br />It would certainly make things less kludgy if it worked.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=356">Greg Woods</a> — Fri Mar 27, 2009 5:58 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Jakob]]></name></author>
<updated>2009-03-27T15:10:29+01:00</updated>
<published>2009-03-27T15:10:29+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1339#p1339</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1339#p1339"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1339#p1339"><![CDATA[
Maybe I would be seen as a Troll as I'm a Windows guy, but please be gentle to an old man. Just some reflections that hopefully can add something.<br /><br />Interestingly enough, it seems like HID keyboards and mice are exclusively acquired by the operating system. In Windows (Win32) however, it seems like they are not exclusively acquired and such devices are okay to open if the access mode is set to &quot;shared&quot;. I don't know if something like that could be applied to the LibUSB/Linux implementation.<br /><br />The HID layer is built entirely on top of the USB stack and I cannot really see that such a &quot;wrapper&quot; could make a difference. The only HID functions needed to communicate with the Yubikey is the set and get feature class specific control transfers.<br /><br />I played around with the LibUSB Win32 some time ago, and the only low-level functions that I had to implement were these. <br /><br />int hidGetReport(YUBIKEY yk, int reportType, int reportNumber, char *buffer, int size)<br />{<br />    return usb_control_msg(yk, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_ENDPOINT_IN, HID_GET_REPORT,<br />    reportType &lt;&lt; 8 | reportNumber, 0, buffer, size, 1000) &gt; 0;<br />}<br /><br />int hidSetReport(YUBIKEY yk, int reportType, int reportNumber, char *buffer, int size)<br />{<br />    return usb_control_msg(yk, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_ENDPOINT_OUT, HID_SET_REPORT,<br />reportType &lt;&lt; 8 | reportNumber, 0, buffer, size, 1000) &gt; 0;<br />}<br /><br />I guess there are utility applets around that lights up the CapsLock/NumLock/ScrollLock buttons. These apps must face the same problem as these requests use the same mechanism. Anyone seen anything like that ? For Windows, it seems like there are a few.<br /><br />Regards,<br /><br />JakobE<br />Hardware- and firmware guy @ Yubico<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=83">Jakob</a> — Fri Mar 27, 2009 3:10 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Simon]]></name></author>
<updated>2009-03-27T10:03:36+01:00</updated>
<published>2009-03-27T10:03:36+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1335#p1335</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1335#p1335"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1335#p1335"><![CDATA[
<div class="quotetitle">Greg Woods wrote:</div><div class="quotecontent"><br />I get the same USB error. I have tried this workaround, on both Fedora 10 and CentOS 5, and the modprobe command comes back with:<br /><br />FATAL: Module usbhid not found.<br /></div><br /><br />Interesting, I have heard that some redhat variations don't use a module for usbhid.  Can you show us the output from the 'lsmod' command?<br /><br />Maybe you need to supply the parameters as kernel parameters when doing personalization. <img src="https://forum.yubico.com/images/smilies/icon_e_sad.gif" alt=":-(" title="Sad" /><br /><br />Exploring whether using libhid rather than libusb would solve this problem looks more important now.<br /><br />/Simon<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=2">Simon</a> — Fri Mar 27, 2009 10:03 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Greg Woods]]></name></author>
<updated>2009-03-25T16:39:20+01:00</updated>
<published>2009-03-25T16:39:20+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1326#p1326</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1326#p1326"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1326#p1326"><![CDATA[
I get the same USB error. I have tried this workaround, on both Fedora 10 and CentOS 5, and the modprobe command comes back with:<br /><br />FATAL: Module usbhid not found.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=356">Greg Woods</a> — Wed Mar 25, 2009 4:39 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[abandholm]]></name></author>
<updated>2009-03-15T15:43:01+01:00</updated>
<published>2009-03-15T15:43:01+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1294#p1294</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1294#p1294"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1294#p1294"><![CDATA[
<div class="quotetitle">Simon wrote:</div><div class="quotecontent"><br />Hi!  Thanks for testing this code!  I don't think many people have tested it, so we appreciate feedback here.  I think the problem you ran into is a device ownership problem which we know how to work around, please see:<br /><br /><!-- m --><a class="postlink" href="http://code.google.com/p/yubikey-core/source/browse/trunk/docs/quirks-and-workarounds.txt">http://code.google.com/p/yubikey-core/s ... rounds.txt</a><!-- m --><br /></div><br />Thanks! The hint works perfectly. I think I might write a small wrapper script along the lines:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">if &#91; `whoami` != 'root' &#93;<br />then<br />    echo &quot;Only root can do this...&quot;<br />    exit 1<br />fi<br /><br />rmmod usbhid &amp;&amp; modprobe usbhid quirks=0x1050:0x0010:0x04<br />./ykpersonalize &quot;$@&quot;<br />rmmod usbhid &amp;&amp; modprobe usbhid</div><br /><br /><div class="quotetitle">Simon wrote:</div><div class="quotecontent"><br />http://code.google.com/p/yubikey-core/source/browse/trunk/docs/quirks-and-workarounds.txt<br /><br />If you or someone else understands why this is needed, explaining that further would be appreciated.<br /></div><br />Actually I think the text describes the problem rather accurately... <img src="https://forum.yubico.com/images/smilies/icon_e_smile.gif" alt=":-)" title="Smile" /><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=436">abandholm</a> — Sun Mar 15, 2009 3:43 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Christer]]></name></author>
<updated>2009-03-11T00:30:08+01:00</updated>
<published>2009-03-11T00:30:08+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1270#p1270</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1270#p1270"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1270#p1270"><![CDATA[
While I'm not an expert in USB device programming, I feel that I have a fair understanding of what's going on here. I have been working on a native OS X version of the personalization tool (which uses libusb in its current state), and had similar issues with the app in my environment.<br /><br />What happens here is that Linux, just like OS X, has a USB HID layer built in to the OS. When you connect something that states that it's a HID device, for example a keyboard or a Yubikey, the OS will recognize it as such and the HID layer will take control over the device. Both OS X and Linux takes exclusive control over the device, which means that any other application that tries to open the device will receive a message that the device is busy.<br /><br />Now, I am assuming that the workaround in that document tells the HID layer of Linux to not bother taking control over the Yubikey. This results in two things: First, the HID layer will not lock the device which is good considering the personalization tool will now be able to open it. Second, the Yubikey will no longer be considered a keyboard by the operating system, but act as a generic USB device. This, of course, makes it impossible for the key to output any password. So you're left with being forced to reload the hid module without the quirks mode on the Yubikey.<br /><br />Now, the OS X kernel doesn't have a quirks mode like this, so I was out of luck there. Instead, I modified the code to not bother opening the Yubikey, which worked.. However, that's strictly against all documentation of how you're supposed to work with USB devices so I wasn't very satisfied with that solution.<br /><br />So, that left me with one option: Work with the OS rather than trying to force my way through. I dove into some documentation and found that OS X 10.5.5 (Leopard) included some new API for working with HID devices (lucky me!). So after some work, I've managed to implement a native OS X backend for the personalization tool. This backend replaces the libusb backend that's in the personalization tool as I write this, and is fully functional on my own system.<br /><br />The main problem with the personalization tool is quite simply that it tries to force its way into the Yubikey while it's being detected as a keyboard (and locked in exclusive access mode) by the host OS. While this seems to work fine under Windows, both Linux and OS X will complain similarly to what you've been seeing. To me, the correct way to get past this awkward workaround is to find out how an application can communicate with the Yubikey through the HID layer of the Linux kernel rather than brute-forcing its way to the USB device. Ideally, a project like libusb but targetted at the hid layers of the various operating systems would be great, but I haven't been able to find anything like it. (Note that there is a project called libhid which seems to be trying that, but they seem to be using libusb to get to the hardware rather than the real native HID APIs of the various host OSes).<br /><br />But as I said, I'm not an expert USB programmer, so some of these details may be wrong. <img src="https://forum.yubico.com/images/smilies/icon_e_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=73">Christer</a> — Wed Mar 11, 2009 12:30 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Simon]]></name></author>
<updated>2009-03-06T10:43:27+01:00</updated>
<published>2009-03-06T10:43:27+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1244#p1244</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1244#p1244"/>
<title type="html"><![CDATA[Re: USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1244#p1244"><![CDATA[
Hi!  Thanks for testing this code!  I don't think many people have tested it, so we appreciate feedback here.  I think the problem you ran into is a device ownership problem which we know how to work around, please see:<br /><br /><!-- m --><a class="postlink" href="http://code.google.com/p/yubikey-core/source/browse/trunk/docs/quirks-and-workarounds.txt">http://code.google.com/p/yubikey-core/s ... rounds.txt</a><!-- m --><br /><br />If you or someone else understands why this is needed, explaining that further would be appreciated.<br /><br />Thanks,<br />Simon<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=2">Simon</a> — Fri Mar 06, 2009 10:43 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[abandholm]]></name></author>
<updated>2009-03-05T14:12:58+01:00</updated>
<published>2009-03-05T14:12:58+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=282&amp;p=1225#p1225</id>
<link href="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1225#p1225"/>
<title type="html"><![CDATA[USB-problems with ykpersonalize (the Linux tool)]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=282&amp;p=1225#p1225"><![CDATA[
When I try to run a command like<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">./ykpersonalize -v -ostatic-ticket -ouid=ABA -ofixed=aba-static</div><br />I always get a USB-error:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">USB error: could not claim interface 0: Device or resource busy</div><br />Any hints?<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=436">abandholm</a> — Thu Mar 05, 2009 2:12 pm</p><hr />
]]></content>
</entry>
</feed>