diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2014-10-30 17:04:29 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2014-10-30 17:04:29 +0000 |
| commit | f33f43bd86beb94ae1be14a62dc89cbeb4a665bb (patch) | |
| tree | fbe5c32f91c47ca42f68919ea183a1ed61f25df7 /libcacard/cac.c | |
| parent | 3c1d9a15be679afd3fb9173a242827ff2d43af8f (diff) | |
| parent | a65e4ef90f0fb437b8e74e250a6f94aa4ecfa25c (diff) | |
| download | focaccia-qemu-f33f43bd86beb94ae1be14a62dc89cbeb4a665bb.tar.gz focaccia-qemu-f33f43bd86beb94ae1be14a62dc89cbeb4a665bb.zip | |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20141028-1' into staging
Fixes for libcacard (usb smartcard emulation), xhci and uhci. # gpg: Signature made Tue 28 Oct 2014 10:39:52 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-20141028-1: uhci: remove useless DEBUG xhci: add property to turn on/off streams support libcacard: don't free sign buffer while sign op is pending libcacard: Lock NSS cert db when selecting an applet on an emulated card libcacard: introduce new vcard_emul_logout Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'libcacard/cac.c')
| -rw-r--r-- | libcacard/cac.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libcacard/cac.c b/libcacard/cac.c index ae8c3784b9..f38fdceddd 100644 --- a/libcacard/cac.c +++ b/libcacard/cac.c @@ -115,6 +115,7 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu, VCardAppletPrivate *applet_private; int size, next; unsigned char *sign_buffer; + bool retain_sign_buffer = FALSE; vcard_7816_status_t status; VCardStatus ret = VCARD_FAIL; @@ -178,6 +179,7 @@ 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); + retain_sign_buffer = TRUE; break; case 0x00: /* we now have the whole buffer, do the operation, result will be @@ -200,9 +202,11 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu, VCARD7816_STATUS_ERROR_P1_P2_INCORRECT); break; } - g_free(sign_buffer); - pki_applet->sign_buffer = NULL; - pki_applet->sign_buffer_len = 0; + if (!retain_sign_buffer) { + g_free(sign_buffer); + pki_applet->sign_buffer = NULL; + pki_applet->sign_buffer_len = 0; + } ret = VCARD_DONE; break; case CAC_READ_BUFFER: |