]> err.no Git - yubikey-personalization/commitdiff
use passed-in vendor_id and product_id instead of constants
authorKlas Lindfors <klas@yubico.com>
Tue, 18 Sep 2012 06:59:31 +0000 (08:59 +0200)
committerKlas Lindfors <klas@yubico.com>
Tue, 18 Sep 2012 06:59:31 +0000 (08:59 +0200)
ykcore/ykcore_libusb-1.0.c
ykcore/ykcore_libusb.c

index b7df1b312c964eb4d4be258d224d53e57e02b175..03630a6ac3e3fe9587bfe48d30ab6a05dfa0b0da 100644 (file)
@@ -171,7 +171,7 @@ void *_ykusb_open_device(int vendor_id, int product_id)
                if (ykl_errno != 0)
                        goto done;
 
-               if (desc.idVendor == YUBICO_VID && desc.idProduct == YUBIKEY_PID) {
+               if (desc.idVendor == vendor_id && desc.idProduct == product_id) {
                        rc = YK_EUSBERR;
                        ykl_errno = libusb_open(dev, &h);
                        if (ykl_errno != 0)
index c21047899da8c904ae64eec4fdf533642edba9d0..dac4fc1ef9b0c3c9d30ae2fffafd1c517cd19170 100644 (file)
@@ -155,8 +155,8 @@ void *_ykusb_open_device(int vendor_id, int product_id)
        for (bus = usb_get_busses(); bus; bus = bus->next) {
                rc = YK_ENOKEY;
                for (dev = bus->devices; dev; dev = dev->next)
-                       if (dev->descriptor.idVendor == YUBICO_VID
-                           && dev->descriptor.idProduct == YUBIKEY_PID) {
+                       if (dev->descriptor.idVendor == vendor_id
+                           && dev->descriptor.idProduct == product_id) {
                                rc = YK_EUSBERR;
                                h = usb_open(dev);
 #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP