Skip to content

Commit

Permalink
Bug 426266: Decoupled lib/softoken and lib/ssl. lib/softoken should not
Browse files Browse the repository at this point in the history
include any headers from lib/ssl.  r=nelson.
Modified Files:
	softoken/pkcs11c.c ssl/manifest.mn ssl/ssl3con.c
  • Loading branch information
wtc%google.com committed Sep 22, 2008
1 parent 5260f95 commit 087e196
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
16 changes: 10 additions & 6 deletions security/nss/lib/softoken/pkcs11c.c
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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. */
Expand Down
5 changes: 0 additions & 5 deletions security/nss/lib/ssl/manifest.mn
Expand Up @@ -38,11 +38,6 @@ CORE_DEPTH = ../../..

# DEFINES = -DTRACE

PRIVATE_EXPORTS = \
ssl3prot.h \
sslimpl.h \
$(NULL)

EXPORTS = \
ssl.h \
sslt.h \
Expand Down
1 change: 0 additions & 1 deletion security/nss/lib/ssl/ssl3con.c
Expand Up @@ -59,7 +59,6 @@

#include "pk11func.h"
#include "secmod.h"
#include "ec.h"
#include "blapi.h"

#include <stdio.h>
Expand Down

0 comments on commit 087e196

Please sign in to comment.