Mike Jackson wrote:
Hi, I am trying to use cmsutil to encrypt a message, but it only segfaults.
Thanks for reporting this bug. I was able to reproduce it after slightly altering the sequence of commands you gave. Comments below.
OS: 5.2.1-RC NSS: nss-3.9.2 from ports
What I did: --------------------------------------------------------------------------- echo foobar > passwd
dd if=/dev/urandom of=rand.seed count=1
certutil -N -f passwd -d .
certutil -S -s "cn=netauth ca,dc=netauth,dc=com" -n "netauth.com" \ -f passwd -z rand.seed -x -t "C,C,C" -d .
certutil -R -s "cn=jimi hendrix,ou=people,dc=netauth,dc=com" \ -z rand.seed -f passwd -o jimi.req -d .
certutil -C -i jimi.req -o jimi.crt -f passwd -z rand.seed \ -c netauth.com -d .
certutil -A -n [EMAIL PROTECTED] -f passwd -t "P,P,P" -i jimi.crt -d .
certutil -R -s "cn=tom jones,ou=people,dc=netauth,dc=com" \ -z rand.seed -f passwd -o tom.req -d .
certutil -C -i tom.req -o tom.crt -f passwd -z rand.seed \ -c netauth.com -d .
certutil -A -n [EMAIL PROTECTED] -f passwd -t "P,P,P" -i jimi.crt -d .
The above command attempts to import the jimi cert a second time, and give it the nickname [EMAIL PROTECTED] When I attempted that, certutil silently failed to import that cert a second time, with the result that the tom cert was not listed in the output of certutil -L. So, I altered the above command to import the tom.crt file, rather than importing jimi.crt a second time, and then was able to proceed to reproduce the results you reported.
certutil -L -d .
[EMAIL PROTECTED] Pu,Pu,Pu netauth.com Cu,Cu,Cu [EMAIL PROTECTED] Pu,Pu,Pu
cmsutil -E -r [EMAIL PROTECTED] -i jimi.txt -d . -p foobar -o jimi.env Segmentation fault (core dumped)
I used a single line of text for jimi.txt. Contents were not important.
The failure occurs because the cert identified by the nickname [EMAIL PROTECTED] does not have an email address in the cert. NSS looks for the email address in the cert, and finds none.
CERT_FindSMimeProfile calls PK11_FindSMimeProfile with a NULL pointer for the emailAddr argument, and the latter function does not check the pointer for NULL before calling strlen with it.
Please file a critical bug against NSS about this on bugzilla.mozilla.org. Please put my email address on the CC list (after removing NO and SPAM), or post a followup message here with the bug number when you have filed it. Thanks for catching this.
/Nelson _______________________________________________ mozilla-crypto mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-crypto
