On 2009-08-11 07:11 PDT, Rishi Renjith wrote:
> Hello, 
> The issue with the dummy DB was that some permissions to some files in
> it were not given. I did a chmod 777 to all files and now the dummy DB
> seems to be working fine. 

I still don't know what a dummy DB is, but I'm glad you got past it.

> I configured the NSS database with the crypto card(sun sca6000) as follows. 
> mkdir /opt/SMC/Apache2/nsscertdb
> 
> cd /opt/SMC/Apache2/nsscertdb
> 
> certutil -N -d /opt/SMC/Apache2/nsscertdb
> 
> modutil -dbdir . -nocertdb -force -add "Sun Crypto Accelerator"
> -libfile /usr/lib/libpkcs11.so -mechanisms RSA:DSA:RC4:DES

Ah!  You're trying to use a Sun Crypto Accelerator!  You didn't mention
that in your previous message.

>  modutil -list -dbdir /opt/SMC/Apache2/nssdb
> Using database directory /opt/SMC/Apache2/nssdb...
> 
> Listing of PKCS #11 Modules
> -----------------------------------------------------------
>   1. NSS Internal PKCS #11 Module
>          slots: 2 slots attached
>         status: loaded
> 
>          slot: NSS Internal Cryptographic Services
>         token: NSS Generic Crypto Services
> 
>          slot: NSS User Private Key and Certificate Services
>         token: NSS Certificate DB
> 
>   2. Sun Crypto Accelerator
>         library name: /usr/lib/libpkcs11.so
>          slots: 2 slots attached
>         status: loaded
> 
>          slot: Sun Metaslot
>         token: Sun Metaslot
> 
>          slot: Sun Crypto Softtoken
>         token: Sun Software PKCS#11 softtoken
> -----------------------------------------------------------

No crypto accelerator there!  It should show up as a slot.

Sun's Metaslot is a special software slot that redistributes the tasks
it is asked to do to the other slots.  Its other slots actually come
from other PKCS#11 modules that plug into it.  In this case, it shows
only one other slot, one belonging to Sun's pure-software PKCS#11 module,
Sun's "softtoken" (note: two t's, unlike NSS's pure-software softoken
which has only one t :).  That tells us that Sun's Metaslot has not been
configured to know about the Sun Crypto Accelerator you want to use.
In other words, your Sun Crypto Accelerator has not been "plugged in" to
your Metaslot.  So, when you did various operations, such as generating
a key pair and a CSR in the "metaslot", the Metaslot redistributed that
task to the only other slot it could fine, Sun's Softtoken.  That's not
what you expected, I see.

> certutil -R  -s "C=IN, O=NSN, OU=SPA2, CN=sandeeprc.eu.org
> <http://sandeeprc.eu.org>" -h "Sun Metaslot" -o ismc.csr -d . -a  -n
> ismc_cert

> (Got the CSR signed from CA Cert)
> certutil -A  -d . -n "ismc_cert" -a -t "CT,," -i cert2.csr -h "Sun Metaslot"
> 
> certutil -A  -d . -n "CACERT CA" -a -t "CTu,CTu,CTu" -i ca.txt -h "Sun
> Metaslot"
> 
> certutil -V -u V -d . -n "ismc_cert" -h "Sun Metaslot"
> 
> The certificate is verified corrrectly. 

I think you will find that all those certs appear to be in two slots,
the Metaslot and also in the softoken.  Try listing the certs in all
slots, e.g.
  certutil -L -d . -h all

> In nss.conf, i gave the following directives to use this database
> 
> Now in NSS.conf I added the following lines to use the hardware accelarator
> NSSNickname "Sun Metaslot:ismc_cert"
> NSSCertificateDatabase /opt/SMC/Apache2/nssdb
> 
> Now everything is working fine, the requests are getting processed
> correctly. But the issue is that the rsaprivate value is not getting
> incremented in the kstat -n mca0 output. Which means that it is not
> using the hardware accelerator card. 

Right. Not surprising, given that the SCA doesn't show up among the slots
known to the metaslot.

> I have also given cryptoadm enable metaslot token=<tokenname> so as to
> use the hardware accelerator. 
> 
> Any suggestions? 
> 
> (When we try to use mod_ssl using the pkcs patch, it s correctly
> incrementing the rsaprivate values.)

Now, your question is a Sun configuration question, namely, how do you
configure Sun's Metaslot so that it knows about the SCA-6000?  You'll
have to get the answer to that question from Sun.

If/when you get an answer, please share it with us here.  Thanks.
-- 
dev-tech-crypto mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to