Hello Nguyễn,

On Fri, May 4, 2012 at 12:04 PM, Nguyễn Hồng Quân <quanngu...@mbm.vn> wrote:

> The case in this log is that the card is not initialised. It contains
> no key. That is the reason why
> the blob read failed, the file length is zero, the read binary returned
> zero and final, a key with zero length modulus.
>
> I think what behavior for this case is conventional. When the card
> contains no key, should OpenSC:
> - return error
> - see it normal and notify: "No key"
> - see it normal and notify: Valid key with zero attributes (modulus
> length if pubkey).
>
>
It's not going about the key files
but about the openpgp specific select_file() method.

Without longly looking into specifications, let us postulate -- valid
'selectable' EF should have length more then zero.
With this rule, your select_file(EF) procedure should not return SUCCESS if
it cannot get valid FCP and file length.

By the way,
what are the 'type' and 'ef_structure' of the sc_file data returned by this
'select' ?

To resume,
as for me it should be case 'return error'.



> I'm new to OpenSC and I have no other card (but my CryptoStick) to
> test, I don't know what behavior the team agreed for this case. Can you
> let me know?
>
> Observing the situation when the private key does not exist, it seems
> that the 3rd behavior is being adopted:
>
>    $ pkcs11-tool --module=/usr/lib/opensc-pkcs11.so -O -l
>    Using slot 1 with a present token (0x1)
>    Logging in to "OpenPGP Card (Signature PIN)".
>    Please enter User PIN:
>    Private Key Object; RSA
>      label:      Signature key
>      ID:         01
>      Usage:      sign
>    Segmentation fault
>
>
> On Thu 03 May 2012 07:32:38 PM ICT, Viktor Tarasov wrote:
> >
> >
> > On Thu, May 3, 2012 at 12:38 PM, Nguyễn Hồng Quân <quanngu...@mbm.vn
> > <mailto:quanngu...@mbm.vn>> wrote:
> >
> >     Hi,
> >     I would like to resend the gzipped log file:
> >
> >
> > Effectively,
> > there is an insufficient control of the pkcs15/11 object validity in
> > the common part.
> >
> > In more details I will look during the weekend,
> > but, I guess that you have to review the openpgp card driver
> > (card-openpgp.c) .
> >
> > According to logs,
> > it tries to read the file blob inside the pgp_select(),
> > fails, but nevertheless the pgp_select returns SUCCESS .
> > Is it wanted behavior?
> >
> > The returned selected file has zero length,
> > binary read of zero bytes returns SUCCESS (with zero length it do not
> > even try to access the card).
> > and finally there is a valid public key object with zero length modulus.
> >
> >
> >
> >
> >     On Thu 03 May 2012 05:35:53 PM ICT, Nguyễn Hồng Quân wrote:
> >     > Hi,
> >     > Here is the log (debug level 8)
> >     >
> >     >
> >     > On Thu 03 May 2012 03:36:07 PM ICT, Nguyễn Hồng Quân wrote:
> >     >> Hello every one,
> >     >>
> >     >> I've just committed a patch to fix a crash of opensc-pkcs11 when I
> >     >> tested with CryptoStick.
> >     >> Please review: https://github.com/OpenSC/OpenSC/pull/31
> >     >>
> >     >
> >     > --
> >     > Regards,
> >     > Quân
> >
> >     --
> >     Regards,
> >     Quân
> >
> >     _______________________________________________
> >     opensc-devel mailing list
> >     opensc-devel@lists.opensc-project.org
> >     <mailto:opensc-devel@lists.opensc-project.org>
> >     http://www.opensc-project.org/mailman/listinfo/opensc-devel
> >
> >
>
> --
> Regards,
> Quân
>
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to