[PATCH libcacard 21/45] tests: Get properties with argument selecting only subset of tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jakub Jelen <jjelen@xxxxxxxxxx>
Reviewed-by: Robert Relyea <rrelyea@xxxxxxxxxx>
---
 tests/libcacard.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/libcacard.c b/tests/libcacard.c
index 5bbd080..9fc4462 100644
--- a/tests/libcacard.c
+++ b/tests/libcacard.c
@@ -157,6 +157,10 @@ static void get_properties(VReader *reader, int object_type)
         /* Get properties */
         0x80, 0x56, 0x01, 0x00, 0x00
     };
+    uint8_t get_properties_tag[] = {
+        /* Get properties             [tag list] */
+        0x80, 0x56, 0x02, 0x00, 0x02, 0x01, 0x01, 0x00
+    };
     int verified_pki_properties = 0;
     int num_objects = 0, num_objects_expected = -1;
 
@@ -261,6 +265,15 @@ static void get_properties(VReader *reader, int object_type)
     if (object_type == TEST_PKI) {
         g_assert_cmpint(verified_pki_properties, ==, 1);
     }
+
+    dwRecvLength = APDUBufSize;
+    status = vreader_xfr_bytes(reader,
+                               get_properties_tag, sizeof(get_properties_tag),
+                               pbRecvBuffer, &dwRecvLength);
+    g_assert_cmpint(status, ==, VREADER_OK);
+    g_assert_cmpint(dwRecvLength, ==, 16); /* Two applet information buffers + status */
+    g_assert_cmpint(pbRecvBuffer[dwRecvLength-2], ==, VCARD7816_SW1_SUCCESS);
+    g_assert_cmpint(pbRecvBuffer[dwRecvLength-1], ==, 0x00);
 }
 
 static void get_acr(VReader *reader)
-- 
2.17.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]