I searched the archives for the softoken documentation you referenced, and
could not find it.  However in my searches I came across a message related
to trying to modify the function list as I am trying to do and it gave me a
clue as to why everything seemed to work except Netscape would abort when
you tried to load the custom softoken in it.  It has to do with the packing
of the function list within NSS, as one message suggested.  When I changed
the Microsoft VC6 project to do a 1 byte struct member alignment, and turned
off all optimizations everything started working.

There still is some type of problem, but I will track that down tomorrow.
Netscape 6 now loads the custom token, and my application sees the custom
token, and everything appears to work, however when I exit my application, I
get an abort message which is coming from the plds4.dll.

Ken

"Kenneth R. Robinette" <[EMAIL PROTECTED]> wrote in message
a5dsvp$[EMAIL PROTECTED]">news:a5dsvp$[EMAIL PROTECTED]...
> Bob
>
> I already have all the arguments and how to pass them through C_Initialize
> ok.  What I don't know how to do is to create a custom softtoken that can
be
> used by Netscape, without touching anything in the Mozilla softoken
> directory.  Right now I have to modify the pkcs11.c module to allow me to
> intercept the NSC_Initialize function, direct it to my C_Initialize, then
> setup the parms and call NSC_Initialize.  This allows me to define the
> location of my own databases, change the slot/token name, etc.  That
works,
> but I would have thought that there is a simpler and cleaner way without
> messing with the mozilla libraries.
>
> Trying to set the vector to my C_Initialize function in the
> C_GetFunctionList does not work, or at least I cannot get it to work.
> Besides the RSA PKCS11 specs states that this should never be done.  And
on
> top of that, I am trying to get to the point where I only call the mozilla
> dll's and not do static links.
>
> Ken
>
>
>
> "Robert Relyea" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Unfortunately the softoken needs the database configuration information
> > in order to operation. I've been meaning to pick some 'defaults', or
> > pull them out of the environment if the parameter strings are not
> > provided, but haven't had time.
> >
> > If you wanted to provide changes where softoken would look at an
> > environment variable if the parameter strings have not been provided, I
> > would be happy to include them in NSS.
> >
> > If you are writting an application, I posted how the parameters are
> > supposed to be passed through the INIT_ARGs of C_Initialize, though this
> > is a proposed amendment to the PKCS #11 standard, which has not been
> > adopted yet. That posting was several months ago, so you would have to
> > search the archives. That doc should be part of the NSS 3.4
> > documentation when it's released.
> >
> > bob
> >
> > Kenneth R. Robinette wrote:
> > > What is the "correct" method of using the new softokn3.dll as a unique
> > > software token?   I see where you can modify the pkcs11.c module to
add
> your
> > > own logic in the function nsc_CommonInitialize, to point to the
desired
> > > databases, change the token name, etc. but is this the preferred
method?
> > > Since the C_Initialize function is already contained within pkcs11.c,
I
> > > don't see a way to do so without modifying pkcs11.c itself.
> > >
> > > Ken
> > >
> > >
> > >
> > >
> >
>
>



Reply via email to