117 Commits

Author SHA1 Message Date
rrelyea%redhat.com
3a763787ba Bug 497223 - NSS failures with ECC hardware tokens
r=nelson


git-svn-id: svn://10.0.0.236/trunk@257542 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-20 00:38:53 +00:00
rrelyea%redhat.com
74618d8edc back out change so tree will go green.
git-svn-id: svn://10.0.0.236/trunk@257533 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-19 01:15:22 +00:00
rrelyea%redhat.com
c72c6b1fba Bug 497223 - NSS failures with ECC hardware tokens
r=nelson


git-svn-id: svn://10.0.0.236/trunk@257530 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-18 17:33:54 +00:00
julien.pierre.boogz%sun.com
93d74afe3d Fix for bug 480280 . Fix broken Windows build. r=nelson
git-svn-id: svn://10.0.0.236/trunk@256780 18797224-902f-48f8-a5cc-f745e15eee43
2009-03-31 23:49:06 +00:00
rrelyea%redhat.com
a177763a33 Bug 480280 - The CKA_EC_POINT PKCS#11 attribute is encoded in the wrong way: missing encapsulating octet string
Add code to 1) accept either type of encoding on input (both NSS and softoken).
2) output the correct encoding unless the environment variable NSS_USE_DECODED_CKA_EC_POINT is set.
r= nelson


git-svn-id: svn://10.0.0.236/trunk@256778 18797224-902f-48f8-a5cc-f745e15eee43
2009-03-31 21:05:32 +00:00
rrelyea%redhat.com
802db9a359 Bug 484425 - Need accessor function to retrieve SymKey handle
r+ nelson


git-svn-id: svn://10.0.0.236/trunk@256603 18797224-902f-48f8-a5cc-f745e15eee43
2009-03-20 21:08:15 +00:00
wtc%google.com
ef9647fd65 Bug 419523: made PK11_GetKeyData rather than __PK11_GetKeyData the primary
function. r=rrelyea.


git-svn-id: svn://10.0.0.236/trunk@247707 18797224-902f-48f8-a5cc-f745e15eee43
2008-03-13 03:53:33 +00:00
rrelyea%redhat.com
d88fd851e4 [Bug 401928] Support generalized PKCS#5 v2 PBEs
pk11wrap patch (base API support).
r=nelson


git-svn-id: svn://10.0.0.236/trunk@243328 18797224-902f-48f8-a5cc-f745e15eee43
2008-01-17 00:45:04 +00:00
nelson%bolyard.com
cbb74b089f Fix leak and OOM crash. Bug 338352 and 338356. Coverity.
r=rrelyea, alexei.volkov


git-svn-id: svn://10.0.0.236/trunk@199663 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-10 22:13:46 +00:00
relyea%netscape.com
8a6ed661d3 Bug 272484 Certificate manager crashes [@ _PR_MD_ATOMIC_DECREMENT - PK11_FreeSymKey]
The problem only happens if we try to import a key into a token which then fails
to import. The basic issue was a hack in the pkcs 7 code to support PKCS 12, A
special structure was used to replace the SymKey structure, and the code 'knew'
the special structure existed before it dealt with the symkey. The fix addes a
new capability to symkeys, where applications can attach application specific
data to the key structure. PKCS 12 uses this to attache the PBE information
for CMS. (part 1 of 3)

This patch also improves the key's reuse of sessions, so sessions are not thrashed
when SSL is used with them.

r=wtc


git-svn-id: svn://10.0.0.236/trunk@181498 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-03 21:55:29 +00:00
wtchang%redhat.com
1bffd00b38 Bug 299197: added the comment for PK11_TokenKeyGen back. r=relyea.
git-svn-id: svn://10.0.0.236/trunk@180726 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-21 01:32:11 +00:00
wtchang%redhat.com
092315f468 Bugzilla Bug 299197: define two bitflags for every PKCS #11 object
attribute with no exceptions. renamed PK11_ATTR_READONLY as
PK11_ATTR_UNMODIFIABLE.  In pk11_OpFlagsToAttributes, backed out a change
I made before.  Made pk11_AttrFlagsToAttributes table-driven. In
pk11_loadPrivKeyWithFlags, fixed the bug (always loading the public key as
a token object).  Other code cleanups. r=relyea,nelsonb.
Modified files: pk11akey.c pk11obj.c pk11pub.h pk11skey.c secmodt.h


