From owner-freebsd-usb@FreeBSD.ORG Tue Jun 9 02:21:14 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3C381065670 for ; Tue, 9 Jun 2009 02:21:14 +0000 (UTC) (envelope-from gldisater@gmail.com) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.221.173]) by mx1.freebsd.org (Postfix) with ESMTP id 58DE18FC14 for ; Tue, 9 Jun 2009 02:21:14 +0000 (UTC) (envelope-from gldisater@gmail.com) Received: by qyk3 with SMTP id 3so4863175qyk.3 for ; Mon, 08 Jun 2009 19:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=eYVgKkI0YNdazoS0OmUuWkj5IllgC6zmh4PVrLTW4xg=; b=sVAF98tPJZxoVccgdnNx0An+HKSbRIz10dNsZGyDpLGitHHcgTNNwmYnMaSGWw1u9z LJbfTy0jSMVUnHwqnblP4UlZNGL6ZqEOB9IaHaOQB2VmRWuyvskqbpwbn/7dRA8KXy+f znlx5WZ8wrqBQHjA1VLP8gf2D3weNHa8j33+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=OERTzE63B2P/Ti3D/WN6asNnkLbwjc8HDFdekSc2PF3CQxgVwbpUlRUPfUwsn+sq4/ vAxMfUjfRoP5LcBb8ZUzXlO65emq/AU3P7Dhz7aKg7WXTCDYJP6Z/vvJXeLi1HT23N7z G/u8KMg18va4Lmq6bV5/HxBOxXDxnEzhQaCgU= Received: by 10.224.74.6 with SMTP id s6mr7490390qaj.327.1244514073728; Mon, 08 Jun 2009 19:21:13 -0700 (PDT) Received: from ?192.168.1.3? (CPE0013100d8fd9-CM00195eca698c.cpe.net.cable.rogers.com [99.237.60.47]) by mx.google.com with ESMTPS id 6sm648578qwk.40.2009.06.08.19.21.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Jun 2009 19:21:13 -0700 (PDT) Message-ID: <4A2D8EB7.4050305@gmail.com> Date: Mon, 08 Jun 2009 22:20:39 +0000 From: Jeremy Faulkner User-Agent: Thunderbird 2.0.0.21 (X11/20090518) MIME-Version: 1.0 To: Hans Petter Selasky References: <200906082127.35793.hselasky@c2i.net> In-Reply-To: <200906082127.35793.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: usb@freebsd.org Subject: Re: Yubikey - cont'd X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2009 02:21:14 -0000 Hans Petter Selasky wrote: > On Monday 08 June 2009 02:07:32 Jeremy Faulkner wrote: >> Thanks for the reply Hans. I can't reply to the original thread as I >> wasn't subscribed to usb@ and didn't mention that in my previous >> email. I'm subscribed now. >> >> I assume you meant 'cat /dev/usb/5.5.1 | hexdump -C' as 'hexdump C' >> expects C to be a file. I've attached the output of hexdump when the >> Yubikey is triggered. > > Your Yubikey input looks like the input of a keyboard. I'm a little bit > busy at the moment. What needs to be done is to search for Yubikey in the > NetBSD ukbd.c driver (sys/dev/usb) and port those changes to the FreeBSD > ukbd.c driver (sys/dev/usb/input). Is that something you can do? > > You might find the following link useful: > > http://fxr.watson.org > > --HPS There were no occurances of Yubikey in fxr.watson.org so I checked the FreeBSD ukbd.c to see if it was rejecting the Yubikey for some reason. I found in ukbd_probe() that it required that the keyboard have InterfaceSubClass == UISUBCLASS_BOOT and InterfaceProtocol == UPROTO_BOOT_KEYBOARD in order to attach. I don't know what they're for but the Yubikey has no subclass or interface protocol set. To test this I hacked it to return 0 if the idVendor is that of Yubico (0x1050) and it attached as ukbd0 (kbd2) and worked. Perhaps it would be better to create a USB Quirk for forced ukbd attach than to have the Yubico vendor id in ukbd_probe() Also, I don't know what the difference between UPROTO_BOOT_KEYBOARD (defined in ukbd.c) and UIPROTO_BOOT_KEYBOARD (defined in usb.h) -- Jeremy Faulkner