Statistics
| Branch: | Revision:

root / libcacard @ feature-archipelago

# Date Author Comment
73db416a 02/09/2014 01:06 pm Christophe Fergeau

libcacard: Don't link with all libraries QEMU links to

As described in https://bugzilla.redhat.com/show_bug.cgi?id=987441 ,
libcacard currently links to all the libraries QEMU is linking to,
including glusterfs libraries, libiscsi, ... libcacard does not need all of...

fa88afa5 12/16/2013 11:12 am Marc-André Lureau

vscclient: do not add a socket watch if there is not data to send

Fixes the following error:
  • (process:780): CRITICAL **: do_socket_send: assertion
    `socket_to_send->len != 0' failed

Signed-off-by: Marc-André Lureau <>
Signed-off-by: Gerd Hoffmann <>

5ad04fb6 12/09/2013 12:19 pm Stefan Weil

libcacard: Fix compilation for older versions of glib (bug #1258168)

See https://bugs.launchpad.net/bugs/1258168

libcacard/vscclient.c: In function 'do_socket_read':
libcacard/vscclient.c:410: warning: implicit declaration of function 'g_warn_if_reached'...

efbc42e5 12/02/2013 07:07 pm Stefan Weil

libcacard/vcard_emul_nss: Remove unused statement (value stored is never read)

Warning from ccc-analyzer:

libcacard/vcard_emul_nss.c:937:9: warning:
Value stored to 'cert_count' is never read
cert_count = options->vreader[i].cert_count;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~...

754e72e1 12/02/2013 07:07 pm Stefan Weil

libcacard/cac: Remove unused statement (value stored is never read)

Warning from ccc-analyzer:

libcacard/cac.c:192:13: warning: Value stored to 'ret' is never read
ret = VCARD_DONE;
^ ~~~~~~~~

Here 'ret' is assigned a value inside of a switch statement and also after...

16121fa3 09/23/2013 07:53 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/block' into staging

  1. By Stefan Hajnoczi (4) and others
  2. Via Stefan Hajnoczi
    • stefanha/block:
      virtio-blk: do not relay a previous driver's WCE configuration to the current
      blockdev: do not default cache.no-flush to true...
69fded48 09/20/2013 07:09 pm Michael Tokarev

vscclient: remove unnecessary use of uninitialized variable

Signed-off-by: Wenchao Xia <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Michael Tokarev <>

975a0015 09/18/2013 04:34 pm Stefan Hajnoczi

libcacard: link against qemu-error.o for error_report()

Signed-off-by: Stefan Hajnoczi <>

4c293dc6 09/01/2013 05:59 pm Stefan Weil

misc: Fix some typos in names and comments

Most typos were found using a modified version of codespell:

accross -> across
issueing -> issuing
TICNT_THRESHHOLD -> TICNT_THRESHOLD
bandwith -> bandwidth
VCARD_7816_PROPIETARY -> VCARD_7816_PROPRIETARY
occured -> occurred...

48f0475f 06/21/2013 09:52 pm Stefan Weil

libcacard: Fix cppcheck warning and remove unneeded code

The local function vcard_emul_alloc_arrays always returned PR_TRUE.
Therefore cppcheck complained about code which handled the
non-existent PR_FALSE case.

Remove the function's return value and the dead code....

581fe784 06/12/2013 03:04 pm Alon Levy

libcacard/vscclient: fix leakage of socket on error paths

Spotted by Coverity.

Signed-off-by: Alon Levy <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Michael Tokarev <>

57f97834 04/24/2013 11:48 am Alon Levy

libcacard/cac: change big switch functions to single return point

Signed-off-by: Alon Levy <>
Reviewed-by: Marc-André Lureau <>

0b6a16c1 04/24/2013 11:48 am Alon Levy

libcacard: move atr setting from macro to function

Only because qemu's checkpatch complains about it.

Signed-off-by: Alon Levy <>
Reviewed-by: Marc-André Lureau <>

7a685896 04/24/2013 11:48 am Alon Levy

libcacard/vreader: add debugging messages for apdu

Using g_debug with log domain libcacard

Signed-off-by: Alon Levy <>
Reviewed-by: Marc-André Lureau <>

a26dfd95 04/24/2013 11:47 am Alon Levy

libcacard: change default ATR

Signed-off-by: Alon Levy <>
Reviewed-by: Marc-André Lureau <>

ad2181f2 04/24/2013 11:47 am Marc-André Lureau

libcacard: remove default libcoolkey loading

Use only the modules defined in the NSS database.

Signed-off-by: Marc-André Lureau <>
Reviewed-by: Alon Levy <>

667e0b4b 04/24/2013 11:47 am Marc-André Lureau

libcacard: remove sql: prefix

For some reason, with sql:/ prefix, the PKCS11 modules are not loaded.

This patch goes on top of Alon smartcard series.

Signed-off-by: Marc-André Lureau <>
Reviewed-by: Alon Levy <>

c9495ee9 04/24/2013 11:47 am Marc-André Lureau

libcacard: teach vscclient to use GMainLoop for portability

This version handles non-blocking sending and receiving from the
socket.

Signed-off-by: Marc-André Lureau <>
Reviewed-by: Alon Levy <>

930c8ad4 04/24/2013 11:47 am Marc-André Lureau

libcacard: vscclient to use QemuThread for portability

Signed-off-by: Marc-André Lureau <>
Reviewed-by: Alon Levy <>

a50b831a 04/24/2013 11:47 am Marc-André Lureau

libcacard: split vscclient main() from socket reading

Signed-off-by: Marc-André Lureau <>
Reviewed-by: Alon Levy <>

e2d9c5e7 04/24/2013 11:47 am Marc-André Lureau

libcacard: use system config directory for nss db on win32

It's a bit nicer to look for default database under
CSIDL_COMMON_APPDATA\pki\nss rather that /etc/pki/nss.

Signed-off-by: Marc-André Lureau <>
Reviewed-by: Alon Levy <>

e2fd2115 04/24/2013 11:47 am Marc-André Lureau

libcacard: correct T0 historical bytes size

The VCARD_ATR_PREFIX macro adds a prefix of 6 characters only.

pcsc_scan was complaining before the patch:

+ Historical bytes: 56 43 41 52 44 5F 4E 53 53
ERROR! ATR is truncated: 2 byte(s) is/are missing

Signed-off-by: Marc-André Lureau <>...

be168af8 01/30/2013 12:14 pm Markus Armbruster

libcacard: Fix unchecked strdup() by converting to g_strdup()

Note that we already free with g_free().

Signed-off-by: Markus Armbruster <>
Reviewed-by: Eric Blake <>
Signed-off-by: Stefan Hajnoczi <>

ff667e2e 01/12/2013 07:42 pm Paolo Bonzini

build: fold trace-obj-y into libqemuutil.a

Signed-off-by: Paolo Bonzini <>

d9dc91ac 01/12/2013 07:42 pm Paolo Bonzini

libcacard: list oslib-obj-y file explicitly

We will grow the list of files in the next patches, but libcacard
should remain slim.

Signed-off-by: Paolo Bonzini <>

baacf047 01/12/2013 07:42 pm Paolo Bonzini

build: move libqemuutil.a components to util/

Signed-off-by: Paolo Bonzini <>

992aeb8e 01/12/2013 07:42 pm Paolo Bonzini

libcacard: rewrite Makefile in non-recursive style

Signed-off-by: Paolo Bonzini <>

26ca8c06 01/12/2013 07:42 pm Paolo Bonzini

libcacard: link vscclient to dynamic library

There is no reason for vscclient to duplicate the code. rules.mak
takes care of invoking libtool to do the link.

Signed-off-by: Paolo Bonzini <>

af0c8e9f 01/12/2013 06:19 pm Paolo Bonzini

libcacard: use per-target variable definitions

This lets the libcacard Makefile use more rules.mak magic.

Signed-off-by: Paolo Bonzini <>

5018f1cc 01/12/2013 06:19 pm Paolo Bonzini

libcacard: add list of exported symbols

Do not export internal QEMU symbols.

Signed-off-by: Paolo Bonzini <>

e832341b 01/12/2013 06:19 pm Alon Levy

libcacard: fix missing symbol in libcacard.so

Before patch:
$ make libcacard.la
$ nm ./libcacard/.libs/libcacard.so.0.0.0 | grep " U " | \
egrep -v "(g_)|(GLIBC)|(SECMOD)|(PK11)|(CERT)|(NSS)|(PORT)|(PR)"
U error_set

Signed-off-by: Alon Levy <>...

b6fc675b 01/12/2013 06:19 pm Paolo Bonzini

libcacard: require libtool to build it

Do not fail at build time, instead just disable the library if libtool
is not present.

Signed-off-by: Paolo Bonzini <>

591eca67 01/12/2013 06:19 pm Paolo Bonzini

libcacard: prepare to use -y trick in the Makefile

Rename variables to follow the conventions of the rest of the build
systems.

Signed-off-by: Paolo Bonzini <>

21655882 01/12/2013 06:19 pm Paolo Bonzini

build: support linking with libtool objects/libraries

This patch moves the complication of using libtool to the generic
rules.mak file.

Signed-off-by: Paolo Bonzini <>

f141ccfa 01/12/2013 06:19 pm Paolo Bonzini

build: make libtool verbose when making with V=1

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

a636be69 11/19/2012 11:48 am Paolo Bonzini

libcacard: link in stubs

Signed-off-by: Paolo Bonzini <>

31a32289 11/19/2012 11:48 am Paolo Bonzini

libcacard: make unnesting rules available to Makefile.objs

Signed-off-by: Paolo Bonzini <>

048d3612 10/06/2012 07:54 pm Aurelien Jarno

Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

  • 'trivial-patches' of git://github.com/stefanha/qemu:
    versatilepb: Use symbolic indices for ARM PIC
    qdev: kill bogus comment
    qemu-barrier: Fix compiler version check for future gcc versions...
4d5b97da 10/05/2012 04:10 pm Amos Kong

cleanup useless return sentence

This patch cleans up return sentences in the end of void functions.

Reported-by: Paolo Bonzini <>
Signed-off-by: Amos Kong <>
Signed-off-by: Stefan Hajnoczi <>

2e679780 10/05/2012 03:58 pm Jim Meyering

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 <>
Signed-off-by: Jim Meyering <>...

47ecbdf0 06/21/2012 11:04 pm Blue Swirl

libcacard: build fixes

Link trace objects to fix these errors:
LINK vscclient
oslib-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'...

00c705fb 06/07/2012 10:21 am Paolo Bonzini

build: libcacard Makefile cleanups

Build vscclient from toplevel Makefile, limit usage of vpath.

Signed-off-by: Paolo Bonzini <>

1b902f7d 03/26/2012 07:39 pm Alon Levy

libcacard/vcard_emul_nss: don't stop thread when there are no slots

Signed-off-by: Alon Levy <>

4e339882 03/26/2012 07:39 pm Alon Levy

libcacard/vcard_emul_nss: handle no readers at startup

When starting with no readers, coolkey should show no slots (with
RHBZ 806038 fixed). Fix initialization to launch the event handling
thread for each module that isn't the internal module regardless of the...

6f06f178 03/26/2012 07:39 pm Alon Levy

libcacard/vcard_emul_nss: add warning for old coolkey

Older coolkey versions (before the future fix of RHBZ 802435) have
a fake card reader created if no reader is detected during module
initialization. Warn libcacard users if the faulty coolkey is detected...

dac6b1b2 03/09/2012 08:30 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches' into staging

  • stefanha/trivial-patches:
    configure: Quote the configure args printed in config.log
    osdep: Remove local definition of macro offsetof
    libcacard: Spelling and grammar fixes in documentation...
02021812 03/09/2012 03:02 pm Hans de Goede

libcacard: Fix compilation with gcc-4.7

VCARD_ATR_PREFIX is used as part of an array initializer so it should
not have () around it, so far this happened to work, but gcc-4.7 does
not like it.

Signed-off-by: Hans de Goede <>
Signed-off-by: Anthony Liguori <>

ba79c886 03/08/2012 05:22 pm Stefan Weil

libcacard: Use format specifier %u instead of %d for unsigned values

splint reported warnings for those code statements.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

93148aa5 03/08/2012 05:22 pm Stefan Weil

Spelling fixes in comments (it's -> its)

  • it's -> its (fixed for all files)
  • dont -> don't (only fixed in a line which was touched by the previous fix)
  • distrub -> disturb (fixed in the same line)

Reviewed-by: Andreas Färber <>
Signed-off-by: Stefan Weil <>...

0082f433 02/27/2012 02:37 pm Alon Levy

libcacard: fix reported ATR length

Signed-off-by: Alon Levy <>
Signed-off-by: Gerd Hoffmann <>

57c83dac 02/09/2012 06:44 pm Stefan Weil

make: Remove duplicate use of GLIB_CFLAGS

Makefile, Makefile.hw, Makefile.target and libcacard/Makefile
added GLIB_CFLAGS to QEMU_CFLAGS.

Makefile.objs does this, too, and is included by all other
Makefiles, so GLIB_CFLAGS were added twice (reported by malc)....

cba919da 12/02/2011 12:50 pm Dong Xu Wang

fix spelling in libcacard sub directory

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

d9676f82 10/25/2011 04:44 pm Stefan Weil

libcacard: Fix wrong assertion (reported by cppcheck)

assert("...") will never do anything. This assertion handles a case
which should never occur, so it must be assert(!"...").

Cc: Alon Levy <>
Signed-off-by: Stefan Weil <>

7fc7e584 10/25/2011 04:44 pm Alon Levy

libcacard/cac: fix typo in cac_delete_pki_applet_private

Signed-off-by: Alon Levy <>

e7c5e893 10/25/2011 04:44 pm Alon Levy

libcacard/vscclient: fix error paths for socket creation

Signed-off-by: Alon Levy <>

c2162a8b 09/21/2011 12:49 pm Jan Kiszka

Silence make if nothing is to do for libcacard

Signed-off-by: Jan Kiszka <>
Signed-off-by: Stefan Hajnoczi <>

9f4facbc 09/02/2011 01:08 pm Brad Smith

libcacard: use INSTALL_DATA for data

Signed-off-by: Brad Smith <>
Signed-off-by: Stefan Hajnoczi <>

2542bfd5 08/29/2011 01:47 pm Stefan Weil

Fix spelling in comments and debug messages (recieve -> receive)

Signed-off-by: Stefan Weil <>
Reviewed-by: Andreas Färber <>
Signed-off-by: Stefan Hajnoczi <>

0fc6b582 08/27/2011 06:42 pm Brad

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 the
libcacard/Makefile. From looking at the code it doesn't seem this is necessary
anyway. Robert Relyea seems to think it most likely isn't necessary....

3f534581 08/22/2011 06:20 pm Brad

Improvements to libtool support.

Improvements to the libtool support in QEMU. Replace hard coded
libtool in the infrastructure with $(LIBTOOL) and allow
overriding the libtool binary used via the configure
script.

Reviewed-by: Andreas F=E4rber <>...

1f22a6bc 08/22/2011 06:19 pm Diego Elio Pettenò

build: list libraries after objects, for proper linkage

Without this change, when using -Wl,--as-needed with GNU linker, the
libraries would be discarded.

Signed-off-by: Diego Elio Pettenò <>
Signed-off-by: Anthony Liguori <>

92f562ec 08/21/2011 04:37 pm Anthony Liguori

Remove remenants of qemu_malloc

This covers the various check commands

Signed-off-by: Anthony Liguori <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

14015304 08/21/2011 07:01 am Anthony Liguori

Make glib mandatory and fixup utils appropriately

Signed-off-by: Anthony Liguori <>

4995f0d6 08/02/2011 02:57 pm Alon Levy

libcacard: use INSTALL_DATA for data

Signed-off-by: Alon Levy <>

0f94d6da 07/26/2011 10:42 am Alon Levy

libcacard: add pc file, install it + includes

Additionally:
+ add --includedir configure parameters
+ make install-libcacard install vscclient as well

010debef 07/22/2011 06:05 pm Robert Relyea

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 the
actual operations. Try to detect those cases and treat them as if the token
didn't claim support for X_509....

ee83d414 07/22/2011 06:05 pm Christophe Fergeau

libcacard: don't leak vcard_emul_alloc_arrays mem

vcard_emul_mirror_card and vcard_emul_init use
vcard_emul_alloc_arrays to allocate memory for temporary arrays
which will contain elements that in the end will be used one by
one in cac_card_init. The arrays themselves are never stored...

00965167 07/22/2011 06:05 pm Christophe Fergeau

libcacard: s/strip(args++)/strip(args+1)

vcard_emul_options used args = strip(args++) a few times, which
was not returning the expected result since the rest of the code
expected args to be increased by at least 1, which is not the case
if *args is not a blank space when this function is called....

a5aa842a 07/22/2011 06:05 pm Christophe Fergeau

libcacard: fix soft=... parsing in vcard_emul_options

The previous parser had copy and paste errors when computing
vname_length and type_params_length, "name" was used instead
of respectively vname and type_params. This led to length that could
be bigger than the input string, and to access out of the array...

d246b3cf 07/22/2011 06:05 pm Christophe Fergeau

libcacard: introduce NEXT_TOKEN macro

vcard_emul_options now has repetitive code to read the current
token and advance to the next. After the previous changes,
this repetitive code can be moved in a NEXT_TOKEN macro to
avoid having this code duplicated.
...

2b56cb87 07/22/2011 06:05 pm Christophe Fergeau

libcacard: replace copy_string with strndup

copy_string reimplements strndup, this commit removes it and
replaces all copy_string uses with strndup.

Signed-off-by: Christophe Fergeau <>
Reviewed-by: Alon Levy <>

44dc0ca3 06/14/2011 05:34 pm Alon Levy

libcacard: add libcacard.la target

No flag to configure is required. Instead, added a libcacard.la target that
is not built by default, only when requested explicitly via:

mkdir build
cd build
../configure
make libcacard.la
make install-libcacard

Uses libtool to do actual linking of object files and shared library, and...

6774e44a 05/08/2011 01:44 pm Paolo Bonzini

libcacard: add correct subdirectory dependencies

Signed-off-by: Paolo Bonzini <>
Cc:
Signed-off-by: Stefan Hajnoczi <>

0cf818c4 05/08/2011 12:02 pm Stefan Weil

Fix typos in comments (existance -> existence)

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

fc27eefe 05/08/2011 12:02 pm Stefan Weil

Fix typo in comment (consistant -> consistent)

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

685ff50f 04/17/2011 09:40 pm Alon Levy

libcacard: fix opposite usage of isspace

Signed-off-by: Alon Levy <>
Tested-by: Hans de Goede <>
Signed-off-by: Aurelien Jarno <>

2ac85b93 04/02/2011 03:07 am Robert Relyea

libcacard: add vscclient

client to talk to ccid-card-passthru and use smartcard on client to
perform 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

0c165247 04/02/2011 03:07 am Alon Levy

introduce libcacard/vscard_common.h


Signed-off-by: Alon Levy <>

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...

111a38b0 04/02/2011 03:07 am Robert Relyea

libcacard: initial commit

libcacard emulates a Common Access Card (CAC) which is a standard
for smartcards. It is used by the emulated ccid card introduced in
a following patch. Docs are available in docs/libcacard.txt

Signed-off-by: Alon Levy <>...