[Spice-devel] libcacard 2.8.1 release

2021-08-16 Thread Jakub Jelen
Regards, -- Jakub Jelen Crypto Team, Security Engineering Red Hat, Inc.

[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] [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

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

2018-08-22 Thread Jakub Jelen
On Wed, 2018-08-22 at 17:53 +0200, Christophe Fergeau wrote: > Hey, > > On Tue, Aug 21, 2018 at 06:52:28PM +0200, Jakub Jelen wrote: > > [...] > > > > I tried to improve this part a bit with comments and local > > variable, > > but if the above help

Re: [Spice-devel] [cacard 1/5] hex_dump: Remove unused arguments

2018-08-22 Thread Jakub Jelen
On Wed, 2018-08-22 at 11:47 +0200, Christophe Fergeau wrote: > On Wed, Aug 22, 2018 at 11:46:59AM +0200, Christophe Fergeau wrote: > > Hey, > > > > On Tue, Aug 21, 2018 at 05:30:50PM +0200, Jakub Jelen wrote: > > > On Tue, 2018-08-21 at 17:03 +0200, Christophe F

Re: [Spice-devel] [cacard 1/5] gp: Remove unused arguments

2018-08-22 Thread Jakub Jelen
rv = gp_card_init(vreader, vcard, params, > - cert, cert_len, key, cert_count); > - return rv; > +rv = gp_card_init(vreader, vcard); > +return rv; > /* add new ones here */ > case VCARD_EMUL_PASSTHRU: > default:

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

2018-08-21 Thread Jakub Jelen
On Tue, 2018-08-21 at 17:35 +0200, Christophe Fergeau wrote: > Hey, > > On Thu, Aug 02, 2018 at 11:43:58AM +0200, Jakub Jelen wrote: > > diff --git a/tests/hwtests.c b/tests/hwtests.c > > index 7beebac..bd8e439 100644 > > --- a/tests/hwtests.c > > +++ b/test

Re: [Spice-devel] [cacard 1/5] hex_dump: Remove unused arguments

2018-08-21 Thread Jakub Jelen
On Tue, 2018-08-21 at 17:03 +0200, Christophe Fergeau wrote: > hex_dump() callers can theoretically provide the destination buffer > for the hexdump'ed string, but nothing in libcacard uses that > feature. > This commit removes it. The initial idea was to create some g_debug_hex function that coul

Re: [Spice-devel] [PATCH] Use proper free function for PK11_ReadRawAttribute call

2018-08-14 Thread Jakub Jelen
found = 1; > > - free(result.data); > +PORT_Free(result.data); > result.data = NULL; > > if (found) { Otherwise, it looks good. Thanks, -- Jakub Jelen Software Engineer Security Technologies Red Hat, Inc. ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel

Re: [Spice-devel] [cacard] simpletlv: Slight improvement to API documentation

2018-08-14 Thread Jakub Jelen
am out Byte array to write into > * @param outlenThe length of output array > * @param ptr The end of TLV record > + * @return The length of the encoded data, -1 on errors > */ > int > simpletlv_e

Re: [Spice-devel] [cacard 2/2] tests: Fix 'simpletlv' on i686 arches

2018-08-14 Thread Jakub Jelen
t; result_len = simpletlv_encode_val(nested, 1, &result, 0, > > NULL); > > -g_assert_cmpint(result_len, ==, -1); > > +g_assert_cmpint((int)result_len, ==, -1); > > } > > > > static void test_encode_skipped(void) > > -- > > 2.17.1

Re: [Spice-devel] [cacard] simpletlv: Use GArray to make simpletlv_parse simpler

2018-08-13 Thread Jakub Jelen
On Mon, 2018-08-13 at 11:08 +0200, Christophe Fergeau wrote: > This allows to get rid of manual reallocations. Thank you. This looks more elegant way. Assuming it still works and passes the CI, it looks good to me. Acked-by: Jakub Jelen > Signed-off-by: Christophe Fergeau > -

Re: [Spice-devel] [cacard 1/7] Fix 'Reqested' typo

2018-08-13 Thread Jakub Jelen
Thank you for reviewing the changes, fixing typos and cleaning things. All your changes from this patch set look good to me. Acked-by: Jakub Jelen On Fri, 2018-08-10 at 10:04 +0200, Christophe Fergeau wrote: > Signed-off-by: Christophe Fergeau > --- > src/cac.c | 4 ++-- > 1 fil

Re: [Spice-devel] [PATCH libcacard 2/2] vreader: Handle read failure

2018-08-09 Thread Jakub Jelen
On Wed, 2018-08-08 at 14:08 -0400, Jason Andryuk wrote: > On Wed, Aug 8, 2018 at 11:33 AM Jakub Jelen > wrote: > > > > On Wed, 2018-08-08 at 16:51 +0200, Marc-André Lureau wrote: > > > Hi > > > > > > On Tue, Jul 24, 2018 at 8:34 PM, Jason An

Re: [Spice-devel] [PATCH libcacard 2/2] vreader: Handle read failure

2018-08-08 Thread Jakub Jelen
alue here. From what I see, all the paths here return either VCARD_DONE. Can you advice during which operation did you encounter this error? Regards, -- Jakub Jelen Software Engineer Security Technologies Red Hat, Inc. ___ Spice-devel mailing list

Re: [Spice-devel] [PATCH libcacard 0/3] Prepare for v2.6.0 release

2018-08-08 Thread Jakub Jelen
o not install vscclient > tests: fix size_t printf format error > NEWS: prepare for v2.6.0 release > > Makefile.am | 2 +- > NEWS | 13 + > tests/common.c| 6 +++--- > tests/libcacard.c | 2 +- > 4 files changed, 18 insertions(+), 5 de

Re: [Spice-devel] [PATCH libcacard] options: add use_hw=removable

2018-08-06 Thread Jakub Jelen
On Mon, 2018-08-06 at 13:08 +0200, Marc-André Lureau wrote: > Hi > > On Mon, Aug 6, 2018 at 12:53 PM, Jakub Jelen > wrote: > > On Fri, 2018-08-03 at 12:40 +0200, marcandre.lur...@redhat.com > > wrote: > > > From: Marc-André Lureau > > > > > >

Re: [Spice-devel] [PATCH libcacard] options: add use_hw=removable

2018-08-06 Thread Jakub Jelen
; > +args = strip(args+9); Is this strip really needed? After the else, we are skipping any non- blank characters so this is practically noop. > } else { > -opts->use_hw = PR_TRUE; > +opts->use_hw = USE_HW_YES; > } > args = find_blank(args); > /* hw_type= */ Otherwise it looks fine. Thanks, -- Jakub Jelen Software Engineer Security Technologies Red Hat, Inc. ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel

