Re: [opensc-devel] reading public key from card

2007-10-13 Thread Gürer Özen
On Tuesday 02 October 2007 19:20:22 Gürer Özen wrote: > I've added a new generic cardctl call, SC_CARDCTL_READ_PUBLIC_KEY. When the > length of the path is zero, sc_pkcs15_read_pubkey() calls this with > key_reference value. So cards can provide alternative methods to read >

Re: [opensc-devel] PKCS#15 / ISO7816-15 Question

2007-10-11 Thread Gürer Özen
On Thursday 11 October 2007 18:54:37 Franz Brandl wrote: > the card contains a EF(DIR) in the MF which points to a couple of > applications. So these applications are supposed to be PKCS#15 > applications, otherwise they should not appear in EF(DIR), i guess. Nope, EF(DIR) is defined in ISO 7816

Re: [opensc-devel] PKCS#15 / ISO7816-15 Question

2007-10-11 Thread Gürer Özen
On Thursday 11 October 2007 15:46:03 Franz Brandl wrote: > The card does have a EF(DIR) in the MF, which perfectly contains the aid's > of the card applications. > > Problem ist - all the application DF's do not contain EF(ODF) files. In my > understanding, the EF(ODF) should be mandatory. At leas

Re: [opensc-devel] reading public key from card

2007-10-06 Thread Gürer Özen
On Tuesday 02 October 2007 23:13:00 Gürer Özen wrote: > On Tuesday 02 October 2007 23:01:21 Ludovic Rousseau wrote: > > My question was in fact why use sc_card_ctl() instead of > > sc_pkcs15_read_key_by_ref() > > I don't know if a generic sc_pkcs15_read_key_by_ref() is po

Re: [opensc-devel] reading public key from card

2007-10-03 Thread Gürer Özen
On Tuesday 02 October 2007 22:58:35 Ludovic Rousseau wrote: > 2007/10/2, Ludovic Rousseau <[EMAIL PROTECTED]>: > > Why use a complete struct sc_cardctl_public_key when only the > > pkey.key_ref is used? > > I now see why. I am not sure it is a good idea to have the same > parameter for in and out a

Re: [opensc-devel] reading public key from card

2007-10-02 Thread Gürer Özen
On Tuesday 02 October 2007 23:01:21 Ludovic Rousseau wrote: > My question was in fact why use sc_card_ctl() instead of > sc_pkcs15_read_key_by_ref() > I don't know if a generic sc_pkcs15_read_key_by_ref() is possible or > if each card driver must implement its own version. Ah I see now. APDU comm

Re: [opensc-devel] reading public key from card

2007-10-02 Thread Gürer Özen
On Tuesday 02 October 2007 22:34:09 Ludovic Rousseau wrote: > Why not call the function sc_pkcs15_read_key_by_ref() or something similar? Because upper level stuff (pkcs11 layer for example) calls the sc_pkcs15_read_pubkey, and change needs to be done in only one place this way. > Why use a co

[opensc-devel] reading public key from card

2007-10-02 Thread Gürer Özen
Hi, pam_p11 module first makes the card sign some random data, then extracts the public key, and signs it itself, then compares the signatures. Public key is read by the sc_pkcs15_read_pubkey() function in the pkcs15-pubkey.c file. This function blindly tries to read public key via calling sc

Re: [opensc-devel] opensc-explorer

2007-09-27 Thread Gürer Özen
On Thursday 27 September 2007 16:35:05 Andreas Jellinghaus wrote: > please attach a diff for review next time :) but I guess it is ok, > so please commit. Ops, sorry for that :) Committed. ___ opensc-devel mailing list opensc-devel@lists.opensc-project.

[opensc-devel] opensc-explorer

2007-09-27 Thread Gürer Özen
I've added two simple commands to the opensc-explorer tool. One is asn1 [file_id] which decodes and dumps an asn.1 DF, the other is apdu [apdu_sequence] which sends custom apdu commands inside the opensc-explorer session. They are very useful for debugging and examining. If no one objects, I'l

[opensc-devel] cardman 5321 patch

