Changes to deal with exporting data from Windows DLLs.
authornelsonb%netscape.com
Wed, 10 Dec 2008 22:47:58 +0000
changeset 8876 b1511d409a732bfd4079e99da248e73e3bad5b1e
parent 8875 1baae802108f3324a59e003da3cf60cd704a36d6
child 8877 c8263b640fd445710e1f0370a79db7d9ee2f7038
push idunknown
push userunknown
push dateunknown
Changes to deal with exporting data from Windows DLLs. 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.
security/nss/lib/freebl/hasht.h
security/nss/lib/freebl/sechash.h
--- a/security/nss/lib/freebl/hasht.h
+++ b/security/nss/lib/freebl/hasht.h
@@ -70,18 +70,24 @@ struct SECHashObjectStr {
     void * (*clone)(void *);
     void (*destroy)(void *, PRBool);
     void (*begin)(void *);
     void (*update)(void *, const unsigned char *, unsigned int);
     void (*end)(void *, unsigned char *, unsigned int *, unsigned int);
 };
 
 struct HASHContextStr {
-    struct SECHashObjectStr *hashobj;
+    const struct SECHashObjectStr *hashobj;
     void *hash_context;
 };
 
-extern SECHashObject SECHashObjects[];
+/* This symbol is NOT exported from the NSS DLL.  Code that needs a 
+ * pointer to one of the SECHashObjects should call HASH_GetHashObject()
+ * instead. See "sechash.h".
+ */
+extern const SECHashObject SECHashObjects[];
 
-/*only those functions below the PKCS #11 line should use SECRawHashObjects*/
-extern SECHashObject SECRawHashObjects[];
+/* Only those functions below the PKCS #11 line should use SECRawHashObjects.
+ * This symbol is not exported from the NSS DLL.
+ */
+extern const SECHashObject SECRawHashObjects[];
 
 #endif /* _HASHT_H_ */
--- a/security/nss/lib/freebl/sechash.h
+++ b/security/nss/lib/freebl/sechash.h
@@ -67,11 +67,13 @@ extern void          HASH_Update(HASHCon
 				const unsigned char *src,
 				unsigned int len);
 
 extern void          HASH_End(HASHContext *context,
 			     unsigned char *result,
 			     unsigned int *result_len,
 			     unsigned int max_result_len);
 
+extern const SECHashObject * HASH_GetHashObject(HASH_HashType type);
+
 SEC_END_PROTOS
 
 #endif /* _HASH_H_ */