evalues evalues | 8 Feb 18:04
Picon

Re: PKCS15 Deauthenticate Function

Hello,

thanks for your answer. I'm working with Athena smartcard and I have seen that in the file card-asepcos.c, the function of logout is not implemented. I have seen in the file card-starcos.c that it have this function, and I have seen that the function is to send a certain APDU to the smartcard. I want know if it is possible to do the logout function for athena smartcard and the APDU that I should use.

Thank you.

On Sun, Jan 29, 2012 at 8:08 PM, Viktor Tarasov <viktor.tarasov <at> gmail.com> wrote:
Hello,

Le 25/01/2012 11:45, evalues evalues a écrit :
> Hello,
>
> I need know if at Opensc (opensc.dll version 0.12.1.0) there is a pkcs15-function that allows me to deauthenticate on a smart card. For example, I was looking the source code of this opensc version, and I found that in the file minidriver.c there is a
> function (CardAuthenticatePin) that uses the function sc_pkcs15_verify_pin for check if the PIN is correct, and if so authenticate the user on the smartcard. Besides, I was looking the function CaredDeauthenticate, but I did not find a pkcs15-funtion for
> deauthenticate, does it exist? If it exist, what is?

Not all the cards natively support the 'deauthenticate' function.
There is no such function in the OpenSC pkcs15 API.
In libopensc API there is the sc_logout() one, that calls the card specific 'logout' handler, if this last one is implemented.

>
> Also, I want know if there is an API of pkcs15-function.
> Thank you.

Kind regards,
Viktor.

Picon

OpenSC write access to main trunk, discussion

Dear all,

I just got in contact with Stef Walter, who is integrating libp11-glue
into Gnome and Gnome keyring. 

He outlines that libp11-glue needs this patch:
PKCS#11 module shouldn't fail if mlock doesn't work
http://www.opensc-project.org/opensc/ticket/389

This patch and other waiting patches raise the question of OpenSC
guidance and the need to have more commiters to OpenSC main GIT. 

Martin, would you agree to add Viktor as a major OpenSC GIT member with
power to apply patches to main GIT trunk? I don't want to be paranoid,
but we need a more flexible approach rather than just Martin and Ludovic
applying and reviewing patches.

We discussed that at FOSDEM in a small audience, but I would like to
discuss that issue in public and have your own opinion. Who would like
OpenSC GITHUB to be REALLY in control of the community? Martin and
Ludovic, could you agree to open your group to other members of the
community?

Community, please advice and discuss this issue.

Kind regards,
Jean-Michel

--

-- 
                  Jean-Michel Pouré - Gooze - http://www.gooze.eu
Attachment (smime.p7s): application/x-pkcs7-signature, 6022 bytes
Douglas E. Engert | 16 Feb 22:53
Favicon

Re: OpenSC write access to main trunk, discussion


On 2/15/2012 5:39 AM, Jean-Michel Pouré - GOOZE wrote:
> Dear all,
>
> I just got in contact with Stef Walter, who is integrating libp11-glue
> into Gnome and Gnome keyring.
>
> He outlines that libp11-glue needs this patch:
> PKCS#11 module shouldn't fail if mlock doesn't work
> http://www.opensc-project.org/opensc/ticket/389
>
> This patch and other waiting patches raise the question of OpenSC
> guidance and the need to have more commiters to OpenSC main GIT.
>
> Martin, would you agree to add Viktor as a major OpenSC GIT member with
> power to apply patches to main GIT trunk? I don't want to be paranoid,
> but we need a more flexible approach rather than just Martin and Ludovic
> applying and reviewing patches.
>
> We discussed that at FOSDEM in a small audience, but I would like to
> discuss that issue in public and have your own opinion. Who would like
> OpenSC GITHUB to be REALLY in control of the community? Martin and
> Ludovic, could you agree to open your group to other members of the
> community?

The question is not so much who is on the commiter list, but do commits
get made when needed, and who decides a commit is ready and should be made.

