[Spice-devel] [ANNOUNCE] libcacard 2.7.0 release

2019-07-23 Thread Jakub Jelen
used as part of the detection process in Windows. This release can be found at the following locations: https://www.spice-space.org/download/libcacard/ https://gitlab.freedesktop.org/spice/libcacard/-/releases It is signed with my GPG key: F7DC 50A5 7DFD 52B9 4253 295E F649 07AC 15B5 C33D Jakub

[Spice-devel] libcacard 2.8.0 release

2020-10-08 Thread Jakub Jelen
/ https://gitlab.freedesktop.org/spice/libcacard/-/releases It is signed with Viktor Toso's GPG key: 206D 3B35 2F56 6F3B 0E65 72E9 97D9 123D E37A 484F Regards, Jakub Jelen ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org

[Spice-devel] Libcacard bugfixes

2018-07-31 Thread Jakub Jelen
Hello all, during my work on libcacard, I identified several issues that are not completely related to the thing I was working on, but make sense to have them fixed, including potential crashes, and behavior that does not match existing cards. They are fixed in the following commits. Other feature

[Spice-devel] [PATCH libcacard 4/7] vscclient: learn to diff with real card for debug

2018-07-31 Thread Jakub Jelen
without PCSC support and adds colors for better oriantation in the differences. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am | 4 +- src/vscclient.c | 161 +--- 2 files changed, 156 insertions(+), 9 deletions(-) diff --git a

[Spice-devel] [PATCH libcacard 7/7] vcard_emul: Missing cleanup

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/vcard_emul_nss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c index c320f8f..c75bc3b 100644 --- a/src/vcard_emul_nss.c +++ b/src/vcard_emul_nss.c @@ -673,6 +673,7

[Spice-devel] [PATCH libcacard 2/7] vcard_emul_nss: Do not segfault on bad data

2018-07-31 Thread Jakub Jelen
* In case we already know that the card does not know raw RSA nor the data look like PKCS#1.5, we need to gracefully return. * If the client passed invalid data, the applications used to segfault here because of negative length argument to memset(). Signed-off-by: Jakub Jelen Reviewed

[Spice-devel] [PATCH libcacard 1/7] Do not logout after every applet selection

2018-07-31 Thread Jakub Jelen
* This might need some attention Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/vcard.c | 4 src/vcard_emul_nss.c | 4 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vcard.c b/src/vcard.c index 2edf1d0..afa3bb8 100644 --- a/src/vcard.c +++ b/src

[Spice-devel] [PATCH libcacard 3/7] vcard_emul_nss: Avoid memory leaks

2018-07-31 Thread Jakub Jelen
* This structure was never freed Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/vcard_emul_nss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c index f2678d5..0c8f0e9 100644 --- a/src/vcard_emul_nss.c +++ b/src/vcard_emul_nss.c

[Spice-devel] [PATCH libcacard 5/7] docs: Update documentation to reflect current state, link it from README

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- README.md | 2 ++ docs/libcacard.txt | 48 -- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3f4b9bf..ec67f02 100644 --- a/README.md

[Spice-devel] [PATCH libcacard 6/7] typos

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/vcard_emul_nss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c index 0c8f0e9..c320f8f 100644 --- a/src/vcard_emul_nss.c +++ b/src/vcard_emul_nss.c @@ -246,7 +246,7

[Spice-devel] [PATCH libcacard] Do not fail, if the caller didn't pick up response from previous call

2016-08-15 Thread Jakub Jelen
APDU request (I would left for consideration to somehow log such problem). Patch was successfully tested on Fedora 24 host and solves our problem (though we worked around the problem already in the driver too). [1] https://github.com/SPICE/libcacard/pull/1 Kind regards, Jakub Jelen >F

Re: [Spice-devel] [PATCH libcacard] Do not fail, if the caller didn't pick up response from previous call

2016-08-16 Thread Jakub Jelen
The patch was prepared using git format-patch If the send-email was intended, it should be mentioned explicitly. [1] http://www.spice-space.org/developers.html Regards, -- Jakub Jelen Associate Software Engineer Security Technologies Red Hat ___ Spice-d

