diff options
author | wtc%google.com <devnull@localhost> | 2008-09-22 23:47:00 +0000 |
---|---|---|
committer | wtc%google.com <devnull@localhost> | 2008-09-22 23:47:00 +0000 |
commit | aeb0fcbd7fe999a3244ceaef7cf8d18f2f30874b (patch) | |
tree | 8d9374edfc1fb349aa922834ba242f32dcc5963d | |
parent | 0d8e34bc6aea1eb24dbd6d9f9aa7dcef09670282 (diff) | |
download | nss-hg-aeb0fcbd7fe999a3244ceaef7cf8d18f2f30874b.tar.gz |
Bug 426266: Decoupled lib/softoken and lib/ssl. lib/softoken should not
include any headers from lib/ssl. r=nelson.
Modified Files:
softoken/pkcs11c.c ssl/manifest.mn ssl/ssl3con.c
-rw-r--r-- | security/nss/lib/softoken/pkcs11c.c | 16 | ||||
-rw-r--r-- | security/nss/lib/ssl/manifest.mn | 5 | ||||
-rw-r--r-- | security/nss/lib/ssl/ssl3con.c | 1 |
3 files changed, 10 insertions, 12 deletions
diff --git a/security/nss/lib/softoken/pkcs11c.c b/security/nss/lib/softoken/pkcs11c.c index 2b7915e07..76d648f95 100644 --- a/security/nss/lib/softoken/pkcs11c.c +++ b/security/nss/lib/softoken/pkcs11c.c @@ -69,7 +69,6 @@ #include "secasn1.h" #include "secerr.h" -#include "ssl3prot.h" /* for SSL3_RANDOM_LENGTH */ #include "prprf.h" #define __PASTE(x,y) x##y @@ -88,6 +87,11 @@ #include "pkcs11f.h" +typedef struct { + uint8 client_version[2]; + uint8 random[46]; +} SSL3RSAPreMasterSecret; + static void sftk_Null(void *data, PRBool freeit) { return; @@ -2699,7 +2703,7 @@ CK_RV NSC_GenerateRandom(CK_SESSION_HANDLE hSession, */ static CK_RV nsc_pbe_key_gen(NSSPKCS5PBEParameter *pkcs5_pbe, CK_MECHANISM_PTR pMechanism, - char *buf, CK_ULONG *key_length, PRBool faulty3DES) + void *buf, CK_ULONG *key_length, PRBool faulty3DES) { SECItem *pbe_key = NULL, iv, pwitem; CK_PBE_PARAMS *pbe_params = NULL; @@ -3039,7 +3043,7 @@ CK_RV NSC_GenerateKey(CK_SESSION_HANDLE hSession, CK_BBOOL cktrue = CK_TRUE; int i; SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession); - char buf[MAX_KEY_LEN]; + unsigned char buf[MAX_KEY_LEN]; enum {nsc_pbe, nsc_ssl, nsc_bulk, nsc_param} key_gen_type; NSSPKCS5PBEParameter *pbe_param; SSL3RSAPreMasterSecret *rsa_pms; @@ -3185,9 +3189,8 @@ CK_RV NSC_GenerateKey(CK_SESSION_HANDLE hSession, case nsc_bulk: /* get the key, check for weak keys and repeat if found */ do { - crv = NSC_GenerateRandom(0, (unsigned char *)buf, key_length); - } while (crv == CKR_OK && checkWeak && - sftk_IsWeakKey((unsigned char *)buf,key_type)); + crv = NSC_GenerateRandom(0, buf, key_length); + } while (crv == CKR_OK && checkWeak && sftk_IsWeakKey(buf,key_type)); break; case nsc_param: /* generate parameters */ @@ -4873,6 +4876,7 @@ static const char * const mixers[NUM_MIXERS] = { "IIIIIIIII" }; #define SSL3_PMS_LENGTH 48 #define SSL3_MASTER_SECRET_LENGTH 48 +#define SSL3_RANDOM_LENGTH 32 /* NSC_DeriveKey derives a key from a base key, creating a new key object. */ diff --git a/security/nss/lib/ssl/manifest.mn b/security/nss/lib/ssl/manifest.mn index dfcd43031..84512296d 100644 --- a/security/nss/lib/ssl/manifest.mn +++ b/security/nss/lib/ssl/manifest.mn @@ -38,11 +38,6 @@ CORE_DEPTH = ../../.. # DEFINES = -DTRACE -PRIVATE_EXPORTS = \ - ssl3prot.h \ - sslimpl.h \ - $(NULL) - EXPORTS = \ ssl.h \ sslt.h \ diff --git a/security/nss/lib/ssl/ssl3con.c b/security/nss/lib/ssl/ssl3con.c index 48854af6e..9bf6dd7b5 100644 --- a/security/nss/lib/ssl/ssl3con.c +++ b/security/nss/lib/ssl/ssl3con.c @@ -59,7 +59,6 @@ #include "pk11func.h" #include "secmod.h" -#include "ec.h" #include "blapi.h" #include <stdio.h> |