diff options
author | Jakub Jelen <jjelen@redhat.com> | 2018-08-02 11:43:35 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-08-02 15:23:33 +0200 |
commit | f2b58b03d07a404550f89e8835f932b152fb5aa3 (patch) | |
tree | 76621a3d8551d3c2bbadbe5e90e070c46510f1be /tests | |
parent | b56eb2e9fb7b6e000f6b6cdaae63c03b48ce12c2 (diff) |
Adjust PKI Applet to CAC 2
* This involves creation of properties structures in the applet,
that are used to discover pki buffers in the applet and its
properties.
* This also removes the old way of accessing certificates using
GET CERTIFICATE APDU also with the test
* This uses the new function vcard_emul_rsa_bits() to expose the
real key size in properties buffer
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Robert Relyea <rrelyea@redhat.com>
Message-Id: <20180802094407.4104-4-jjelen@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libcacard.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/tests/libcacard.c b/tests/libcacard.c index b76e98e..88eeec5 100644 --- a/tests/libcacard.c +++ b/tests/libcacard.c @@ -145,7 +145,7 @@ static void test_cac(void) { VReader *reader = vreader_get_reader_by_id(0); VReaderStatus status; - int dwRecvLength = APDUBufSize, len; + int dwRecvLength = APDUBufSize; uint8_t pbRecvBuffer[APDUBufSize]; uint8_t selfile0[] = { 0x00, 0xa4, 0x04, 0x00, 0x07, 0xa0, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00 @@ -153,9 +153,6 @@ static void test_cac(void) uint8_t getresp[] = { 0x00, 0xc0, 0x00, 0x00, 0x07 }; - uint8_t getcert[] = { - 0x00, 0x36, 0x00, 0x00, 0x00 - }; g_assert_nonnull(reader); status = vreader_xfr_bytes(reader, @@ -174,26 +171,7 @@ static void test_cac(void) g_assert_cmphex(pbRecvBuffer[7], ==, VCARD7816_SW1_SUCCESS); g_assert_cmphex(pbRecvBuffer[8], ==, 0x0); - len = 0xff; - do { - dwRecvLength = APDUBufSize; - getcert[4] = len; - status = vreader_xfr_bytes(reader, - getcert, sizeof(getcert), - pbRecvBuffer, &dwRecvLength); - g_assert_cmpint(status, ==, VREADER_OK); - g_assert_cmpint(dwRecvLength, ==, len + 2); - switch (pbRecvBuffer[len]) { - case VCARD7816_SW1_WARNING_CHANGE: - len = pbRecvBuffer[len+1]; - break; - case VCARD7816_SW1_SUCCESS: - len = 0; - break; - default: - g_assert_not_reached(); - } - } while (len != 0); + /* The old way of reading certificate does not work anymore */ vreader_free(reader); /* get by id ref */ } |