[Spice-devel] [PATCH libcacard 01/45] vimconfig + GSC-IS specification link

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c| 4 src/card_7816.c | 2 ++ src/vcard_emul_nss.c | 1 + 3 files changed, 7 insertions(+) diff --git a/src/cac.c b/src/cac.c index 34ea03a..8adb7f3 100644 --- a/src/cac.c +++ b/src/cac.c @@ -1,6 +1,9

[Spice-devel] Implement GSC-IS 2.1 (CAC2)

2018-07-31 Thread Jakub Jelen
location of the CI once it will be set up, but for now, they point to my fork on gitlab, where the results can be observed: https://gitlab.com/jjelen/libcacard/ Regards, Jakub Jelen ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https

[Spice-devel] [PATCH libcacard 08/45] hex_dump: Helper function to allow inspection of internal buffers

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/common.c | 40 src/common.h | 2 ++ 2 files changed, 42 insertions(+) diff --git a/src/common.c b/src/common.c index 521ef51..2e06314 100644 --- a/src/common.c +++ b/src/common.c @@ -26,7

[Spice-devel] [PATCH libcacard 12/45] ACA Applet

2018-07-31 Thread Jakub Jelen
(from "5.3.3.5 Get ACR APDU" of GSC-IS 2.1) Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am|2 + docs/libcacard.txt |1 + src/cac-aca.c | 1106 src/cac-aca.h | 32 ++ src/cac.c

[Spice-devel] [PATCH libcacard 14/45] vcard_emul: New function vcard_emul_rsa_bits

2018-07-31 Thread Jakub Jelen
* Introduce a new API to get the key size from the key to present it in CAC properties structures later Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- docs/libcacard.txt | 4 src/libcacard.syms | 1 + src/vcard_emul.h | 1 + src/vcard_emul_nss.c | 22

[Spice-devel] [PATCH libcacard 16/45] tests: Verify we can parse properties of PKI object

2018-07-31 Thread Jakub Jelen
* Also verify the key size inside matches expectation * This involves parsing SimpleTLV structures Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 61 +++ 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a

[Spice-devel] [PATCH libcacard 23/45] cac: Generate dynamic ACA structures based on the certificates

2018-07-31 Thread Jakub Jelen
* So far, the ACA tables were static from existing card. * This change allows adjusting the ACA tables based on the real certificates and PKI applets present in virtual smart card Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac-aca.c | 244

[Spice-devel] [PATCH libcacard 05/45] tests: Cover the SimpleTLV with functional tests

2018-07-31 Thread Jakub Jelen
* The CAC is sometimes using nested SimpleTLV structures that might be ambiguous, which is covered too. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am| 13 ++- docs/libcacard.txt | 1 + tests/simpletlv.c | 207

[Spice-devel] [PATCH libcacard 06/45] simpletlv: Add a way to skip unused members

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/simpletlv.c | 11 - src/simpletlv.h | 5 ++-- tests/simpletlv.c | 60 +++ 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/src/simpletlv.c b/src/simpletlv.c

[Spice-devel] [PATCH libcacard 22/45] Add valgrind supressions for NSS and glib

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- build-aux/glib-tap.mk | 2 +- build-aux/glib.supp | 35 +++ build-aux/nss.supp| 81 +++ 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 build-aux

[Spice-devel] [PATCH libcacard 19/45] tests: Verify cardURLs are present in CCC

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 48 --- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/tests/libcacard.c b/tests/libcacard.c index 0e3d10b..5bbd080 100644 --- a/tests/libcacard.c +++ b

[Spice-devel] [PATCH libcacard 04/45] Basic SimpleTLV encoding and decoding methods

2018-07-31 Thread Jakub Jelen
dynamically allocated. The dynamic one need to be recursivelly freed. * Dynamic structures can be created by mergig other provided structures, which is common in ACA, where all the responses are prefixed with applet information. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea

[Spice-devel] [PATCH libcacard 09/45] Adjust PKI Applet to CAC 2

2018-07-31 Thread Jakub Jelen
* 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 Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src