git-svn-id: svn://10.0.0.236/trunk@179808 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-07 18:23:35 +00:00
wtchang%redhat.com
1ba1f46e29 Bugzilla Bug 299197: added PK11AttrFlags and PK11_GenerateKeyPairWithFlags.
Modified PK11_TokenKeyGenWithFlags to take a PK11AttrFlags parameter.
PK11AttrFlags controls the values of commonly used PKCS #11 object
attributes that have Boolean values. r=relyea,nelsonb.
Modified Files:
	nss/nss.def pk11wrap/pk11akey.c pk11wrap/pk11obj.c
	pk11wrap/pk11pub.h pk11wrap/pk11skey.c pk11wrap/secmodi.h
	pk11wrap/secmodt.h


git-svn-id: svn://10.0.0.236/trunk@179557 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-02 18:25:04 +00:00
wtchang%redhat.com
5d757d49f0 Bugzilla Bug 305835: removed NSS_ENABLE_ECC ifdefs under nss/lib except
nss/lib/{freebl,softoken,ssl}. r=nelsonb.
Modified Files:
	cryptohi/keyhi.h cryptohi/manifest.mn cryptohi/seckey.c
	cryptohi/secsign.c freebl/ec.c pk11wrap/manifest.mn
	pk11wrap/pk11akey.c pk11wrap/pk11cert.c pk11wrap/pk11mech.c
	pk11wrap/pk11obj.c pk11wrap/pk11skey.c pkcs12/manifest.mn
	pkcs12/p12d.c pkcs7/config.mk pkcs7/p7decode.c
	pkcs7/p7encode.c smime/cmssiginfo.c smime/cmsutil.c
	smime/config.mk


git-svn-id: svn://10.0.0.236/trunk@179526 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-02 01:24:57 +00:00
wtchang%redhat.com
89d789010f Bugzilla Bug 298957: removed a comment. The code already does what the
comment asked for. r=relyea.


git-svn-id: svn://10.0.0.236/trunk@177783 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-15 21:34:42 +00:00
nelsonb%netscape.com
32e6b5af26 Eliminate numerous potential causes of sending invalid (zero) session
handles down to a PKCS11 module.  Bug 292049. r=relyea.
Modified Files: pk11akey.c pk11auth.c pk11obj.c pk11skey.c pk11slot.c
 	pk11util.c


git-svn-id: svn://10.0.0.236/trunk@177047 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-03 01:22:07 +00:00
wtchang%redhat.com
b66657989d Bugzilla Bug 298957: improved the comment for PK11_TokenKeyGenWithFlags.
r=relyea.


git-svn-id: svn://10.0.0.236/trunk@176944 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-02 01:03:08 +00:00
wtchang%redhat.com
e9988681e7 Bugzilla Bug 298957: make the new function PK11_TokenKeyGenWithFlags
"legacy free" and move the code that set the CKF_ENCRYPT flag by default
and the Fortezza hack code to PK11_TokenKeyGen. r=relyea.


git-svn-id: svn://10.0.0.236/trunk@176419 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-22 00:07:52 +00:00
wtchang%redhat.com
2b95f59302 Bugzilla Bug 298957: code cleanup -- the array size can be MAX_TEMPL_ATTRS.
r=relyea.


git-svn-id: svn://10.0.0.236/trunk@175704 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-06 18:34:39 +00:00
wtchang%redhat.com
c23fe46d4b Bugzilla Bug 298957: added new function PK11_TokenKeyGenWithFlags.
r=relyea,nelsonb.
Modified files: nss/nss.def pk11wrap/pk11pub.h pk11wrap/pk11skey.c


git-svn-id: svn://10.0.0.236/trunk@175393 18797224-902f-48f8-a5cc-f745e15eee43
2005-06-30 17:50:41 +00:00
wtchang%redhat.com
7deeb45ac0 Bugzilla bug 288657: fixed the bug that pk11_AnyUnwrapKey returns a
partially constructed symKey object if C_UnwrapKey fails with
CKR_DEVICE_ERROR.  r=relyea.


git-svn-id: svn://10.0.0.236/trunk@171471 18797224-902f-48f8-a5cc-f745e15eee43
2005-04-01 22:27:44 +00:00
wtchang%redhat.com
4867486020 Bugzilla Bug 286439: Removed PKCS11_USE_THREADS and PK11_USE_THREADS.
r=relyea,nelsonb.
Modified Files:
	pk11wrap/pk11list.c pk11wrap/pk11pars.c pk11wrap/pk11skey.c
	pk11wrap/pk11slot.c pk11wrap/pk11util.c pk11wrap/secmod.h
	pk11wrap/secmodi.h pk11wrap/secmodt.h pk11wrap/secmodti.h
	softoken/pkcs11.c softoken/pkcs11i.h softoken/pkcs11u.c