There are minor fixes, like 389 that is 4 months old with an additional
fix 2 months ago, and looks like it needs to be made, as well as major
changes such as the SM, ePass2003, and the ECDH modifications.

Personally, I am quite interested in getting the ECDH in to the next
release with or without the SM code and am willing to rebase the
modifications as needed.  I believe the ECDH has been ready for months.

Viktor pulled the ECDH modifications into his SM on October 4, 2011 and
he also pulled in the ePass2003 on January 29.

The way forward is not necessarily more commiters, but a plan
for the next release and some action.

So can we consider adding ePass2003, SM, and ECDH to the next release
as these are already being tested together.

If giving Viktor commit authority would speed up the inclusion of both small
and larger modifications, it would be OK with me. If we can get these
included without giving him commit authority, that would be OK
with me too. But we need action.

>
> Community, please advice and discuss this issue.
>
> Kind regards,
> Jean-Michel
>
>
>
>
> _______________________________________________
> opensc-devel mailing list
> opensc-devel <at> lists.opensc-project.org
> http://www.opensc-project.org/mailman/listinfo/opensc-devel

--

-- 

  Douglas E. Engert  <DEEngert <at> anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444
Alon Bar-Lev | 16 Feb 23:04
Picon
Gravatar

Re: OpenSC write access to main trunk, discussion

Hello,

On Thu, Feb 16, 2012 at 11:53 PM, Douglas E. Engert <deengert <at> anl.gov> wrote:
> The way forward is not necessarily more commiters, but a plan
> for the next release and some action.

Well, once there was maintainer for each subject, so if maintainer of
(in this case) ePass2003 decides to put a specific implementation it
should be OK.

If another one is working on SM and it effects only specific drivers, why not?

For example, I don't think I need to beg to include the removal of the
libltdl dependency should be trivial even if I got this only 99%.

This project loses its flexibility, this is not an advantage.

You can decide which feature goes to which milestone, and cooperate
with people within different branches.

Alon.
Peter Stuge | 17 Feb 02:07
Picon

Re: OpenSC write access to main trunk, discussion

Alon Bar-Lev wrote:
> This project loses its flexibility, this is not an advantage.

I disagree. I find that Git allows all the flexibility developers
could ask for.

The cry for more committers is misguided. With Git, anyone and
everyone is a committer. If commits exist but are not being included
in the main repository then it is most likely because they need more
work. The effort required to include a perfect patch is next to zero.

The question is if a project will insist on perfect patches (e.g.
Linux) or if anyone should be allowed to commit anything to the main
repo. Inkscape apparently did the latter, and it resulted in a
massive janitorial workload to clean up the horrible mess that had
been created. No fun.

Consider also that addition of commits without review will quite
likely introduce bugs which would have been discovered by peers. I
think this fact alone is reason enough for OpenSC to not include a
single line which hasn't been reviewed rather thoroughly. The review
process could even be formalized and made into a strict requirement
before writes to the main repo are possible.

I understand that Gooze and others have strong interest in inclusion
of changes into OpenSC. The only way to make that happen is what
Douglas described; put in the work, and create perfect patches.

Write access to some repository is not the issue. The whole world
already has Git write access. If someone needs help with publishing a
repository then feel free to let me know.

If you have prepared a patch which you think is perfect but noone is
responding then give it a thorough review yourself, and try again.
Also try discussing the change, explaining it in an email can be a
great way to produce a better commit message, which is very important
for anyone who is doing review.

Note that review does not mean to browse through the change and say
"looks ok", but it means to understand the effects of every changed
line. This can require a lot of context and/or research.

You can help by that commit be included by doing review. You doing
review is infinitely more important than you having write access to
some repository.

//Peter
Picon

Re: OpenSC write access to main trunk, discussion

Le vendredi 17 février 2012 à 02:07 +0100, Peter Stuge a écrit :
> The cry for more committers is misguided. With Git, anyone and
> everyone is a committer. If commits exist but are not being included
> in the main repository then it is most likely because they need more
> work. The effort required to include a perfect patch is next to zero. 