[Spice-devel] [PATCH libcacard 11/45] Card Manager Applet

2018-07-31 Thread Jakub Jelen
generic ISO 7816 code, but the responses are improved. * This loads the GP applet separately from CAC applet Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am | 2 + docs/libcacard.txt| 1 + src/cac.c | 38 +++- src/card_7816.c

[Spice-devel] [PATCH libcacard 13/45] tests: Test previously introduced applets

2018-07-31 Thread Jakub Jelen
* Make sure the GET PROPERTIES APDU returns something on every applet * Make sure the GET ACR APDU returns something reasonable on ACA applet with valid and invalid parameters * Make sure the READ BUFFER APDU retunrs valid buffers Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea

[Spice-devel] [PATCH libcacard 02/45] Adjust authorship information

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- README.md | 4 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ec67f02..6edef77 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,8 @@ This project was originally developped by: - Alon Levy - Robert

[Spice-devel] [PATCH libcacard 03/45] Remove the old m4 macros

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- m4/ax_append_compile_flags.m4 | 65 - m4/ax_append_flag.m4| 71 -- m4/ax_append_link_flags.m4 | 63 - m4/ax_check_compile_flag.m4 | 74 --- m4/ax_check_enable_debug.m4 | 124

[Spice-devel] [PATCH libcacard 28/45] cac: Emulate also other empty applets; handling multiple COIDs

2018-07-31 Thread Jakub Jelen
CF (Access Control File) are one of the mandatory parts of CAC, but they are not exposed in PKCS#11 and impossible to emulate (signatures of the internal structures), but ActivClient does not really need them. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c

[Spice-devel] [PATCH libcacard 07/45] simpletlv: Allow clonning of the SimpleTLV structures with test

2018-07-31 Thread Jakub Jelen
* This function creates a deep copy of the whole structure. * The new structure is dynamically allocated and needs to be freed. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/simpletlv.c | 42 ++ src/simpletlv.h | 9 + tests