git-svn-id: svn://10.0.0.236/trunk@171277 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-28 20:45:37 +00:00
wtchang%redhat.com
2a29625f3d Got rid of extraneous ^M characters at some line endings.
git-svn-id: svn://10.0.0.236/trunk@170852 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-17 21:28:40 +00:00
wtchang%redhat.com
1dac39cc88 Bugzilla Bug 286302: made PK11_CreateSymKey static and renamed it
pk11_CreateSymKey.  r=nelsonb.
Modified Files: pk11priv.h pk11skey.c


git-svn-id: svn://10.0.0.236/trunk@170802 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-16 22:40:35 +00:00
wtchang%redhat.com
9f6394e7f4 Bugzilla Bug 286313: code cleanup: use PORT_New and PORT_ZNew to allocate
structures. r=nelsonb.


git-svn-id: svn://10.0.0.236/trunk@170798 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-16 21:57:47 +00:00
wtchang%redhat.com
905999863e Bugzilla Bug 286313: pk11_getKeyFromList can call PORT_Alloc instead of
PORT_ZAlloc.  PK11_CreateSymKey should set the data.type member. r=jpierre


git-svn-id: svn://10.0.0.236/trunk@170790 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-16 19:10:49 +00:00
nelsonb%netscape.com
b2a948c42b Eliminate one cause of double-deletes of PKCS11 keys and sessions.
Bug 283690. Patch contributed by Bob Relyea. r=nelson.


git-svn-id: svn://10.0.0.236/trunk@170686 18797224-902f-48f8-a5cc-f745e15eee43
2005-03-15 05:27:31 +00:00
julien.pierre.bugs%sun.com
3ee7fc35b6 Fix for 269581 - cache the value of CKA_PRIVATE on private keys to avoid unnecessary C_GetAttributeValue . Also fix i
ncorrect logic in attribute tests. r=rrelyea,wtchang


git-svn-id: svn://10.0.0.236/trunk@169706 18797224-902f-48f8-a5cc-f745e15eee43
2005-02-24 00:38:23 +00:00
relyea%netscape.com
79864835d3 refactor pk11util, splitting large single files down to a managable size.
bug 246130. The new factor is:

pk11akey.c - asymetric keys constructed from pk11cert.c and pk11skey.c
pk11auth.c - authentication/password management factored from pk11slot.c
pk11cert.c - cert code with private key, crls and trust factored out.
pk11ctx.c -- pkcs11 context code, factored out of pk11skey.c
new pk11func.h -- for backward compatibility.
pk11mech.c - mechanism mapping code, factored mostly from pk11slot.c
pk11nobj.c - netscape objects (crls and trust), factored mostly from pk11cert.c
pk11obj.c - generic object support, factored from pk11skey.c pk11slot.c and
pk11cert.c
pk11priv.h -- private functions factored from pk11func.h
pk11pub.h -- public functions factored from pk11func.h
pk11skey.c - now only symetric key ops; private, public key ops, generic ops
and crypto contexs have been factored out.
pk11slot.c - still slot operations. Authentication, generic object ops,
mechanism mapping has been factored out.

This patch should only have refactoring, no new functions or other changes.


git-svn-id: svn://10.0.0.236/trunk@159504 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-19 22:12:38 +00:00
relyea%netscape.com
01510c097f Bug 244914, 244907 r=nelsonb
Add support for unprotected private keys without requiring authentication.
Add support to access application specific PKCS #11 objects through NSS.


git-svn-id: svn://10.0.0.236/trunk@158274 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-21 23:01:53 +00:00
gerv%gerv.net
43cb9e1492 Bug 236613: change to MPL/LGPL/GPL tri-license.
git-svn-id: svn://10.0.0.236/trunk@155484 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-25 15:03:26 +00:00
relyea%netscape.com
022e83ef50 Bug 239827: Fix race condition in unwrap private key (if target key is symetric).
git-svn-id: svn://10.0.0.236/trunk@154565 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-07 01:18:46 +00:00
jpierre%netscape.com
cabec54b89 Fix for 235874 - crash in PK11_DigestKey . r=wtc, nelsonb
git-svn-id: svn://10.0.0.236/trunk@153448 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-03 03:18:56 +00:00
nelsonb%netscape.com
b46e29aeba Move an extern function declaration to the header file where it belongs.
Bug 229212. r=relyea.


git-svn-id: svn://10.0.0.236/trunk@151674 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-22 02:19:42 +00:00
jpierre%netscape.com
9af88d0f5a Rename PK11_PubDeriveExtended to PK11_PubDeriveWithKDF
git-svn-id: svn://10.0.0.236/trunk@151008 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-08 01:37:46 +00:00
wchang0222%aol.com
6160f097ec Declare the argument to SECKEY_ECParamsToKeySize as const.
Modified Files: seckey.c pk11skey.c


