pkcs11-spy: eleminate config file?

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

pkcs11-spy: eleminate config file?

Andreas Jellinghaus-2
Hi,

as far as I can see pkcs11-spy has only two options:
the module to load and the file to write debug info to.
the second option is even optional (fall back to stderr).

we are currently doing changes like:
 - use scconf directly?
 - find the config file via an environment variable?
 - (windows only) or via registry key?
 - maybe create a new config file for pkcs11-spy only?
 - possible to also use the old opensc.conf?

I find all of that and the code related too complex.
So here is my simple approach:
 - no config file.
 - use the module getenv("PKCS11SPY_MODULE") fall back
   to compile time default (opensc-pkcs11.so).
   (windows: fall back to registry key search, first HLMU
   then HKLM).
 - log to stderr unless getenv("PKCS11SPY_LOG") gives a
   filename. (windows: also look for registrsy key HKLMU/HKLM).

two values fit nicely into the environment I think.
also the defaults (opensc-pkcs11.so / stderr) are fine
for many users so they won't need any configuration at all.

what do you think about this change?

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Martin Paljak
On 9/8/05, Andreas Jellinghaus <[hidden email]> wrote:
>  - find the config file via an environment variable?
>  - (windows only) or via registry key?
What reminds me that pkcs15 profiles in the config file on windows
sucks too. Maybe it would make sense to have a 'opensc home' path in
windows registry that would be used to locate opensc.conf and profiles
too.. ?

> what do you think about this change?
Yes.

--
Martin Paljak
[hidden email]
http://martin.paljak.pri.ee/
+372.5156495 - phone
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Andreas Jellinghaus-2
On Thursday 08 September 2005 17:37, Martin Paljak wrote:
> On 9/8/05, Andreas Jellinghaus <[hidden email]> wrote:
> >  - find the config file via an environment variable?
> >  - (windows only) or via registry key?
> What reminds me that pkcs15 profiles in the config file on windows
> sucks too. Maybe it would make sense to have a 'opensc home' path in
> windows registry that would be used to locate opensc.conf and profiles
> too.. ?

yes: going via opensc.conf might be ugly.
but some stuff in the config file and some stuff not in the config
file is ugly, too.

also the idea of an "opensc home" might work on windows, but not
on *ix: we expect config files in one place, data files in a different
place.

but once could argue: windows and unix are different anyway, so we could
make them different. we could for example compile in the default directory
on unix only and have the config file option - optional (commented out by
default). and for windows we could not have a compiled in default, but
some registry key we set to find it. or that common registry key for opensc
config and profile files.

if it looks fine for each operating system, then I don't care how different
the two approaches are. we need a windows and a unix section on those issues
anyway.

Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Nils Larsch
In reply to this post by Andreas Jellinghaus-2
Andreas Jellinghaus wrote:

> Hi,
>
> as far as I can see pkcs11-spy has only two options:
> the module to load and the file to write debug info to.
> the second option is even optional (fall back to stderr).
>
> we are currently doing changes like:
>  - use scconf directly?
>  - find the config file via an environment variable?
>  - (windows only) or via registry key?
>  - maybe create a new config file for pkcs11-spy only?

this depends on how many option we need (or will need in the
future)

>  - possible to also use the old opensc.conf?
>
> I find all of that and the code related too complex.
> So here is my simple approach:
>  - no config file.

if we know that we will not need other options in the future
that's ok (btw: next time you could make this suggestion
*before* I spend time implement scconf code in pkcs11-spy ;-)

>  - use the module getenv("PKCS11SPY_MODULE") fall back
>    to compile time default (opensc-pkcs11.so).
>    (windows: fall back to registry key search, first HLMU
>    then HKLM).

I would prefer not to fall back to a compile time default. The
user should explicitly state what he/she wants; it's not that
difficult.

>  - log to stderr unless getenv("PKCS11SPY_LOG") gives a
>    filename. (windows: also look for registrsy key HKLMU/HKLM).

ok

>
> two values fit nicely into the environment I think.
> also the defaults (opensc-pkcs11.so / stderr) are fine

partly disagree, see above

Cheers,
Nils
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Martin Paljak
On 9/10/05, Nils Larsch <[hidden email]> wrote:
> I would prefer not to fall back to a compile time default. The
> user should explicitly state what he/she wants; it's not that
> difficult.
IMHO pkcs11-spy is something only developers or testers-debuggers use
so it must not be *that* userfriendly as other enduser utilities.


--
Martin Paljak
[hidden email]
http://martin.paljak.pri.ee/
+372.5156495 - phone
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Andreas Jellinghaus-2
In reply to this post by Nils Larsch
On Saturday 10 September 2005 12:03, Nils Larsch wrote:
> > I find all of that and the code related too complex.
> > So here is my simple approach:
> >  - no config file.
>
> if we know that we will not need other options in the future
> that's ok (btw: next time you could make this suggestion
> *before* I spend time implement scconf code in pkcs11-spy ;-)

yes, sorry. when I saw the final new code I realised how complex
it was and how many different ways we now have to set the same
thing.

> I would prefer not to fall back to a compile time default. The
> user should explicitly state what he/she wants; it's not that
> difficult.

fine with me as well. even less configure work that way :)

also I saw there are already environment variables for both -
module and output - so we keep those names of course and would
simply remove all references to scconf code.

I'm not sure about windows: I think we should have a registry
key for a windows user as well. there might be cases where
they can not or don't want to use environment variables?

btw: I thought windows has some tool which we can feed with
a key / description / .. file, so people don't need to edit
registry directly. I think it was adm files and somehow related
to group policies, but I'm not sure if it can be used also
without gp, i.e. to directly change registry. maybe anyone here
knows more about it?

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Peter Stuge
On Sat, Sep 10, 2005 at 06:43:17PM +0200, Andreas Jellinghaus wrote:
> btw: I thought windows has some tool which we can feed with
> a key / description / .. file, so people don't need to edit
> registry directly.

.reg files? Double-click them in explorer to write their contents to
the registry.


//Peter
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Andreas Jellinghaus-2
In reply to this post by Andreas Jellinghaus-2
Ok?

compile tested on linuy only so far.

Andreas

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

opensc-pkcs11-spy-no-config.diff (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pkcs11-spy: eleminate config file?

Nils Larsch
Andreas Jellinghaus wrote:
> Ok?

looks ok, of course opensc.conf.in needs to changed as well ;-)

Cheers,
Nils
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel