diff options
Diffstat (limited to 'libcacard')
-rw-r--r-- | libcacard/Makefile | 5 | ||||
-rw-r--r-- | libcacard/cac.c | 1 | ||||
-rw-r--r-- | libcacard/card_7816.c | 2 | ||||
-rw-r--r-- | libcacard/card_7816t.h | 2 | ||||
-rw-r--r-- | libcacard/vcard_emul_nss.c | 1 | ||||
-rw-r--r-- | libcacard/vscclient.c | 19 |
6 files changed, 15 insertions, 15 deletions
diff --git a/libcacard/Makefile b/libcacard/Makefile index 47827a0eb..6b064485f 100644 --- a/libcacard/Makefile +++ b/libcacard/Makefile @@ -4,7 +4,8 @@ TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required libcacard-obj-y = $(stub-obj-y) $(libcacard-y) -libcacard-obj-y += util/osdep.o util/cutils.o util/qemu-timer-common.o util/error.o +libcacard-obj-y += util/osdep.o util/cutils.o util/qemu-timer-common.o +libcacard-obj-y += util/error.o util/qemu-error.o libcacard-obj-$(CONFIG_WIN32) += util/oslib-win32.o util/qemu-thread-win32.o libcacard-obj-$(CONFIG_POSIX) += util/oslib-posix.o util/qemu-thread-posix.o libcacard-obj-y += $(filter trace/%, $(util-obj-y)) @@ -24,7 +25,7 @@ vscclient$(EXESUF): libcacard/vscclient.o libcacard.la libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined \ -export-syms $(SRC_PATH)/libcacard/libcacard.syms -libcacard.la: LIBS += $(libcacard_libs) +libcacard.la: LIBS = $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) $(call LINK,$^) diff --git a/libcacard/cac.c b/libcacard/cac.c index 7a06b5a31..74ef3e3ce 100644 --- a/libcacard/cac.c +++ b/libcacard/cac.c @@ -189,7 +189,6 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu, pki_applet->sign_buffer = sign_buffer; pki_applet->sign_buffer_len = size; *response = vcard_make_response(VCARD7816_STATUS_SUCCESS); - ret = VCARD_DONE; break; case 0x00: /* we now have the whole buffer, do the operation, result will be diff --git a/libcacard/card_7816.c b/libcacard/card_7816.c index 8d06326da..c28bb60fe 100644 --- a/libcacard/card_7816.c +++ b/libcacard/card_7816.c @@ -232,7 +232,7 @@ vcard_apdu_set_class(VCardAPDU *apdu) { case 0xf0: default: apdu->a_gen_type = - (apdu->a_cla == 0xff) ? VCARD_7816_PTS : VCARD_7816_PROPIETARY; + (apdu->a_cla == 0xff) ? VCARD_7816_PTS : VCARD_7816_PROPRIETARY; break; } return VCARD7816_STATUS_SUCCESS; diff --git a/libcacard/card_7816t.h b/libcacard/card_7816t.h index 9333285d7..8eef0ce42 100644 --- a/libcacard/card_7816t.h +++ b/libcacard/card_7816t.h @@ -43,7 +43,7 @@ typedef enum { VCARD_7816_ISO, VCARD_7816_RFU, VCARD_7816_PTS, - VCARD_7816_PROPIETARY + VCARD_7816_PROPRIETARY } VCardAPDUType; diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c index fb429b1f8..ee2dfaee8 100644 --- a/libcacard/vcard_emul_nss.c +++ b/libcacard/vcard_emul_nss.c @@ -934,7 +934,6 @@ vcard_emul_init(const VCardEmulOptions *options) vreader = vreader_new(options->vreader[i].vname, vreader_emul, vreader_emul_delete); vreader_add_reader(vreader); - cert_count = options->vreader[i].cert_count; vcard_emul_alloc_arrays(&certs, &cert_len, &keys, options->vreader[i].cert_count); diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c index 5180d2945..3477ab3e1 100644 --- a/libcacard/vscclient.c +++ b/libcacard/vscclient.c @@ -58,7 +58,7 @@ static QemuMutex socket_to_send_lock; static guint socket_tag; static void -update_socket_watch(gboolean out); +update_socket_watch(void); static gboolean do_socket_send(GIOChannel *source, @@ -80,7 +80,7 @@ do_socket_send(GIOChannel *source, g_byte_array_remove_range(socket_to_send, 0, bw); if (socket_to_send->len == 0) { - update_socket_watch(FALSE); + update_socket_watch(); return FALSE; } return TRUE; @@ -89,7 +89,7 @@ do_socket_send(GIOChannel *source, static gboolean socket_prepare_sending(gpointer user_data) { - update_socket_watch(TRUE); + update_socket_watch(); return FALSE; } @@ -269,7 +269,7 @@ on_host_init(VSCMsgHeader *mhHeader, VSCMsgInit *incoming) send_msg(VSC_ReaderRemove, VSCARD_MINIMAL_READER_ID, NULL, 0); /* launch the event_thread. This will trigger reader adds for all the * existing readers */ - qemu_thread_create(&thread_id, event_thread, NULL, 0); + qemu_thread_create(&thread_id, "vsc/event", event_thread, NULL, 0); return 0; } @@ -407,7 +407,7 @@ do_socket_read(GIOChannel *source, } break; default: - g_warn_if_reached(); + g_assert_not_reached(); return FALSE; } @@ -440,8 +440,10 @@ do_socket(GIOChannel *source, } static void -update_socket_watch(gboolean out) +update_socket_watch(void) { + gboolean out = socket_to_send->len > 0; + if (socket_tag != 0) { g_source_remove(socket_tag); } @@ -645,7 +647,6 @@ main( GIOChannel *channel_stdin; char *qemu_host; char *qemu_port; - VSCMsgHeader mhHeader; VCardEmulOptions *command_line_options = NULL; @@ -754,14 +755,14 @@ main( .magic = VSCARD_MAGIC, .capabilities = {0} }; - send_msg(VSC_Init, mhHeader.reader_id, &init, sizeof(init)); + send_msg(VSC_Init, 0, &init, sizeof(init)); g_main_loop_run(loop); g_main_loop_unref(loop); g_io_channel_unref(channel_stdin); g_io_channel_unref(channel_socket); - g_byte_array_unref(socket_to_send); + g_byte_array_free(socket_to_send, TRUE); closesocket(sock); return 0; |