[Spice-devel] [PATCH libcacard 15/45] cac: Expose real key size in PKI Applet properties

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cac.c b/src/cac.c index 4b54e91..c7b5006 100644 --- a/src/cac.c +++ b/src/cac.c @@ -627,6 +627,7 @@ cac_new_pki_applet_private(int i, const unsigned

[Spice-devel] [PATCH libcacard 20/45] cac: Anotate other missing applets

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 315 ++ 1 file changed, 315 insertions(+) diff --git a/src/cac.c b/src/cac.c index c7b5006..947f622 100644 --- a/src/cac.c +++ b/src/cac.c @@ -770,6 +770,321 @@ failure

[Spice-devel] [PATCH libcacard 10/45] CCC Applet implementation

2018-07-31 Thread Jakub Jelen
* The Card Capability Container (CCC) is mandatory applet of CAC 2 and is used to discover other applets, card capabilities and properties Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 359 +- src/cac.h | 15

[Spice-devel] [PATCH libcacard 30/45] vcard_emul: New function vcard_emul_read_object()

2018-07-31 Thread Jakub Jelen
* This function is used to read generic data objects presented by the underlying card, if available. It can provide some structures that we are not able to emulate in softeare card. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- docs/libcacard.txt | 8 +++ src

[Spice-devel] [PATCH libcacard 17/45] tests: Direct responses in the test suite.

2018-07-31 Thread Jakub Jelen
Rewrite tests to read buffers directly without explicit GET RESPONSE APDU requests. Test GET RESPONSE APDU separately. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 171 -- 1 file changed, 106 insertions(+), 65

[Spice-devel] [PATCH libcacard 18/45] tests: Check more fields in properties buffers

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 60 +++ 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/tests/libcacard.c b/tests/libcacard.c index adbf0f8..0e3d10b 100644 --- a/tests/libcacard.c +++ b

[Spice-devel] [PATCH libcacard 25/45] tests: Test standard ISO operations: sign and login

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 99 +++ 1 file changed, 99 insertions(+) diff --git a/tests/libcacard.c b/tests/libcacard.c index 650e2e7..ea9cee6 100644 --- a/tests/libcacard.c +++ b/tests/libcacard.c

[Spice-devel] [PATCH libcacard 31/45] cac: Implement CAC passthrough applets

2018-07-31 Thread Jakub Jelen
* The PKI Credential, PKI Certificate and Person Instance applets are hard to emulate with bogus data and therefore we will make them available from the existing cards. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 260

[Spice-devel] [PATCH libcacard 24/45] cac: Generate CardURLs in CCC based on the cert list

2018-07-31 Thread Jakub Jelen
* This provides the real list of applets in the emulated card in the CCC applet CardURLs, which is mandatory for applet and certificated discovery. * This also increaseses the amount of possible certificates to 10 Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c

[Spice-devel] [PATCH libcacard 33/45] tests: Extend the hwtests with get_response

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 74 +++ tests/common.h| 2 ++ tests/hwtests.c | 23 +++ tests/libcacard.c | 46 - 4 files changed, 99 insertions(+), 46

[Spice-devel] [PATCH libcacard 26/45] tests: Verify Applet information is present in properties

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/libcacard.c b/tests/libcacard.c index ea9cee6..3abd1a9 100644 --- a/tests/libcacard.c +++ b/tests/libcacard.c @@ -163,6 +163,7 @@ static void get_properties

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

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- 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

[Spice-devel] [PATCH libcacard 32/45] tests: Create separate hardware tests

2018-07-31 Thread Jakub Jelen
applets * The NSS DB needs to be created under tests/hwdb/ and local pkcs#11 module needs to be added to the database Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am| 10 +- docs/libcacard.txt | 1 + tests/common.c | 504

[Spice-devel] [PATCH libcacard 27/45] tests: Parse the ACA responses to verify their sanity

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 83 ++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/tests/libcacard.c b/tests/libcacard.c index 3abd1a9..d5e18ad 100644 --- a/tests/libcacard.c +++ b/tests

[Spice-devel] [PATCH libcacard 41/45] tests: More ideas to test

2018-07-31 Thread Jakub Jelen
* The ATR code paths are not covered * The card resets code paths are not covered Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/libcacard.c b/tests/libcacard.c index 6f073cc..e13c8eb 100644 --- a/tests

[Spice-devel] [PATCH libcacard 29/45] simpletlv: Parse string to internal representation with tests

2018-07-31 Thread Jakub Jelen
* The function parses SimpleTLV string to internal structures, that can be handled with more ease in the code. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/simpletlv.c | 52 ++ src/simpletlv.h | 13 tests/simpletlv.c | 80

[Spice-devel] [PATCH libcacard 43/45] readme: Document dependencies for the library and the tests

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- README.md | 16 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 6edef77..c7053e3 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,22 @@ For more information and API documentation, read the

[Spice-devel] [PATCH libcacard 44/45] Set up the CI in gitlab including coverage reports

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- .gitlab-ci.yml | 53 ++ 1 file changed, 53 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000..7eb7a22

[Spice-devel] [PATCH libcacard 39/45] tests: Negative test cases to increase coverage

2018-07-31 Thread Jakub Jelen
queries * invalid GET ACR APDU queries * properly clean up the memory when the test is finished Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 108 ++- tests/common.h| 5 +- tests/hwtests.c | 44 - tests/libcacard.c | 468

[Spice-devel] [PATCH libcacard 35/45] cac-aca: Extend ACR table with fields for extended ACR

2018-07-31 Thread Jakub Jelen
* This is not documented in specification so this is an attempt to mimic real cards. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac-aca.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/cac-aca.c b/src/cac-aca.c index

[Spice-devel] [PATCH libcacard 45/45] README: Show badges for build and coverage status

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c7053e3..86dda38 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# libcacard ![alt text][travis] +# libcacard ![alt text

[Spice-devel] [PATCH libcacard 36/45] tests: Make sure we do not crash on bad data to sign

2018-07-31 Thread Jakub Jelen
* This includes also the key bits discovery in test suite. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c | 6 tests/common.h | 2 ++ tests/hwtests.c | 80 + 3 files changed, 88 insertions(+) diff --git a

[Spice-devel] [PATCH libcacard 37/45] tests: GP Card Manager and responses on SELECT APDU

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 19 --- tests/common.h| 2 ++ tests/libcacard.c | 34 ++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/tests/common.c b/tests/common.c index

[Spice-devel] [PATCH libcacard 34/45] tests: Select OID

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 43 +-- tests/common.h| 3 +++ tests/libcacard.c | 41 + 3 files changed, 85 insertions(+), 2 deletions(-) diff --git a/tests

[Spice-devel] [PATCH libcacard 40/45] tests: Consolidate the tests for hw and non-hw versions

2018-07-31 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 20 tests/hwtests.c | 44 +--- tests/libcacard.c | 3 +-- 3 files changed, 26 insertions(+), 41 deletions(-) diff --git a/tests/common.c b/tests

[Spice-devel] [PATCH libcacard 42/45] Add automated way of running tests with softhsm

2018-07-31 Thread Jakub Jelen
* This is useful for CI or manual running of the tests without a need of a physical CAC card. * The script goes through the whole setting of environment, soft token, generating testing keys, certificates and running the test suite. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea

[Spice-devel] [PATCH libcacard 38/45] cac, cac-aca: Implement other undocumented encoding for extended properties

2018-07-31 Thread Jakub Jelen
standard GET ACR parameters, but if P1 | 0x40 is set, the response should come in this new format. * This affects also GET PROPERTIES APDU, where we get also other bunch of TLVs in case of this bit is set. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac-aca.c | 293

Re: [Spice-devel] [PATCH libcacard 44/45] Set up the CI in gitlab including coverage reports

2018-08-01 Thread Jakub Jelen
On Tue, 2018-07-31 at 18:14 +0200, Marc-André Lureau wrote: > Hi > > On Tue, Jul 31, 2018 at 4:50 PM, Jakub Jelen > wrote: > > Signed-off-by: Jakub Jelen > > Reviewed-by: Robert Relyea > > --- > > .gitlab-ci.yml | 53 > >

Re: [Spice-devel] [PATCH libcacard 22/45] Add valgrind supressions for NSS and glib

2018-08-01 Thread Jakub Jelen
On Tue, 2018-07-31 at 19:46 +0200, Marc-André Lureau wrote: > Hi > > supression/suppression > > On Tue, Jul 31, 2018 at 4:50 PM, Jakub Jelen > wrote: > > Signed-off-by: Jakub Jelen > > Reviewed-by: Robert Relyea > > --- > > build-aux/glib-tap.

Re: [Spice-devel] [PATCH libcacard 05/45] tests: Cover the SimpleTLV with functional tests

2018-08-01 Thread Jakub Jelen
On Tue, 2018-07-31 at 20:07 +0200, Marc-André Lureau wrote: > Hi > > On Tue, Jul 31, 2018 at 4:49 PM, Jakub Jelen > wrote: > > [...] > > -test_programs = tests/libcacard > > -tests_libcacard_LDADD = libcacard.la $(GT

Re: [Spice-devel] [PATCH libcacard 04/45] Basic SimpleTLV encoding and decoding methods

2018-08-01 Thread Jakub Jelen
On Tue, 2018-07-31 at 20:29 +0200, Marc-André Lureau wrote: > Hi > > On Tue, Jul 31, 2018 at 4:49 PM, Jakub Jelen > wrote: > > * The source code is originally based on the OpenSC cac card > > driver > > > > * The SimpleTLV encoding is used in various plac

Re: [Spice-devel] [PATCH libcacard 08/45] hex_dump: Helper function to allow inspection of internal buffers

2018-08-01 Thread Jakub Jelen
On Tue, 2018-07-31 at 23:58 +0200, Marc-André Lureau wrote: > Hi > > On Tue, Jul 31, 2018 at 11:53 PM, Marc-André Lureau > wrote: > > Hi > > > > On Tue, Jul 31, 2018 at 4:50 PM, Jakub Jelen > > wrote: > > > Signed-off-by: Jakub Jelen > > >

Re: [Spice-devel] [PATCH libcacard 42/45] Add automated way of running tests with softhsm

2018-08-01 Thread Jakub Jelen
On Wed, 2018-08-01 at 00:19 +0200, Marc-André Lureau wrote: > Hi > > On Tue, Jul 31, 2018 at 4:50 PM, Jakub Jelen > wrote: > > * This is useful for CI or manual running of the tests without a > > need > >of a physical CAC card. > > * The script goes thro

Re: [Spice-devel] [PATCH libcacard 09/45] Adjust PKI Applet to CAC 2

2018-08-02 Thread Jakub Jelen
On Wed, 2018-08-01 at 00:16 +0200, Marc-André Lureau wrote: > Hi Jakub, > > On Tue, Jul 31, 2018 at 4:50 PM, Jakub Jelen > wrote: > > * This involves creation of properties structures in the applet, > >that are used to discover pki buffers in the applet a

[Spice-devel] [PATCH libcacard v2 04/35] CCC Applet implementation

2018-08-02 Thread Jakub Jelen
* The Card Capability Container (CCC) is mandatory applet of CAC 2 and is used to discover other applets, card capabilities and properties Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 361 +- src/cac.h | 15

[Spice-devel] [PATCH libcacard v2 08/35] tests: Check more fields in properties buffers

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 60 +++ 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/tests/libcacard.c b/tests/libcacard.c index 67ea089..01335c2 100644 --- a/tests/libcacard.c +++ b

[Spice-devel] [PATCH libcacard v2 01/35] tests: Properly terminate the event thread and clean up memory

2018-08-02 Thread Jakub Jelen
--- tests/libcacard.c | 26 +- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tests/libcacard.c b/tests/libcacard.c index a6ff49b..2b769be 100644 --- a/tests/libcacard.c +++ b/tests/libcacard.c @@ -17,7 +17,8 @@ events_thread(gpointer arg) while (1) {

[Spice-devel] [PATCH libcacard v2 09/35] tests: Verify cardURLs are present in CCC

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 48 --- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/tests/libcacard.c b/tests/libcacard.c index 01335c2..838e3c1 100644 --- a/tests/libcacard.c +++ b

[Spice-devel] [PATCH libcacard v2 02/35] vcard_emul: New function vcard_emul_rsa_bits

2018-08-02 Thread Jakub Jelen
* Introduce a new API to get the key size from the key to present it in CAC properties structures later Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- docs/libcacard.txt | 4 src/libcacard.syms | 1 + src/vcard_emul.h | 1 + src/vcard_emul_nss.c | 22

[Spice-devel] [PATCH libcacard v2 11/35] tests: Get properties with argument selecting only subset of tags

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 24 1 file changed, 24 insertions(+) diff --git a/tests/libcacard.c b/tests/libcacard.c index 838e3c1..5112838 100644 --- a/tests/libcacard.c +++ b/tests/libcacard.c @@ -159,6 +159,10

[Spice-devel] [PATCH libcacard v2 23/35] tests: Extend the hwtests with get_response

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 73 +++ tests/common.h| 2 ++ tests/hwtests.c | 23 +++ tests/libcacard.c | 46 - 4 files changed, 98 insertions(+), 46

[Spice-devel] [PATCH libcacard v2 03/35] Adjust PKI Applet to CAC 2

2018-08-02 Thread Jakub Jelen
vcard_emul_rsa_bits() to expose the real key size in properties buffer Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 474 -- src/cac.h | 30 ++- tests/libcacard.c | 26 +-- 3 files changed, 439 insertions(+), 91 deletions

[Spice-devel] [PATCH libcacard v2 05/35] Card Manager Applet

2018-08-02 Thread Jakub Jelen
generic ISO 7816 code, but the responses are improved. * This affects also the existing testsuite, which needs adjustments, since the SELECT APDU retunrs different data. * This loads the GP applet separately from CAC applet Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am

[Spice-devel] [PATCH libcacard v2 12/35] Add valgrind supressions for NSS and glib

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- build-aux/glib.supp | 35 +++ 1 file changed, 35 insertions(+) create mode 100644 build-aux/glib.supp diff --git a/build-aux/glib.supp b/build-aux/glib.supp new file mode 100644 index 000..ff2edbe

[Spice-devel] [PATCH libcacard v2 06/35] ACA Applet

2018-08-02 Thread Jakub Jelen
(from "5.3.3.5 Get ACR APDU" of GSC-IS 2.1) Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am|2 + docs/libcacard.txt |1 + src/cac-aca.c | 1106 src/cac-aca.h | 32 ++ src/cac.c

[Spice-devel] [PATCH libcacard v2 07/35] tests: Test previously introduced applets

2018-08-02 Thread Jakub Jelen
buffer matches the expected key size * Separate test for GET RESPONSE APDU Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am | 6 +- tests/libcacard.c | 426 -- 2 files changed, 418 insertions(+), 14 deletions(-) diff

[Spice-devel] [PATCH libcacard v2 13/35] cac: Generate dynamic ACA structures based on the certificates

2018-08-02 Thread Jakub Jelen
* So far, the ACA tables were static from existing card. * This change allows adjusting the ACA tables based on the real certificates and PKI applets present in virtual smart card Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac-aca.c | 244

[Spice-devel] [PATCH libcacard v2 17/35] tests: Parse the ACA responses to verify their sanity

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 83 ++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/tests/libcacard.c b/tests/libcacard.c index 97ba2ab..5323a2c 100644 --- a/tests/libcacard.c +++ b/tests

[Spice-devel] Implement GSC-IS 2.1 (CAC2) v2 with passing tests

2018-08-02 Thread Jakub Jelen
This is second version of unmerged changes from the patch set I sent earlier this week: https://lists.freedesktop.org/archives/spice-devel/2018-July/044955.html This makes use of some more clean up and reordering to make sure every commit makes the tests pass. Unfortunatelly, this is not case fro

[Spice-devel] [PATCH libcacard v2 15/35] tests: Test standard ISO operations: sign and login

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 99 +++ 1 file changed, 99 insertions(+) diff --git a/tests/libcacard.c b/tests/libcacard.c index 6768a03..67bd0be 100644 --- a/tests/libcacard.c +++ b/tests/libcacard.c

[Spice-devel] [PATCH libcacard v2 21/35] cac: Implement CAC passthrough applets

2018-08-02 Thread Jakub Jelen
* The PKI Credential, PKI Certificate and Person Instance applets are hard to emulate with bogus data and therefore we will make them available from the existing cards. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 259

[Spice-devel] [PATCH libcacard v2 26/35] tests: Make sure we do not crash on bad data to sign

2018-08-02 Thread Jakub Jelen
* This includes also the key bits discovery in test suite. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c | 6 tests/common.h | 2 ++ tests/hwtests.c | 80 + 3 files changed, 88 insertions(+) diff --git a

[Spice-devel] [PATCH libcacard v2 10/35] cac: Anotate other missing applets

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c | 315 ++ 1 file changed, 315 insertions(+) diff --git a/src/cac.c b/src/cac.c index 2f871e2..cc07923 100644 --- a/src/cac.c +++ b/src/cac.c @@ -774,6 +774,321 @@ failure

[Spice-devel] [PATCH libcacard v2 19/35] simpletlv: Parse string to internal representation with tests

2018-08-02 Thread Jakub Jelen
* The function parses SimpleTLV string to internal structures, that can be handled with more ease in the code. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/simpletlv.c | 52 ++ src/simpletlv.h | 13 tests/simpletlv.c | 80

[Spice-devel] [PATCH libcacard v2 25/35] cac-aca: Extend ACR table with fields for extended ACR

2018-08-02 Thread Jakub Jelen
* This is not documented in specification so this is an attempt to mimic real cards. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac-aca.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/cac-aca.c b/src/cac-aca.c index

[Spice-devel] [PATCH libcacard v2 20/35] vcard_emul: New function vcard_emul_read_object()

2018-08-02 Thread Jakub Jelen
* This function is used to read generic data objects presented by the underlying card, if available. It can provide some structures that we are not able to emulate in softeare card. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- docs/libcacard.txt | 8 +++ src

[Spice-devel] [PATCH libcacard v2 16/35] tests: Verify Applet information is present in properties

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/libcacard.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/libcacard.c b/tests/libcacard.c index 67bd0be..97ba2ab 100644 --- a/tests/libcacard.c +++ b/tests/libcacard.c @@ -165,6 +165,7 @@ static void get_properties

[Spice-devel] [PATCH libcacard v2 22/35] tests: Create separate hardware tests

2018-08-02 Thread Jakub Jelen
applets * The NSS DB needs to be created under tests/hwdb/ and local pkcs#11 module needs to be added to the database Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- Makefile.am| 15 ++ docs/libcacard.txt | 1 + tests/common.c | 525

[Spice-devel] [PATCH libcacard v2 24/35] tests: Select OID

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 43 +-- tests/common.h| 3 +++ tests/libcacard.c | 41 + 3 files changed, 85 insertions(+), 2 deletions(-) diff --git a/tests

[Spice-devel] [PATCH libcacard v2 18/35] cac: Emulate also other empty applets; handling multiple COIDs

2018-08-02 Thread Jakub Jelen
CF (Access Control File) are one of the mandatory parts of CAC, but they are not exposed in PKCS#11 and impossible to emulate (signatures of the internal structures), but ActivClient does not really need them. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c

[Spice-devel] [PATCH libcacard v2 14/35] cac: Generate CardURLs in CCC based on the cert list

2018-08-02 Thread Jakub Jelen
* This provides the real list of applets in the emulated card in the CCC applet CardURLs, which is mandatory for applet and certificated discovery. * This also increaseses the amount of possible certificates to 10 Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac.c

[Spice-devel] [PATCH libcacard v2 30/35] tests: Consolidate the tests for hw and non-hw versions

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 20 tests/hwtests.c | 44 +--- tests/libcacard.c | 3 +-- 3 files changed, 26 insertions(+), 41 deletions(-) diff --git a/tests/common.c b/tests

[Spice-devel] [PATCH libcacard v2 28/35] cac, cac-aca: Implement other undocumented encoding for extended properties

2018-08-02 Thread Jakub Jelen
standard GET ACR parameters, but if P1 | 0x40 is set, the response should come in this new format. * This affects also GET PROPERTIES APDU, where we get also other bunch of TLVs in case of this bit is set. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- src/cac-aca.c | 293

[Spice-devel] [PATCH libcacard v2 34/35] Set up the CI in gitlab including coverage reports

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- .gitlab-ci.yml | 53 ++ 1 file changed, 53 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000..7eb7a22

[Spice-devel] [PATCH libcacard v2 35/35] README: Show badges for build and coverage status

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c7053e3..86dda38 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# libcacard ![alt text][travis] +# libcacard ![alt text

[Spice-devel] [PATCH libcacard v2 29/35] tests: Negative test cases to increase coverage

2018-08-02 Thread Jakub Jelen
queries * invalid GET ACR APDU queries Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 105 ++- tests/common.h| 5 +- tests/hwtests.c | 20 ++- tests/libcacard.c | 442 +- 4 files changed, 565 insertions

[Spice-devel] [PATCH libcacard v2 27/35] tests: GP Card Manager and responses on SELECT APDU

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- tests/common.c| 20 +--- tests/common.h| 2 ++ tests/libcacard.c | 35 +++ 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/tests/common.c b/tests/common.c index

[Spice-devel] [PATCH libcacard v2 32/35] Add automated way of running tests with softhsm

2018-08-02 Thread Jakub Jelen
* This is useful for CI or manual running of the tests without a need of a physical CAC card. * The script goes through the whole setting of environment, soft token, generating testing keys, certificates and running the test suite. Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea

[Spice-devel] [PATCH libcacard v2 33/35] readme: Document dependencies for the library and the tests

2018-08-02 Thread Jakub Jelen
Signed-off-by: Jakub Jelen Reviewed-by: Robert Relyea --- README.md | 16 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 6edef77..c7053e3 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,22 @@ For more information and API documentation, read the

  1   2   >