git-svn-id: svn://10.0.0.236/trunk@150655 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-23 02:05:28 +00:00
wchang0222%aol.com
b1d52172e2 Renamed SECKEY_ECParams2KeySize as SECKEY_ECParamsToKeySize. Do not export
this function from the nss3 shared library.
Modified Files: seckey.c pk11skey.c nss.def


git-svn-id: svn://10.0.0.236/trunk@150647 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-22 23:36:40 +00:00
wchang0222%aol.com
0fd2842063 Made wincx the last argument of PK11_PubDeriveExtended. r=relyea.
Modified Files: pk11func.h pk11skey.c ssl3con.c


git-svn-id: svn://10.0.0.236/trunk@150552 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-19 23:54:29 +00:00
wchang0222%aol.com
7ea6b2e56c PK11_MoveKey was renamed PK11_MoveSymKey. r=relyea.
Modified Files: symkeyutil.c nss.def pk11func.h pk11skey.c


git-svn-id: svn://10.0.0.236/trunk@150550 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-19 23:29:43 +00:00
nelsonb%netscape.com
c82b8683b0 Don't invoke PKCS11 with an invalid handle. Bug 226285.
r=relyea sr=wchang0222


git-svn-id: svn://10.0.0.236/trunk@149617 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-21 22:10:56 +00:00
nelsonb%netscape.com
79dd7b56ae Plug a leak that occurs when code asks NSS to use an invalid PKCS11
mechanism.  Bugscape bug 53875.  r=relyea


git-svn-id: svn://10.0.0.236/trunk@149570 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-20 01:59:07 +00:00
relyea%netscape.com
419d66af8a Changes for symkey support.
git-svn-id: svn://10.0.0.236/trunk@149283 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-14 03:25:52 +00:00
wchang0222%aol.com
107fc21aee Bugzilla bug 223624: declare pk11_FindAttrInTemplate before it is used.
r=nelsonb.


git-svn-id: svn://10.0.0.236/trunk@148376 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-25 14:10:11 +00:00
relyea%netscape.com
1a4caffe99 221067 NSS needs to be able to create token symkeys from unwrap and derive.
git-svn-id: svn://10.0.0.236/trunk@148092 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-18 00:38:04 +00:00
ian.mcgreer%sun.com
decc84df49 ECC code landing.
Contributed by Sheuling Chang, Stephen Fung, Vipul Gupta, Nils Gura,
and Douglas Stebila of Sun Labs


git-svn-id: svn://10.0.0.236/trunk@148060 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-17 13:45:42 +00:00
nelsonb%netscape.com
14f2683ef1 Eliminate one of several redundant OID table lookups. Bug 207033.
git-svn-id: svn://10.0.0.236/trunk@147692 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-07 17:19:55 +00:00
nelsonb%netscape.com
39028f08d2 Create new function SECKEYEncryptedPrivateKeyInfo which is just like
SECKEYEncryptedPrivateKeyInfo except that it identifies the private
key by a private key pointer, rather than by a certificate. Bug 207033.


git-svn-id: svn://10.0.0.236/trunk@147656 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-07 01:26:38 +00:00
wtc%netscape.com
ffe02cc1db Bug 220963: need to handle the possibility that symKey may be NULL before
dereferencing it.


git-svn-id: svn://10.0.0.236/trunk@147502 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-01 23:01:46 +00:00
jpierre%netscape.com
1385096cc0 Fix typo
git-svn-id: svn://10.0.0.236/trunk@147271 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-25 00:25:06 +00:00
wtc%netscape.com
365f49cac6 Fix from Ian to address Bugzilla bug 202179.
The fix restores some old code that was removed as part of our
performance work (Bugzilla bug 145322).  Thus, there may be a
slight performance hit, but obviously, we need to have correct
code first.

This is a part of the code I really don't like.  To summarize,
there was a hack put in a long time ago to make sure that the
PKCS#11 session in which the SSL keys are generated was never
closed until the last key was deleted.  This only worked by chance,
and if any part of the code was changed (as was the case here), this
unstable equilibrium would be lost.  As with all hacks, it wasn't
really documented, so the problem escaped our notice.  As a result of
putting the hack back in, we're going back to the horribly wasteful
operation of opening 4 sessions and immediately closing them.  I intend
to have a proper solution in a later release.


git-svn-id: svn://10.0.0.236/trunk@145927 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-12 18:21:55 +00:00