Skip to content

Commit

Permalink
Changes to deal with exporting data from Windows DLLs.
Browse files Browse the repository at this point in the history
SECHashObjects[] is no longer exported.
New function HASH_GetHashObject returns pointer to selected const object.
SSL statistics are now in a structure whose address is obtained via a
call to SSL_GetStatistics().
On NT, the new symbol NSS_USE_STATIC_LIBS must be declared in programs
that use the static SSL library.
Also, propagate "const" declaration for SECHashObjects.
  • Loading branch information
nelsonb%netscape.com committed Jan 5, 2001
1 parent aa2663b commit 21f4821
Show file tree
Hide file tree
Showing 40 changed files with 386 additions and 513 deletions.
22 changes: 3 additions & 19 deletions security/nss/cmd/SSLsample/sslsample.c
Expand Up @@ -391,23 +391,7 @@ printSecurityInfo(PRFileDesc *fd)
int kp0; /* total key bits */
int kp1; /* secret key bits */
int result;

#if 0
/* statistics from ssl3_SendClientHello (sch) */
extern long ssl3_sch_sid_cache_hits;
extern long ssl3_sch_sid_cache_misses;
extern long ssl3_sch_sid_cache_not_ok;

/* statistics from ssl3_HandleServerHello (hsh) */
extern long ssl3_hsh_sid_cache_hits;
extern long ssl3_hsh_sid_cache_misses;
extern long ssl3_hsh_sid_cache_not_ok;
#endif

/* statistics from ssl3_HandleClientHello (hch) */
extern long ssl3_hch_sid_cache_hits;
extern long ssl3_hch_sid_cache_misses;
extern long ssl3_hch_sid_cache_not_ok;
SSL3Statistics * ssl3stats = SSL_GetStatistics();

result = SSL_SecurityStatus(fd, &op, &cp, &kp0, &kp1, &ip, &sp);
if (result != SECSuccess)
Expand All @@ -420,8 +404,8 @@ extern long ssl3_hch_sid_cache_not_ok;
PR_Free(sp);

printf("%ld cache hits; %ld cache misses, %ld cache not reusable\n",
ssl3_hch_sid_cache_hits, ssl3_hch_sid_cache_misses,
ssl3_hch_sid_cache_not_ok);
ssl3stats->hch_sid_cache_hits, ssl3stats->hch_sid_cache_misses,
ssl3stats->hch_sid_cache_not_ok);

}

Expand Down
5 changes: 3 additions & 2 deletions security/nss/cmd/p7sign/p7sign.c
Expand Up @@ -45,6 +45,7 @@
#include "cert.h"
#include "certdb.h"
#include "cdbhdl.h"
#include "sechash.h" /* for HASH_GetHashObject() */

#if defined(XP_UNIX)
#include <unistd.h>
Expand Down Expand Up @@ -127,11 +128,11 @@ SignOut(void *arg, const char *buf, unsigned long len)
static int
CreateDigest(SECItem *data, char *digestdata, unsigned int *len, unsigned int maxlen)
{
SECHashObject *hashObj;
const SECHashObject *hashObj;
void *hashcx;

/* XXX probably want to extend interface to allow other hash algorithms */
hashObj = &SECHashObjects[HASH_AlgSHA1];
hashObj = HASH_GetHashObject(HASH_AlgSHA1);

hashcx = (* hashObj->create)();
if (hashcx == NULL)
Expand Down
5 changes: 3 additions & 2 deletions security/nss/cmd/p7verify/p7verify.c
Expand Up @@ -45,6 +45,7 @@
#include "certdb.h"
#include "cdbhdl.h"
#include "secoid.h"
#include "sechash.h" /* for HASH_GetHashObject() */

#if defined(XP_UNIX)
#include <unistd.h>
Expand Down Expand Up @@ -87,10 +88,10 @@ DigestFile(unsigned char *digest, unsigned int *len, unsigned int maxLen,
{
int nb;
char ibuf[4096];
SECHashObject *hashObj;
const SECHashObject *hashObj;
void *hashcx;

hashObj = &SECHashObjects[hashType];
hashObj = HASH_GetHashObject(hashType);

hashcx = (* hashObj->create)();
if (hashcx == NULL)
Expand Down
1 change: 1 addition & 0 deletions security/nss/cmd/platlibs.mk
Expand Up @@ -36,6 +36,7 @@ ifdef USE_STATIC_LIBS
# can't do this in manifest.mn because OS_ARCH isn't defined there.
ifeq ($(OS_ARCH), WINNT)

DEFINES += -DNSS_USE_STATIC_LIBS
# $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
CRYPTOLIB=$(DIST)/lib/freebl.lib
ifdef MOZILLA_SECURITY_BUILD
Expand Down

0 comments on commit 21f4821

Please sign in to comment.