The question here is flexibility:

* OpenSC used to have a very flexible approach. OpenSC is NOT kernel.org
with thousands of developers and no need for hierarchy.

* Setting-up a compilation farm is no reason for closing write access to
historical developers of OpenSC.

* Discussions are the base of Free Software. Once discussions have
occurred, there should be several people with write access. You have to
trust people. No need to lock write access to the main GIT.

From my point of view, OpenSC is becoming a semi-private project with
two people in charge: Ludovic and Martin. Personally, I don't want
OpenSC to be organized the same way as libccid. 

We demand more freedom and transparency or this can only lead to endless
flamewars.

Keep in mind that before doing business, I have been a politician
fighting during 4 years for more freedom. Now I am retired, but if need
be, we will create a charity for OpenSC and organize a duly elected
board. I am not talking about a fork, which will never happen, but about
elections. 

Kind regards,
--

-- 
                  Jean-Michel Pouré - Gooze - http://www.gooze.eu
Attachment (smime.p7s): application/x-pkcs7-signature, 6022 bytes
Viktor Tarasov | 17 Feb 10:37
Picon

Re: PKCS15 Deauthenticate Function



On Wed, Feb 8, 2012 at 6:04 PM, evalues evalues <evalues.es <at> gmail.com> wrote:
Hello,

thanks for your answer. I'm working with Athena smartcard and I have seen that in the file card-asepcos.c, the function of logout is not implemented. I have seen in the file card-starcos.c that it have this function, and I have seen that the function is to send a certain APDU to the smartcard. I want know if it is possible to do the logout function for athena smartcard and the APDU that I should use.


Athena card has a proprietary APDU to reset the PIN's 'verified' flag:
> Asepcos cards have a Clear Security Status command - it is encoded as following:
> 80 28 01 00 Lc <data>
> Where <data> is 4 bytes: 00, <level>, <MSByte of pin's FID>, <LSByte of pin's FID>
> <level> is the directory depth of the pin's location - e.g., 0 for a pin in the MF, 1 for a pin in a DF under the MF, etc.
> For example, to clear the status of the pin with FID=1 under the MF, use the following apdu:
> 80 28 01 00 04 00 00 00 01


Thank you.

Kind regards,
Viktor.


 
On Sun, Jan 29, 2012 at 8:08 PM, Viktor Tarasov <viktor.tarasov <at> gmail.com> wrote:
Hello,

Le 25/01/2012 11:45, evalues evalues a écrit :
> Hello,
>
> I need know if at Opensc (opensc.dll version 0.12.1.0) there is a pkcs15-function that allows me to deauthenticate on a smart card. For example, I was looking the source code of this opensc version, and I found that in the file minidriver.c there is a
> function (CardAuthenticatePin) that uses the function sc_pkcs15_verify_pin for check if the PIN is correct, and if so authenticate the user on the smartcard. Besides, I was looking the function CaredDeauthenticate, but I did not find a pkcs15-funtion for
> deauthenticate, does it exist? If it exist, what is?

Not all the cards natively support the 'deauthenticate' function.
There is no such function in the OpenSC pkcs15 API.
In libopensc API there is the sc_logout() one, that calls the card specific 'logout' handler, if this last one is implemented.

>
> Also, I want know if there is an API of pkcs15-function.
> Thank you.

Kind regards,
Viktor.


Peter Stuge | 17 Feb 17:52
Picon

Re: OpenSC write access to main trunk, discussion

Jean-Michel Pouré - GOOZE wrote:
> > With Git, anyone and everyone is a committer.
> 
> The question here is flexibility:

What flexibility is needed? My point is that everyone can easily
create perfect patches, and given perfect patches which have been
peer reviewed there is no need for flexibility as in lots of people
with write access to the main repository. Even just one person can
easily handle that effort, like Linus shows in the much larger
kernel project.