Re: [Spice-devel] [PATCH libcacard] options: add use_hw=removable

2018-08-06 Thread Jakub Jelen
sts against a real card so I would like to see a new target check-local or hwcheck to skip the softhsm part and use some local NSS DB with real PKCS#11 module, but that can come in separate commit later. Regards, -- Jakub Jelen Software Engineer Security Technologies Red Hat, Inc. ___

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

2018-08-06 Thread Jakub Jelen
On Thu, 2018-08-02 at 16:39 +0200, Marc-André Lureau wrote: > Hi > > On Thu, Aug 2, 2018 at 11:43 AM, Jakub Jelen > wrote: > > This is second version of unmerged changes from the patch set I > > sent > > earlier this week: > > > > https://lists.free

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

2018-08-06 Thread Jakub Jelen
Hello, On Thu, 2018-08-02 at 15:39 +0200, Marc-André Lureau wrote: > Hi > > On Thu, Aug 2, 2018 at 11:43 AM, Jakub Jelen > wrote: > > * This function is used to read generic data objects presented by > >the underlying card, if available. It can provide some >

[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

[Spice-devel] [PATCH libcacard v2 31/35] tests: More ideas to test

2018-08-02 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 6bb3be7..18b84e5 100644 --- a/tests

[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 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 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] 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 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 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] [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 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 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 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

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

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 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 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 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 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 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 > >

[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 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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

  1   2   >