libcacard/vcard_emul_nss: use pstrcpy in place of strncpy
Replace strncpy+NUL-terminate use with use of pstrcpy.This requires linking with cutils.o (or else vssclient doesn't link),so add that in the Makefile.
Acked-by: Alon Levy <alevy@redhat.com>Signed-off-by: Jim Meyering <meyering@redhat.com>...
libcacard: build fixes
Link trace objects to fix these errors: LINK vscclientoslib-posix.o: In function `trace_qemu_vfree':/src/qemu/obj-amd64/./trace.h:39: undefined reference to `trace1'oslib-posix.o: In function `trace_qemu_memalign':/src/qemu/obj-amd64/./trace.h:31: undefined reference to `trace3'...
build: libcacard Makefile cleanups
Build vscclient from toplevel Makefile, limit usage of vpath.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
libcacard/vcard_emul_nss: don't stop thread when there are no slots
Signed-off-by: Alon Levy <alevy@redhat.com>
libcacard/vcard_emul_nss: handle no readers at startup
When starting with no readers, coolkey should show no slots (withRHBZ 806038 fixed). Fix initialization to launch the event handlingthread for each module that isn't the internal module regardless of the...
libcacard/vcard_emul_nss: add warning for old coolkey
Older coolkey versions (before the future fix of RHBZ 802435) havea fake card reader created if no reader is detected during moduleinitialization. Warn libcacard users if the faulty coolkey is detected...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
libcacard: Fix compilation with gcc-4.7
VCARD_ATR_PREFIX is used as part of an array initializer so it shouldnot have () around it, so far this happened to work, but gcc-4.7 doesnot like it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
libcacard: Use format specifier %u instead of %d for unsigned values
splint reported warnings for those code statements.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Spelling fixes in comments (it's -> its)
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
libcacard: fix reported ATR length
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
make: Remove duplicate use of GLIB_CFLAGS
Makefile, Makefile.hw, Makefile.target and libcacard/Makefileadded GLIB_CFLAGS to QEMU_CFLAGS.
Makefile.objs does this, too, and is included by all otherMakefiles, so GLIB_CFLAGS were added twice (reported by malc)....
fix spelling in libcacard sub directory
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
libcacard: Fix wrong assertion (reported by cppcheck)
assert("...") will never do anything. This assertion handles a casewhich should never occur, so it must be assert(!"...").
Cc: Alon Levy <alevy@redhat.com>Signed-off-by: Stefan Weil <sw@weilnetz.de>
libcacard/cac: fix typo in cac_delete_pki_applet_private
libcacard/vscclient: fix error paths for socket creation
Silence make if nothing is to do for libcacard
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
libcacard: use INSTALL_DATA for data
Signed-off-by: Brad Smith <brad@comstyle.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix spelling in comments and debug messages (recieve -> receive)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Reviewed-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix build on OpenBSD with BSD userland emu and smartcard NSS enabled
The first issue is the hard coded POSIX Real Time extensions library in thelibcacard/Makefile. From looking at the code it doesn't seem this is necessaryanyway. Robert Relyea seems to think it most likely isn't necessary....
Improvements to libtool support.
Improvements to the libtool support in QEMU. Replace hard codedlibtool in the infrastructure with $(LIBTOOL) and allowoverriding the libtool binary used via the configurescript.
Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de>...
build: list libraries after objects, for proper linkage
Without this change, when using -Wl,--as-needed with GNU linker, thelibraries would be discarded.
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove remenants of qemu_malloc
This covers the various check commands
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Make glib mandatory and fixup utils appropriately
libcacard: add pc file, install it + includes
Additionally: + add --includedir configure parameters + make install-libcacard install vscclient as well
libcacard/vcard_emul_nss: support cards lying about CKM_RSA_X_509 support
Some tokens claim to do CKM_RSA_X_509, but then choke when they try to do theactual operations. Try to detect those cases and treat them as if the tokendidn't claim support for X_509....
libcacard: don't leak vcard_emul_alloc_arrays mem
vcard_emul_mirror_card and vcard_emul_init usevcard_emul_alloc_arrays to allocate memory for temporary arrayswhich will contain elements that in the end will be used one byone in cac_card_init. The arrays themselves are never stored...
libcacard: s/strip(args++)/strip(args+1)
vcard_emul_options used args = strip(args++) a few times, whichwas not returning the expected result since the rest of the codeexpected args to be increased by at least 1, which is not the caseif *args is not a blank space when this function is called....
libcacard: fix soft=... parsing in vcard_emul_options
The previous parser had copy and paste errors when computingvname_length and type_params_length, "name" was used insteadof respectively vname and type_params. This led to length that couldbe bigger than the input string, and to access out of the array...
libcacard: introduce NEXT_TOKEN macro
vcard_emul_options now has repetitive code to read the currenttoken and advance to the next. After the previous changes,this repetitive code can be moved in a NEXT_TOKEN macro toavoid having this code duplicated....
libcacard: replace copy_string with strndup
copy_string reimplements strndup, this commit removes it andreplaces all copy_string uses with strndup.
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>Reviewed-by: Alon Levy <alevy@redhat.com>
libcacard: add libcacard.la target
No flag to configure is required. Instead, added a libcacard.la target thatis not built by default, only when requested explicitly via:
mkdir buildcd build../configuremake libcacard.lamake install-libcacard
Uses libtool to do actual linking of object files and shared library, and...
libcacard: add correct subdirectory dependencies
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: qemu-trivial@nongnu.orgSigned-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix typos in comments (existance -> existence)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix typo in comment (consistant -> consistent)
libcacard: fix opposite usage of isspace
Signed-off-by: Alon Levy <alevy@redhat.com>Tested-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
libcacard: add vscclient
client to talk to ccid-card-passthru and use smartcard on client toperform actual operations.
v23->v24 changes: (Jes Sorensen review 2) * use qemu_socket instead of socket * use fprintf(stderr,..) for errors * remove unneccessary includes since using qemu_common.h
introduce libcacard/vscard_common.h
v20->v21 changes: (Jes Sorensen review) * license set to 2+ * long comment fixes, remove empty line at eof. * add reference to COPYING
v19->v20 changes: * checkpatch.pl...
libcacard: initial commit
libcacard emulates a Common Access Card (CAC) which is a standardfor smartcards. It is used by the emulated ccid card introduced ina following patch. Docs are available in docs/libcacard.txt
Signed-off-by: Alon Levy <alevy@redhat.com>...