> * OpenSC used to have a very flexible approach. OpenSC is NOT
> kernel.org with thousands of developers and no need for hierarchy.

OpenSC is smaller, but I do not agree that there is no need for any
kind of hierarchy. Now, please understand that this is not about
power hierarchy as in politics, but it is about technical experience
with the code and with the problem domain.

I am personally familiar with the smart card domain but I haven't
spent much time with the OpenSC codebase and therefore I absolutely
do not want some patch I create to be included without being reviewed
first.

The review is criticial. Especially in a codebase like OpenSC, to
which I might indeed delegate my legal authority, I want the review
to be merciless.

Don't make the mistake of believing that only people with write
access can do review. It is quite the opposite. I have been trying
to make this point many times before, but it seems difficult for many
to grasp that all peer review is helpful and important for the
codebase, regardless of who is doing it. Everyone who cares about a
software can and should help with review.

A side effect of doing review is of course that knowledge about the
codebase increases in the community. After having done some amount of
review, people might even get write access, because they have
demonstrated that they can be trusted. This is demonstrated by
finding difficult-to-spot problems in others' patches. It is not
demonstrated by quickly giving every patch a thumbs-up.

Some say that it feels pointless to do review for someone who does
not have write access. I disagree with this, and I think this is a
very dangerous, almost complacent, attitude. If you do not believe
that your review is worth anything to those with write access, why
should you yourself have write access? This becomes a negative spiral
where in the end a project has no resources to do review, simply
because people do not have enough self-esteem to believe that the
review they can contribute matters. I don't know what the answer is.
I've tried time and time again to convince people that doing review
is helpful and important and a significant contribution to any
project, but it often doesn't really stick.

> * Setting-up a compilation farm is no reason for closing write access
> to historical developers of OpenSC.

I agree, but I don't think one has anything to do with the other,
even if they happened at the same time. I guess that anyone who had
write access to the repository earlier can get it again if they just
send a public ssh key and their prefered username.

> * Discussions are the base of Free Software. Once discussions have
> occurred, there should be several people with write access. You
> have to trust people. No need to lock write access to the main GIT.

I disagree about having to trust people out of the blue. Generally,
people write really shitty software, and the poor way that a lot of
open source software works is all the proof we need.

I love open source, not neccessarily because it is technically
superior, but because it allows *me* to fix things which are broken.

I believe that open source is as good as it is primarily thanks to
the practise of peer review.

The purpose of more write access as far as I can see is to have
faster, ie. less well reviewed and thus less well understood, changes
in the main repo. I do not agree at all with that goal.

> From my point of view, OpenSC is becoming a semi-private project
> with two people in charge: Ludovic and Martin. Personally, I don't
> want OpenSC to be organized the same way as libccid.

I find both Martin and Ludovic to be quite reasonable people. I've
never had any problem discussing any issue with them, actually quite
the opposite.

If there are perfect patches (well reviewed, well understood) then I
am convinced that they would race each other to add those patches
into the repository.

I have no experience from libccid development, but I'm happy with it
as a user, so Ludovic must be doing something right.

> We demand more freedom and transparency or this can only lead to
> endless flamewars.

Let's focus on a concrete problem. Have you created a patch which has
been peer reviewed and is well understood, but has been rejected by
Martin and Ludovic? If yes, let's try to find a solution. If no, you
can't really demand more freedom and transparency, because you
haven't exercised the freedom to create perfect patches yet.

I did review the epass2003 commits when their availability was
announced, and I've looked at the entersafe github account
again just now. Here is some feedback:

There are three branches; ePass2003_1, epass2003 and ep2k3. These
names are non-descript.

Commit 902e637c is quite long with over 2k lines added for the card
driver. That seems much to me. It's infeasible for me as careful
programmer but OpenSC internals newbie to review this code. My gut
feeling is that much of the code could be factored out.

The commits are not very well described in the commit messages.

The commits include unrelated changes.

The commits include whitespace changes mixed with actual code
changes.

