Removed dead code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Removed dead code

Frank Morgner
Hi!

I had some spare time and removed a lot of dead code from OpenSC [1].
The pull request only deletes everything encapsulated with "#if 0" so no
harm is done.

Are there any objections, especially from the maintainers of the
card/reader drivers?

[1] https://github.com/OpenSC/OpenSC/pull/253

--
Frank Morgner

Virtual Smart Card Architecture http://vsmartcard.sourceforge.net
OpenPACE                        http://openpace.sourceforge.net
IFD Handler for libnfc Devices  http://sourceforge.net/projects/ifdnfc

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel

attachment0 (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Removed dead code

Douglas E Engert


On 6/10/2014 9:39 AM, Frank Morgner wrote:

> Hi!
>
> I had some spare time and removed a lot of dead code from OpenSC [1].
> The pull request only deletes everything encapsulated with "#if 0" so no
> harm is done.
>
> Are there any objections, especially from the maintainers of the
> card/reader drivers?
>
> [1] https://github.com/OpenSC/OpenSC/pull/253


Some of the code "#if 0" in pkcs11-object.c, framework-pkcs15.c and pkcs11-tool.c
deal with PKCS#11 attributes that were never supported, or OpenSC assumes
RSA only. For example a ECC key may be defined for derivation only,
and thus can not use used for verify. To fully implement some of this code
would require modifications to every card driver.

Other "if 0" code deals with derived secret keys, which may become more important
with key derivation with non RSA keys.

The "if 0" code in card-piv.c can be removed.

>
>
>
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
>
>
>
> _______________________________________________
> Opensc-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel
>

--

  Douglas E. Engert  <[hidden email]>


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Removed dead code

Frank Morgner
Hi!

> > I had some spare time and removed a lot of dead code from OpenSC [1].
> > The pull request only deletes everything encapsulated with "#if 0" so no
> > harm is done.
> >
> > Are there any objections, especially from the maintainers of the
> > card/reader drivers?
> >
> > [1] https://github.com/OpenSC/OpenSC/pull/253
>
>
> Some of the code "#if 0" in pkcs11-object.c, framework-pkcs15.c and pkcs11-tool.c
> deal with PKCS#11 attributes that were never supported, or OpenSC assumes
> RSA only. For example a ECC key may be defined for derivation only,
> and thus can not use used for verify. To fully implement some of this code
> would require modifications to every card driver.
>
> Other "if 0" code deals with derived secret keys, which may become more important
> with key derivation with non RSA keys.
So the some of the dead code is defined by the standard. But it is both,
incomplete and untested, right? Then I'd guess it can safely be removed
since a complete implementation will have to be rethought anyway.

> The "if 0" code in card-piv.c can be removed.

OK, thanks.

Any other comments? Here a list of the files in question:

card-asepcos.c
card-authentic.c
card-gpk.c
card-oberthur.c
ctbcs.c
cwa14890.c
card-epass2003.c
card-flex.c
card-belpic.c
card-setcos.c
pkcs15-skey.c
muscle.c
reader-ctapi.c
pkcs15-gemsafeV1.c
pkcs15-asepcos.c
pkcs15-atrust-acos.c
pkcs15-cardos.c
pkcs15-oberthur.c
sm-global-platform.c
sm-card-authentic.c
pkcs15-lib.c
sc-test.c
parse.c
sclex.c
pkcs15-jcop.c
sm-card-iasecc.c
sm-cwa14890.c
pkcs15-tool.c

--
Frank Morgner

Virtual Smart Card Architecture http://vsmartcard.sourceforge.net
OpenPACE                        http://openpace.sourceforge.net
IFD Handler for libnfc Devices  http://sourceforge.net/projects/ifdnfc

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel

attachment0 (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Removed dead code

Douglas E Engert


On 6/17/2014 4:54 PM, Frank Morgner wrote:

> Hi!
>
>>> I had some spare time and removed a lot of dead code from OpenSC [1].
>>> The pull request only deletes everything encapsulated with "#if 0" so no
>>> harm is done.
>>>
>>> Are there any objections, especially from the maintainers of the
>>> card/reader drivers?
>>>
>>> [1] https://github.com/OpenSC/OpenSC/pull/253
>>
>>
>> Some of the code "#if 0" in pkcs11-object.c, framework-pkcs15.c and pkcs11-tool.c
>> deal with PKCS#11 attributes that were never supported, or OpenSC assumes
>> RSA only. For example a ECC key may be defined for derivation only,
>> and thus can not use used for verify. To fully implement some of this code
>> would require modifications to every card driver.
>>
>> Other "if 0" code deals with derived secret keys, which may become more important
>> with key derivation with non RSA keys.
>
> So the some of the dead code is defined by the standard. But it is both,
> incomplete and untested, right? Then I'd guess it can safely be removed
> since a complete implementation will have to be rethought anyway.

Yes, it could be removed.

Some of the "#if 0" are more like comments much like TODO comments with some initial
code fragments that will be needed, but not testable by the developer with the hardware
they have.

OpenSC is still developing, with new developers looking to add features for their own
hardware devices. They start with the current code, and start hacking at it to get it
to work for them. Having some of the "comments" in the code can help point out what
still needs to be done.

On the other hand, #if 0" code in older card drivers with out active developers
could most likely be deleted.

>
>> The "if 0" code in card-piv.c can be removed.
>
> OK, thanks.
>
> Any other comments? Here a list of the files in question:
>
> card-asepcos.c
> card-authentic.c
> card-gpk.c
> card-oberthur.c
> ctbcs.c
> cwa14890.c
> card-epass2003.c
> card-flex.c
> card-belpic.c
> card-setcos.c
> pkcs15-skey.c
> muscle.c
> reader-ctapi.c
> pkcs15-gemsafeV1.c
> pkcs15-asepcos.c
> pkcs15-atrust-acos.c
> pkcs15-cardos.c
> pkcs15-oberthur.c
> sm-global-platform.c
> sm-card-authentic.c
> pkcs15-lib.c
> sc-test.c
> parse.c
> sclex.c
> pkcs15-jcop.c
> sm-card-iasecc.c
> sm-cwa14890.c
> pkcs15-tool.c
>
>
>
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
>
>
>
> _______________________________________________
> Opensc-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel
>

--

  Douglas E. Engert  <[hidden email]>


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel