Am Sonntag, 23. März 2008 21:36:57 schrieb Bruno Harbulot:
> Perhaps the following question should be on the users
list...
> I was intending to try OpenCT on OSX to see if it could
handle an eToken
> in the same way as it makes it work on Linux. I can't
get it to work on
> OSX, but I'm not sure if it's because I haven't
configured it properly
> or if it's because it's not currently supported. By the
looks of
> src/ifd/sys-osx.c, it looks like none of the usb
functions are doing much.
openct usb code was written on linux with the nice linux usb
semantics:
open a device file, use ioctl for the usb functions, but
also use standard
mechanism like poll() / select() to see if the file
descriptor is ok (i.e.
find out when the device was removed). BSD also works with
this - nice.
but mac os X has - to my knowledge - only a strange library
that doesn't
offer equivalent functionality. AFAIK we can't implement the
same
functionality we use on linux and BSD with mac os X usb
library api,
without redesigning openct. but I might be wrong. if you
know mac os X
well, maybe you can have a look at that usb library API it
offers, and see
if you can implement the same functions we have on linux?
if the linux code doesn't make sence, I can help with
explaining what it does,
so you can port the functionality.
the ifdhandler main loop will need some changes too:
currently it assumes
to have an array of file descriptor and find out if a device
was removed via
select/poll with errors. on mac os X there is no file
descriptor, thus this
needs some change.
finally: linux has hot plugging -> we don't need to
monitor the usb or scan it
all the time. instead the kernel knows when a new device is
attached, and
using a chain of userspace tools the openct map file with
vendor/product or
usb device class info is consulted. if it matches the
openct-control tool is
run with information about the device and its
identification.
I have no clue if some tool on mac os X can tell openct:
hey, here is this new
device and it has that vendor and product id. on linux
"this new device" is
the filename of the usb device file - such as
/proc/bus/usb/005/010
or /dev/bus/usb/005/010. on linux the information about the
files openct
can handle is for hotplug: the map file, for udev the rule
file or for hald
the fdi file. if you have a similar mechanism for mac os X,
I guess you need
to implement a similar file for that mechanism, a script
that gets information
from that mechanism and runs openct-control with the right
parameters,
and in sys-osx.c implement something that looks at the
device string
and uses the api to connect to the right device.
I have no clue if implementing this is hard or not, but I
have no mac os X
knowledge, no machine, and I'm not interested in it myself.
so this waits
for someone to have a look.
if you look for a working solution without any work,
checkout pcsc-lite and
ccid driver by ludovic rousseau. mac os X includes both, but
you might want
to use the latest version from the author instead because of
some bugs in
the version apple put into mac os X - ludovic can tell you
more about it.
good luck. Regards, Andreas
_______________________________________________
opensc-devel mailing list
opensc-devel lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
|