The following commit undoes some of the unrelated changes in the
previous one.

This is what was immediately obvious to me just by looking at one and
a half commits in one of the branches. The things I point out above
are all things which do not belong in a perfect patch, and do not
beling in the OpenSC codebase that I want to use.

All these things, and probably more!, must be obvious to any other
programmer who has looked at the commits. I do not believe that I
have some special vision and only I can see these things.

It seems to me that the commits have been created without
self-review, which is of course the very first thing to do before
proposing any change for inclusion.

> Keep in mind that before doing business, I have been a politician
> fighting during 4 years for more freedom.

I did not know - that is quite commendable! Thank you for working on
making the world a better place!

Keep in mind that open source is not a democracy.

> Now I am retired, but if need be, we will create a charity for
> OpenSC and organize a duly elected board. I am not talking about
> a fork, which will never happen, but about elections.

But elections do not increase code quality. I think software quality
is more important than flat democracy. The meritocracy that is open
source *is* a hierarchy. I don't think this is bad.

//Peter
Picon

Re: OpenSC write access to main trunk, discussion

Dear Peter, 

Thank you for your time. In organization theory, there is no perfect
solution. There are several ways to achieve success.

Let us take two examples to see how OpenSC can be improved:

1) The ePass2003 code was reviewed by Viktor and included in his branch.
You probably did not know, did not compile, did not test and therefore
Viktor's work is ignored.

He needs and deserves write access to OpenSC main GIT to speed up
development. The reasons is that we need more new features, more beta
testers.

2) Take the example of Alon developments around PKCS#11. A lot of them
were ignored by OpenSSH. The reason is that when a small number of
people have a grasp on a project, strange things sometimes happen. I
would not like this to happen with OpenSC. Locking a project to a small
number of developers is not good.

IMHO, the way OpenSC used to be organized one year ago was superior,
because there was a central repository with all new features. More beta
features, more testers, larger market and superior quality.

This is no longer the case and each developers works in his corner. The
only collaborative work is what you call "peer review".

So my opinion would be to allow each developer to commit changes to the
main GITHUB staging (developing) branch after discussion. Like it used
to be the case using SVN. And make sure OpenSC is not only owned by one
or two people. This cannot ever happen, we don't agree with this
privatization.

The organization should be like:
* 4/5 committers
* 10/20 code contributors and developers
* 100 beta testers

Kind regards,
Jean-Michel
Attachment (smime.p7s): application/x-pkcs7-signature, 6022 bytes

Re: OpenSC write access to main trunk, discussion

On 02/17/2012 10:58 PM, Jean-Michel Pouré - GOOZE wrote:

> Let us take two examples to see how OpenSC can be improved: 1) The
> ePass2003 code was reviewed by Viktor and included in his branch. You
> probably did not know, did not compile, did not test and therefore 
> Viktor's work is ignored. He needs and deserves write access to
> OpenSC main GIT to speed up development. The reasons is that we need
> more new features, more beta testers.

[disclaimer I'm not experienced with opensc internals and comment might
be wrong]
This sounds pretty similar to the situation in hardware drivers which
often evolve faster than the linux kernel's pace. It might be better to
have a module approach for such development so that cutting edge drivers
can be used with opensc without recompilation or waiting for a new
opensc release. I don't know though, whether the size of the
projectjustifies something like that.

> 2) Take the example of Alon developments around PKCS#11. A lot of
> them were ignored by OpenSSH. The reason is that when a small number
> of people have a grasp on a project, strange things sometimes happen.
> I would not like this to happen with OpenSC. Locking a project to a
> small number of developers is not good.

In cases it might be good. We rejected Alon's PKCS #11 patches on gnutls
as well. You can say it was the wrong decision or so, but in the end of
day the few developers responsible for the project will have to maintain
it. If it is code they cannot maintain, or does not agree with the
longer term plans of the project maybe the feature should be postponed.

regards,
Nikos
_______________________________________________
opensc-devel mailing list
opensc-devel <at> lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Gmane