2007-09-22 Thread Gürer Özen
Cardman 5321 is a dual interface card. Contact interface works well with openct ccid driver. Attached patch adds its ID to the openct.conf. Index: etc/openct.conf.in === --- etc/openct.conf.in (revision 1006) +++ etc/openct.conf.in (

[opensc-devel] another typo patch

2007-09-03 Thread Gürer Özen
That isn't the read function. Index: src/libopensc/card.c === --- src/libopensc/card.c (revision 3263) +++ src/libopensc/card.c (working copy) @@ -454,7 +454,7 @@ r = sc_write_binary(card, idx, p, n, flags); if (r < 0) {

Re: [opensc-devel] pkcs11 problem

2007-09-01 Thread Gürer Özen
On Saturday 01 September 2007 18:19:58 you wrote: > Strange! > I don't have this error. > Are you sure the slot id is correct? > Try pkcs11-tool --list-slots I get that: Slot 0 (GetSlotInfo failed, error 257) It seems, GetSlotInfo tries to read PrKDF/PuKDF without doing CHV too. __

[opensc-devel] pkcs11 problem

2007-09-01 Thread Gürer Özen
In our AKIS PKCS-15 setup, PrKDF and PuKDF files need CHV for read access. That is conformant to the RSA EID Conformance Profile Spec file on their site. Other DFs are read accessible without a PIN. Now, with OpenSC API, I can do the following (in pseudo code): sc_connect_card(reader, slot, &c

[opensc-devel] akis patch

2007-08-28 Thread Gürer Özen
This patch implements sc_logout() in AKIS card driver, and fixes two typos in other files. Index: src/pkcs11/framework-pkcs15.c === --- src/pkcs11/framework-pkcs15.c (revision 3258) +++ src/pkcs11/framework-pkcs15.c (working copy) @@

[opensc-devel] patch

2007-08-22 Thread Gürer Özen
A little patch is attached. This one adds two lines to card-akis.c (mark supported padding and a comment), and fixes some typos in two other files. Please apply before the release. Index: src/libopensc/card-akis.c === --- src/libope

Re: [opensc-devel] [opensc-user] pkcs15 application DF different from 5015

2007-07-31 Thread Gürer Özen
On Tuesday 31 July 2007 10:17:23 Andreas Jellinghaus wrote: > > What do you mean by ddo file? > this is a special file, I think the fid is "2f00" where you can set the > application directory. our code in dir.c and pkcs15.c seems to handle it. 2F00 is EF(DIR) file (in the PKCS-15 standard) where

[opensc-devel] latest card-akis.c

2007-07-21 Thread Gürer Özen
ChangeLog: * akis_get_data() implemented * akis_delete_file() implemented * akis_set_security_env() implemented, pkcs15 signing works now * life cycle set/get via cardctl implemented * card_ops commented, so it is clear whether a function is supported via iso7816 implementation or not * mark pin

Re: [opensc-devel] strange behaviour with asn1.c

2007-07-20 Thread Gürer Özen
On Friday 20 July 2007 12:52:40 Gürer Özen wrote: > On Thursday 19 July 2007 01:10:33 Gürer Özen wrote: > > asn1_decode_entry() allocates (objlen - 1) bytes for SC_ASN1_UTF8STRING > > types with SC_ASN1_ALLOC flag, then calls the sc_asn1_decode_utf8string() > > function

Re: [opensc-devel] strange behaviour with asn1.c

2007-07-20 Thread Gürer Özen
On Thursday 19 July 2007 01:10:33 Gürer Özen wrote: > asn1_decode_entry() allocates (objlen - 1) bytes for SC_ASN1_UTF8STRING > types with SC_ASN1_ALLOC flag, then calls the sc_asn1_decode_utf8string() > function which then fails with BUFFER TOO SMALL cause it wants to end the > st

[opensc-devel] card-akis.c

2007-07-19 Thread Gürer Özen
new version: * create_file implemented * EF(DIR) hack removed, it is easier to put a real EF(DIR) * SC_CARDCTL_GET_SERIALNR implemented /* * card-akis.c: Support for AKIS smart cards * * Copyright (C) 2007 TUBITAK / UEKAE * contact: [EMAIL PROTECTED] * This library is free software; you can r

[opensc-devel] strange behaviour with asn1.c

2007-07-18 Thread Gürer Özen
asn1_decode_entry() allocates (objlen - 1) bytes for SC_ASN1_UTF8STRING types with SC_ASN1_ALLOC flag, then calls the sc_asn1_decode_utf8string() function which then fails with BUFFER TOO SMALL cause it wants to end the string with an extra NULL. I guess, allocation size was supposed to be obj

Re: [opensc-devel] AKIS card support

2007-07-18 Thread Gürer Özen
On Wednesday 18 July 2007 11:11:03 Andreas Jellinghaus wrote: > ok, thanks. any idea when the cards will be on sale? is the documentation > public? Card is sold to the public by http://www.plastkart.com You can contact them for orders. ___ opensc-devel

Re: [opensc-devel] AKIS card support

2007-07-17 Thread Gürer Özen
On Tuesday 17 July 2007 23:15:26 Andreas Jellinghaus wrote: > will it be used in national ID cards only, or will also be cards available > for sale (e.g. for companies to be used in authentication etc.)? National ID is just one of the applications, just like qualified electronic certificates [1]

[opensc-devel] AKIS card support

2007-07-17 Thread Gürer Özen
Included patches add diff -ur src/libopensc/cards.h opensc-0.11.3/src/libopensc/cards.h --- src/libopensc/cards.h 2007-07-04 11:22:55.0 +0300 +++ src/libopensc/cards.h 2007-07-17 14:04:21.0 +0300 @@ -130,7 +130,11 @@ /* Athena APCOS cards */ SC_CARD_TYPE_ASEPCOS_BASE = 17000,

[opensc-devel] AKIS card support

2007-07-17 Thread Gürer Özen
Included patches add support for AKIS cards to the opensc. With these patches, it is possible to explore the card, enter a PIN, and access PKCS-15 objects inside. More support for other opensc features will be added later. AKIS is a new smart card operation system developed by UEKAE [1] (Nation