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

Jakub Jelen jjelen at redhat.com
Tue Jul 31 14:50:15 UTC 2018


Signed-off-by: Jakub Jelen <jjelen at redhat.com>
Reviewed-by: Robert Relyea <rrelyea at redhat.com>
---
 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



More information about the Spice-devel mailing list