Get everything building and linking on WINNT.

This commit is contained in:
nicolson%netscape.com 2001-02-20 05:38:45 +00:00
Родитель ccc012b03a
Коммит 6038a5536a
27 изменённых файлов: 163 добавлений и 214 удалений

Просмотреть файл

@ -38,8 +38,6 @@
include manifest.mn
LIBRARY_NAME = jss21
#######################################################################
# (2) Include "global" configuration information. (OPTIONAL) #
#######################################################################

Просмотреть файл

@ -30,63 +30,63 @@
# may use your version of this file under either the MPL or the
# GPL.
#
#######################################################################
# Adjust specific variables for specific platforms #
#######################################################################
# We don't need static, import, or purify libraries
LIBRARY =
IMPORT_LIBRARY=
# Get rid of embedded "32" in library names on Windows
ifeq ($(OS_ARCH),WINNT)
SHARED_LIBRARY := $(subst 32,,$(SHARED_LIBRARY))
SHARED_LIBRARY_G := $(subst 32,,$(SHARED_LIBRARY_G))
endif
#######################################################################
# Adjust specific variables for all platforms #
#######################################################################
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).dll
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).lib
DLLFLAGS += -DEF:jss.def
#RES = $(OBJDIR)/jss.res
#RESNAME = jss.rc
SHARED_LIBRARY_LIBS=yes
SHARED_LIBRARY_DIRS = \
../org/mozilla/jss/crypto \
../org/mozilla/jss/manage \
../org/mozilla/jss/pkcs11 \
../org/mozilla/jss/ssl \
../org/mozilla/jss/util \
../org/mozilla/jss/hclhacks \
$(NULL)
EXTRA_LIBS += \
$(LIBNSS) \
$(LIBSSL) \
$(LIBCRYPTOHI) \
$(LIBCERTHI) \
$(LIBNSSB) \
$(LIBPK11WRAP) \
$(LIBJAR) \
$(LIBPKCS12) \
$(LIBPKCS7) \
$(LIBSECTOOL) \
$(LIBSMIME) \
$(LIBSOFTOKEN) \
$(LIBCERTDB) \
$(LIBFREEBL) \
$(LIBSECUTIL) \
$(DIST)/lib/dbm.lib \
$(NULL)
EXTRA_SHARED_LIBS += \
$(DIST)/lib/$(NSPR31_LIB_PREFIX)plc4.lib \
$(DIST)/lib/$(NSPR31_LIB_PREFIX)plds4.lib \
$(DIST)/lib/$(NSPR31_LIB_PREFIX)nspr4.lib \
$(JAVA_LIBS) \
$(DLLSYSTEM) \
$(NULL)
endif
ifeq ($(OS_ARCH),WINNT)
LDOPTS += -PDB:NONE
endif
# Only used for "sanitizing" the release
STATIC_LIB_EXTENSION=
DYNAMIC_LIB_EXTENSION=
# Include "funky" link path to pick up ALL native libraries for OSF/1.
ifeq ($(OS_ARCH), OSF1)
JAVA_LIBS += -L$(JAVA_HOME)/$(JAVA_LIBDIR).no
endif
LD_LIBS += -Wl,--whole-archive
#######################################################################
# Set the LD_LIBS value to encompass all static JSS, security, and #
# dbm libraries #
#######################################################################
LD_LIBS += $(LIBJSSMANAGE) $(LIBJSSPKCS11) $(LIBJSSCRYPTO) $(LIBJSSUTIL) $(LIBJSSHCLHACKS) $(LIBJSSSSL) -Wl,--no-whole-archive $(LIBNSS) $(LIBSSL) $(LIBCRYPTOHI) $(LIBCERTHI) $(LIBNSSB) $(LIBPK11WRAP) $(LIBJAR) $(LIBPKCS12) $(LIBPKCS7) $(LIBSECTOOL) $(LIBSMIME) $(LIBSOFTOKEN) $(LIBCERTDB) $(LIBFREEBL) $(LIBSECUTIL) $(LIBDBM)
#######################################################################
# Append additional LD_LIBS value to encompass all dynamic NSPR 2.0, #
# java, and system libraries #
#######################################################################
ifneq ($(STANDALONE_LIBJSS),1)
# NSPR is not included in libjss
ifeq ($(OS_ARCH), WINNT)
LD_LIBS += $(DLLPLDS) $(DLLPLC) $(DLLPR) $(JAVA_LIBS) $(DLLSYSTEM)
else
LD_LIBS += -L$(SOURCE_LIB_DIR) -lplds4 -lplc4 -lnspr4 $(JAVA_LIBS) $(DLLSYSTEM)
endif
else
# NSPR is included in libjss
ifeq ($(OS_ARCH), WINNT)
LD_LIBS += $(LIBPLDS) $(LIBPLC) $(LIBPR) $(JAVA_LIBS) $(DLLSYSTEM)
else
LD_LIBS += -L$(SOURCE_LIB_DIR) $(LIBPLDS) $(LIBPLC) $(LIBPR) $(JAVA_LIBS) $(DLLSYSTEM)
endif
endif

Просмотреть файл

@ -37,3 +37,5 @@ MODULE = jss
NS_USE_JDK = 1
LIBRARY_NAME = jss
LIBRARY_VERSION = 3

Просмотреть файл

@ -104,7 +104,7 @@ JSS_AlgInfo JSS_AlgTable[NUM_ALGS] = {
* CK_MECHANISM_TYPE corresponding to this algorithm, or
* CKM_INVALID_MECHANISM if none exists.
*/
PR_IMPLEMENT( CK_MECHANISM_TYPE )
CK_MECHANISM_TYPE
JSS_getPK11MechFromAlg(JNIEnv *env, jobject alg)
{
JSS_AlgInfo info;
@ -131,7 +131,7 @@ JSS_getPK11MechFromAlg(JNIEnv *env, jobject alg)
* SECOidTag corresponding to this algorithm, or SEC_OID_UNKNOWN
* if none was found.
*/
PR_IMPLEMENT( SECOidTag )
SECOidTag
JSS_getOidTagFromAlg(JNIEnv *env, jobject alg)
{
JSS_AlgInfo info;

Просмотреть файл

@ -68,7 +68,7 @@ extern JSS_AlgInfo JSS_AlgTable[];
* SECOidTag corresponding to this algorithm, or SEC_OID_UNKNOWN
* if none was found.
*/
PR_EXTERN( SECOidTag )
SECOidTag
JSS_getOidTagFromAlg(JNIEnv *env, jobject alg);
/***********************************************************************
@ -82,7 +82,7 @@ JSS_getOidTagFromAlg(JNIEnv *env, jobject alg);
* CK_MECHANISM_TYPE corresponding to this algorithm, or
* CKM_INVALID_MECHANISM if none was found.
*/
PR_EXTERN( CK_MECHANISM_TYPE )
CK_MECHANISM_TYPE
JSS_getPK11MechFromAlg(JNIEnv *env, jobject alg);
PR_END_EXTERN_C

Просмотреть файл

@ -81,7 +81,7 @@ struct CERTCertDBHandleStr {
**
** Returns 0 on success, -1 on failure.
*/
PR_EXTERN(PRInt32)
PRInt32
PR_GetThreadAffinityMask(PRThread *thread, PRUint32 *mask);
static jobject
@ -394,7 +394,7 @@ Java_org_mozilla_jss_CryptoManager_initializeAllNative
* Initialize the security library and open all the databases.
*
*/
PR_IMPLEMENT( void )
void
JSS_completeInitialize(JNIEnv *env,
jstring modDBName,
jstring keyDBName,
@ -655,7 +655,7 @@ Java_org_mozilla_jss_CryptoManager_setNativePasswordCallback
* login to tokens implicitly if necessary.
*
*/
PR_IMPLEMENT( void )
void
JSS_setPasswordCallback(JNIEnv *env, jobject callback)
{
PR_ASSERT(env!=NULL && callback!=NULL);

Просмотреть файл

@ -1,77 +0,0 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape Security Services for Java.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
/* This header depends on:
#include <jni.h>
#include <nspr.h>
*/
#ifndef JSS_INIT_H
#define JSS_INIT_H
/***********************************************************************
* JSS_completeInitialize
*
* Initialize the security library and open all the databases.
*
*/
PR_EXTERN( void )
JSS_completeInitialize(JNIEnv *env,
jstring modDBName,
jstring keyDBName,
jstring certDBName,
jboolean readOnly,
jstring manuString,
jstring libraryString,
jstring tokString,
jstring keyTokString,
jstring slotString,
jstring keySlotString,
jstring fipsString,
jstring fipsKeyString,
jboolean ocspCheckingEnabled,
jstring ocspResponderURL,
jstring ocspResponderCertNickname );
/**********************************************************************
*
* JSS_setPasswordCallback
*
* Sets the global PasswordCallback object, which will be used to
* login to tokens implicitly if necessary.
*
*/
PR_EXTERN( void )
JSS_setPasswordCallback(JNIEnv *env, jobject callback);
#endif

Просмотреть файл

@ -240,7 +240,7 @@ finish:
* ptr: Address of a CERTCertificate* that will receive the pointer.
* Returns: PR_SUCCESS for success, PR_FAILURE if an exception was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getCertPtr(JNIEnv *env, jobject certObject, CERTCertificate **ptr)
{
PR_ASSERT(env!=NULL && certObject!=NULL && ptr!=NULL);
@ -259,7 +259,7 @@ JSS_PK11_getCertPtr(JNIEnv *env, jobject certObject, CERTCertificate **ptr)
* returns: a new PK11Cert wrapping the CERTCertificate, or NULL if an
* exception was thrown.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapCert(JNIEnv *env, CERTCertificate **cert)
{
jclass certClass;

Просмотреть файл

@ -271,7 +271,7 @@ finish:
* RETURNS
* PR_SUCCESS for success, or PR_FAILURE if an exception was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getCipherContext(JNIEnv *env, jobject proxy, PK11Context **pContext)
{
@ -294,7 +294,7 @@ JSS_PK11_getCipherContext(JNIEnv *env, jobject proxy, PK11Context **pContext)
* RETURNS
* A new CipherContextProxy, or NULL if an exception was thrown.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapCipherContextProxy(JNIEnv *env, PK11Context **context) {
jbyteArray pointer=NULL;

Просмотреть файл

@ -752,7 +752,7 @@ finish:
*
* Returns a simple error string for a given PKCS #11 error.
*/
PR_IMPLEMENT( char* )
char*
JSS_PK11_getErrorString(CK_RV crv)
{
switch(crv) {

Просмотреть файл

@ -170,7 +170,7 @@ finish:
* A new Java PK11Module object, or NULL if an exception was thrown.
* In any case, the ptr parameter is eaten.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapPK11Module(JNIEnv *env, SECMODModule **module)
{
jclass moduleClass;
@ -231,7 +231,7 @@ finish:
* PR_FAILURE if an exception was thrown, or PR_SUCCESS if the
* peration succeeded.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getModulePtr(JNIEnv *env, jobject module, SECMODModule **ptr)
{
PR_ASSERT(env!=NULL && module!=NULL && ptr!=NULL);

Просмотреть файл

@ -52,7 +52,7 @@
* privk: will be stored in a Java wrapper.
* Returns: a new PK11PrivKey, or NULL if an exception occurred.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapPrivKey(JNIEnv *env, SECKEYPrivateKey **privk)
{
jclass keyClass;
@ -255,7 +255,7 @@ finish:
* ptr: Address of a SECKEYPrivateKey* that will receive the pointer.
* Returns: PR_SUCCESS for success, PR_FAILURE if an exception was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getPrivKeyPtr(JNIEnv *env, jobject privkObject,
SECKEYPrivateKey** ptr)
{
@ -425,7 +425,7 @@ Java_org_mozilla_jss_pkcs11_PK11PrivKey_getStrength
* RETURNS
* The key type, or nullKey if an exception occurred.
*/
PR_IMPLEMENT( KeyType )
KeyType
JSS_PK11_getKeyType(JNIEnv *env, jobject keyTypeObj)
{
jclass keyTypeClass;

Просмотреть файл

@ -84,7 +84,7 @@ finish:
/***********************************************************************
** JSS_PK11_wrapPubKey
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapPubKey(JNIEnv *env, SECKEYPublicKey **pKey)
{
jobject pubKey=NULL;

Просмотреть файл

@ -540,7 +540,7 @@ struct SigContextProxyStr {
* of the context either SGN_CONTEXT or VFY_CONTEXT.
* Returns: PR_SUCCESS, unless an exception was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getSigContext(JNIEnv *env, jobject proxy, void**pContext,
SigContextType *pType)
{
@ -580,7 +580,7 @@ JSS_PK11_getSigContext(JNIEnv *env, jobject proxy, void**pContext,
* Returns: a new SigContextProxy object wrapping the given SGNContext, or
* NULL if an exception was thrown.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapSigContextProxy(JNIEnv *env, void **ctxt, SigContextType type)
{
jclass proxyClass;

Просмотреть файл

@ -370,7 +370,7 @@ finish:
* PR_SUCCESS if the operation was successful, PR_FAILURE if an
* exception was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getStoreSlotPtr(JNIEnv *env, jobject store, PK11SlotInfo **slot)
{
PR_ASSERT(env!=NULL && store!=NULL && slot!=NULL);

Просмотреть файл

@ -52,7 +52,7 @@
* symKey: will be stored in a Java wrapper.
* Returns: a new PK11SymKey, or NULL if an exception occurred.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapSymKey(JNIEnv *env, PK11SymKey **symKey)
{
jclass keyClass;
@ -289,7 +289,7 @@ finish:
* J S S _ P K 1 1 _ g e t S y m K e y P t r
*
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getSymKeyPtr(JNIEnv *env, jobject symKeyObject, PK11SymKey **ptr)
{
PR_ASSERT(env!=NULL && symKeyObject!=NULL);

Просмотреть файл

@ -87,7 +87,7 @@ static SECStatus GenerateKeyPair(JNIEnv *env, unsigned int ktype,
*
* Returns a new PK11Token object, or NULL if an exception was thrown.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapPK11Token(JNIEnv *env, PK11SlotInfo **slot)
{
jclass tokenClass;
@ -836,19 +836,19 @@ finish:
/************************************************************************
*
* P K 1 1 T o k e n . r e l e a s e N a t i v e R e s o u r c e s
* T o k e n P r o x y . r e l e a s e N a t i v e R e s o u r c e s
*
* Free the PK11SlotInfo structure that underlies my token.
*/
JNIEXPORT void JNICALL
Java_org_mozilla_jss_pkcs11_PK11Token_releaseNativeResources
Java_org_mozilla_jss_pkcs11_TokenProxy_releaseNativeResources
(JNIEnv *env, jobject this)
{
PK11SlotInfo *slot;
PR_ASSERT(env!=NULL && this!=NULL);
if(JSS_PK11_getTokenSlotPtr(env, this, &slot) != PR_SUCCESS) {
if(JSS_getPtrFromProxy(env, this, (void**)&slot) != PR_SUCCESS) {
PR_ASSERT( PR_FALSE );
goto finish;
}
@ -874,7 +874,7 @@ finish:
* returns: PR_SUCCESS if the operation was successful, PR_FAILURE if an
* exception was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getTokenSlotPtr(JNIEnv *env, jobject tokenObject, PK11SlotInfo **ptr)
{
PR_ASSERT(env != NULL && tokenObject != NULL && ptr != NULL);

Просмотреть файл

@ -55,7 +55,7 @@ PR_BEGIN_EXTERN_C
* privk: will be eaten by the wrapper and set to NULL.
* Returns: a new PK11PrivKey, or NULL if an exception occurred.
*/
PR_EXTERN( jobject )
jobject
JSS_PK11_wrapPrivKey(JNIEnv *env, SECKEYPrivateKey **privk);
/***********************************************************************
@ -64,7 +64,7 @@ JSS_PK11_wrapPrivKey(JNIEnv *env, SECKEYPrivateKey **privk);
* privk: will be eaten by the wrapper and set to NULL.
* Returns: a new PK11PubKey, or NULL if an exception occurred.
*/
PR_EXTERN( jobject )
jobject
JSS_PK11_wrapPubKey(JNIEnv *env, SECKEYPublicKey **pubk);
@ -76,7 +76,7 @@ JSS_PK11_wrapPubKey(JNIEnv *env, SECKEYPublicKey **pubk);
* ptr: Address of a SECKEYPrivateKey* that will receive the pointer.
* Returns: PR_SUCCESS for success, PR_FAILURE if an exception was thrown.
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_PK11_getPrivKeyPtr(JNIEnv *env, jobject privkObject,
SECKEYPrivateKey** ptr);
@ -98,7 +98,7 @@ JSS_PK11_getPubKeyPtr(JNIEnv *env, jobject pubkObject,
* Given a Java PK11SymKey, extracts the C PK11SymKey and stores it at
* the given address.
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_PK11_getSymKeyPtr(JNIEnv *env, jobject symKeyObject, PK11SymKey **ptr);
/***********************************************************************
@ -107,7 +107,7 @@ JSS_PK11_getSymKeyPtr(JNIEnv *env, jobject symKeyObject, PK11SymKey **ptr);
* symKey: will be stored in a Java wrapper.
* Returns: a new PK11SymKey, or NULL if an exception occurred.
*/
PR_EXTERN( jobject )
jobject
JSS_PK11_wrapSymKey(JNIEnv *env, PK11SymKey **symKey);
/***********************************************************************
@ -121,7 +121,7 @@ JSS_PK11_wrapSymKey(JNIEnv *env, PK11SymKey **symKey);
* RETURNS
* The key type, or nullKey if an exception occurred.
*/
PR_EXTERN( KeyType )
KeyType
JSS_PK11_getKeyType(JNIEnv *env, jobject keyTypeObj);
@ -143,7 +143,7 @@ JSS_PK11_getKeyType(JNIEnv *env, jobject keyTypeObj);
* ptr: Address of a CERTCertificate* that will receive the pointer.
* Returns: PR_SUCCESS for success, PR_FAILURE if an exception was thrown.
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_PK11_getCertPtr(JNIEnv *env, jobject certObject, CERTCertificate **ptr);
@ -159,7 +159,7 @@ JSS_PK11_getCertPtr(JNIEnv *env, jobject certObject, CERTCertificate **ptr);
* will be set to NULL whether the functions fails or succeeds.
* Returns: a new Java PK11Cert object, or NULL if an exception was thrown.
*/
PR_EXTERN( jobject )
jobject
JSS_PK11_wrapCert(JNIEnv *env, CERTCertificate **ppCert);
@ -183,7 +183,7 @@ JSS_PK11_wrapCert(JNIEnv *env, CERTCertificate **ppCert);
* PR_SUCCESS if the operation was successful, PR_FAILURE if an
* exception was thrown.
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_PK11_getStoreSlotPtr(JNIEnv *env, jobject store, PK11SlotInfo **slot);
@ -200,7 +200,7 @@ JSS_PK11_getStoreSlotPtr(JNIEnv *env, jobject store, PK11SlotInfo **slot);
**
** Returns a new CryptoToken object, or NULL if an exception was thrown.
**/
PR_EXTERN( jobject )
jobject
JSS_PK11_makeCryptoTokenFromPK11(JNIEnv *env, jobject pk11token);
/***********************************************************************
@ -214,7 +214,7 @@ JSS_PK11_makeCryptoTokenFromPK11(JNIEnv *env, jobject pk11token);
*
* Returns a new PK11Token object, or NULL if an exception was thrown.
*/
PR_EXTERN( jobject )
jobject
JSS_PK11_wrapPK11Token(JNIEnv *env, PK11SlotInfo **slot);
/************************************************************************
@ -229,7 +229,7 @@ JSS_PK11_wrapPK11Token(JNIEnv *env, PK11SlotInfo **slot);
* returns: PR_SUCCESS if the operation was successful, PR_FAILURE if an
* exception was thrown.
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_PK11_getTokenSlotPtr(JNIEnv *env, jobject tokenObject, PK11SlotInfo **ptr);
@ -251,7 +251,7 @@ JSS_PK11_getTokenSlotPtr(JNIEnv *env, jobject tokenObject, PK11SlotInfo **ptr);
* A new Java PK11Module object, or NULL if an exception was thrown.
* In any case, the ptr parameter is eaten.
*/
PR_IMPLEMENT( jobject )
jobject
JSS_PK11_wrapPK11Module(JNIEnv *env, SECMODModule **module);
@ -271,7 +271,7 @@ JSS_PK11_wrapPK11Module(JNIEnv *env, SECMODModule **module);
* PR_FAILURE if an exception was thrown, or PR_SUCCESS if the
* peration succeeded.
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_PK11_getModulePtr(JNIEnv *env, jobject module, SECMODModule **ptr);
@ -296,7 +296,7 @@ typedef struct SigContextProxyStr SigContextProxy;
* be stored.
* Returns: PR_SUCCESS, unless an exception was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_PK11_getSigContext(JNIEnv *env, jobject proxy, void**pContext,
SigContextType* pType);
@ -312,7 +312,7 @@ JSS_PK11_getSigContext(JNIEnv *env, jobject proxy, void**pContext,
* Returns: a new ContextProxy object wrapping the given context,
* or NULL if an exception was thrown.
*/
PR_EXTERN( jobject )
jobject
JSS_PK11_wrapSigContextProxy(JNIEnv *env, void **ctxt, SigContextType type);
/***********************************************************************
@ -331,7 +331,7 @@ JSS_PK11_wrapSigContextProxy(JNIEnv *env, void **ctxt, SigContextType type);
* RETURNS
* PR_SUCCESS for success, or PR_FAILURE if an exception was thrown.
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_PK11_getCipherContext(JNIEnv *env, jobject proxy, PK11Context **pContext);
@ -349,7 +349,7 @@ JSS_PK11_getCipherContext(JNIEnv *env, jobject proxy, PK11Context **pContext);
* RETURNS
* A new CipherContextProxy, or NULL if an exception was thrown.
*/
PR_EXTERN( jobject )
jobject
JSS_PK11_wrapCipherContextProxy(JNIEnv *env, PK11Context **context);
@ -375,7 +375,7 @@ JSS_PK11_wrapCipherContextProxy(JNIEnv *env, PK11Context **context);
* A session that can be used for cryptographic operations. If *owner
* is false, the session is not owned by the called but rather is shared.
*/
PR_EXTERN( CK_SESSION_HANDLE )
CK_SESSION_HANDLE
JSS_PK11_getNewSession(PK11SlotInfo *slot, PRBool *owner);
/***********************************************************************
@ -395,7 +395,7 @@ JSS_PK11_getNewSession(PK11SlotInfo *slot, PRBool *owner);
* created especially for the caller, PR_FALSE if it is the common
* shared session.
*/
PR_EXTERN( void )
void
JSS_PK11_closeSession(PK11SlotInfo *slot, CK_SESSION_HANDLE session,
PRBool owner);
@ -405,7 +405,7 @@ JSS_PK11_closeSession(PK11SlotInfo *slot, CK_SESSION_HANDLE session,
*
* Returns a simple error string for a given PKCS #11 error.
*/
PR_EXTERN( char* )
char*
JSS_PK11_getErrorString(CK_RV crv);

Просмотреть файл

@ -73,6 +73,7 @@ Java_org_mozilla_jss_ssl_SSLServerSocket_socketListen
}
finish:
return;
}
JNIEXPORT jbyteArray JNICALL
@ -255,4 +256,5 @@ Java_org_mozilla_jss_ssl_SSLServerSocket_setNeedClientAuth(
}
finish:
return;
}

Просмотреть файл

@ -35,6 +35,7 @@
#include <jni.h>
#include <ssl.h>
#include <sslerr.h>
#include <stdio.h>
#include <jssutil.h>
#include <jss_exceptions.h>
@ -43,6 +44,10 @@
#include "_jni/org_mozilla_jss_ssl_SSLSocket.h"
#include "jssl.h"
#ifdef WIN32
#include <winsock.h>
#endif
JNIEXPORT void JNICALL
Java_org_mozilla_jss_ssl_SSLSocket_setSSLOption(JNIEnv *env, jobject self,
jint joption, jint on)
@ -101,6 +106,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_forceHandshake(JNIEnv *env, jobject self)
}
finish:
return;
}
/*
@ -108,7 +114,7 @@ finish:
* The linger time, in hundredths of a second.
*/
JNIEXPORT void JNICALL
Java_org_mozilla_jss_ssl_SSLSocket_setSoLInger(JNIEnv *env, jobject self,
Java_org_mozilla_jss_ssl_SSLSocket_setSoLinger(JNIEnv *env, jobject self,
jboolean on, jint linger)
{
PRSocketOptionData sockOptions;
@ -134,6 +140,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_setSoLInger(JNIEnv *env, jobject self,
}
finish:
return;
}
JNIEXPORT jboolean JNICALL
@ -182,6 +189,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_setTcpNoDelay(JNIEnv *env, jobject self,
}
finish:
return;
}
JNIEXPORT jint JNICALL
@ -230,6 +238,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_setSendBufferSize(JNIEnv *env, jobject self,
}
finish:
return;
}
JNIEXPORT jboolean JNICALL
@ -302,6 +311,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_setReceiveBufferSize(
}
finish:
return;
}
JNIEXPORT void JNICALL
@ -327,6 +337,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_setKeepAlive(JNIEnv *env, jobject self,
}
finish:
return;
}
JNIEXPORT jint JNICALL
@ -644,6 +655,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_setCipherPreference(
}
finish:
return;
}
JNIEXPORT jint JNICALL
@ -710,7 +722,7 @@ finish:
}
JNIEXPORT jint JNICALL
Java_com_netscape_jss_ssl_SSLSocketImpl_socketAvailable(
Java_org_mozilla_jss_ssl_SSLSocket_socketAvailable(
JNIEnv *env, jobject self)
{
jint available;
@ -807,6 +819,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_shutdownNative(
}
finish:
return;
}
JNIEXPORT void JNICALL
@ -824,6 +837,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_invalidateSession(JNIEnv *env, jobject self)
}
finish:
return;
}
JNIEXPORT void JNICALL
@ -842,10 +856,11 @@ Java_org_mozilla_jss_ssl_SSLSocket_redoHandshake(
}
finish:
return;
}
JNIEXPORT void JNICALL
Java_org_mozilla_jss_ssl_SSLSocket_resetHandshake(
Java_org_mozilla_jss_ssl_SSLSocket_resetHandshakeNative(
JNIEnv *env, jobject self, jboolean asClient)
{
JSSL_SocketData *sock;
@ -860,6 +875,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_resetHandshake(
}
finish:
return;
}
JNIEXPORT void JNICALL
@ -934,4 +950,5 @@ Java_org_mozilla_jss_ssl_SSLSocket_setCipherPolicyNative(
}
finish:
return;
}

Просмотреть файл

@ -123,7 +123,7 @@ done:
* -1 SECFailure - No suitable certificate found.
* -2 SECWouldBlock (we're waiting while we ask the user).
*/
PR_IMPLEMENT( int )
int
JSSL_CallCertSelectionCallback( void * arg,
PRFileDesc * fd,
CERTDistNames * caNames,
@ -291,7 +291,7 @@ loser:
}
PR_IMPLEMENT(void)
void
JSSL_HandshakeCallback(PRFileDesc *fd, void *arg)
{
JSSL_SocketData *sock = (JSSL_SocketData*) arg;
@ -319,13 +319,14 @@ JSSL_HandshakeCallback(PRFileDesc *fd, void *arg)
(*env)->CallVoidMethod(env, sock->socketObject, notifierID);
finish:
return;
}
/*
* Callback from SSL for checking certificate the peer (other end of
* the socket) presents.
*/
PR_IMPLEMENT(int)
int
JSSL_DefaultCertAuthCallback(void *arg, PRFileDesc *fd, PRBool checkSig,
PRBool isServer)
{
@ -432,7 +433,7 @@ addToVerifyLog(JNIEnv *env, CERTVerifyLog *log, CERTCertificate *cert,
* obj - a jobject -> instance of a class implementing
* the SSLCertificateApprovalCallback interface
*/
PR_IMPLEMENT(SECStatus)
SECStatus
JSSL_JavaCertAuthCallback(void *arg, PRFileDesc *fd, PRBool checkSig,
PRBool isServer)
{
@ -607,7 +608,7 @@ finish:
return retval;
}
PR_IMPLEMENT( int )
int
JSSL_GetClientAuthData( void * arg,
PRFileDesc * fd,
CERTDistNames * caNames,
@ -647,7 +648,7 @@ JSSL_GetClientAuthData( void * arg,
* Callback from SSL for checking a (possibly) expired
* certificate the peer presents.
*/
PR_IMPLEMENT( int )
int
JSSL_ConfirmExpiredPeerCert(void *arg, PRFileDesc *fd, PRBool checkSig,
PRBool isServer)
{

Просмотреть файл

@ -43,6 +43,10 @@
#include "_jni/org_mozilla_jss_ssl_SSLSocket.h"
#include "jssl.h"
#ifdef WIN32
#include <winsock.h>
#endif
/*
* This is done for regular sockets that we connect() and server sockets,
* but not for sockets that come from accept.
@ -296,6 +300,7 @@ JSSL_socketClose(JNIEnv *env, jobject self)
JSSL_DestroySocketData(env, sock);
finish:
return;
}
void
@ -330,4 +335,5 @@ JSSL_setNeedClientAuthNoExpiryCheck(JNIEnv *env, jobject self, jboolean b)
}
finish:
return;
}

Просмотреть файл

@ -56,7 +56,7 @@
* return; // exception was thrown!
* }
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr)
{
jclass nativeProxyClass;
@ -106,7 +106,7 @@ JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr)
* Returns a byte array containing the pointer, or NULL if an exception
* was thrown.
*/
PR_IMPLEMENT( jbyteArray )
jbyteArray
JSS_ptrToByteArray(JNIEnv *env, void *ptr)
{
jbyteArray byteArray;

Просмотреть файл

@ -58,7 +58,7 @@ PR_BEGIN_EXTERN_C
* return; // exception was thrown!
* }
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr);
/*
@ -68,7 +68,7 @@ JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr);
* Returns a byte array containing the pointer, or NULL if an exception
* was thrown.
*/
PR_EXTERN( jbyteArray )
jbyteArray
JSS_ptrToByteArray(JNIEnv *env, void *ptr);
PR_END_EXTERN_C

Просмотреть файл

@ -50,7 +50,7 @@ PR_BEGIN_EXTERN_C
* representation of an integer as a big-endian Java byte array. Prepends
* a zero byte to force it to be positive.
*/
PR_IMPLEMENT( jbyteArray )
jbyteArray
JSS_OctetStringToByteArray(JNIEnv *env, SECItem *item);
/***********************************************************************
@ -71,7 +71,7 @@ JSS_OctetStringToByteArray(JNIEnv *env, SECItem *item);
* PR_SUCCESS if the operation was successful, PR_FAILURE if an exception
* was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_ByteArrayToOctetString(JNIEnv *env, jbyteArray byteArray, SECItem *item);
PR_END_EXTERN_C

Просмотреть файл

@ -61,7 +61,7 @@
** "Bogus argument, you ninny");
** return -1;
*/
PR_IMPLEMENT( void )
void
JSS_throwMsg(JNIEnv *env, char *throwableClassName, char *message) {
jclass throwableClass;
@ -100,7 +100,7 @@ JSS_throwMsg(JNIEnv *env, char *throwableClassName, char *message) {
** JSS_throw(env, ILLEGAL_ARGUMENT_EXCEPTION);
** return -1;
*/
PR_IMPLEMENT( void )
void
JSS_throw(JNIEnv *env, char *throwableClassName)
{
jclass throwableClass;
@ -169,7 +169,7 @@ JSS_throw(JNIEnv *env, char *throwableClassName)
** return; // exception was thrown!
** }
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr)
{
jclass nativeProxyClass;
@ -251,7 +251,7 @@ JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr)
** return; // exception was thrown!
** }
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_getPtrFromProxyOwner(JNIEnv *env, jobject proxyOwner, char* proxyFieldName,
char *proxyFieldSig, void **ptr)
{
@ -291,7 +291,7 @@ JSS_getPtrFromProxyOwner(JNIEnv *env, jobject proxyOwner, char* proxyFieldName,
** Returns a byte array containing the pointer, or NULL if an exception
** was thrown.
*/
PR_IMPLEMENT( jbyteArray )
jbyteArray
JSS_ptrToByteArray(JNIEnv *env, void *ptr)
{
jbyteArray byteArray;
@ -323,7 +323,7 @@ JSS_ptrToByteArray(JNIEnv *env, void *ptr)
* occurred.
*
*/
PR_IMPLEMENT( jbyteArray )
jbyteArray
JSS_OctetStringToByteArray(JNIEnv *env, SECItem *item)
{
jbyteArray array;
@ -378,7 +378,7 @@ JSS_OctetStringToByteArray(JNIEnv *env, SECItem *item)
* PR_SUCCESS if the operation was successful, PR_FAILURE if an exception
* was thrown.
*/
PR_IMPLEMENT( PRStatus )
PRStatus
JSS_ByteArrayToOctetString(JNIEnv *env, jbyteArray byteArray, SECItem *item)
{
jbyte *bytes=NULL;
@ -425,7 +425,7 @@ finish:
*
* Given a string, set it to all zeroes. Be a chum and don't pass in NULL.
*/
PR_IMPLEMENT( void )
void
JSS_wipeCharArray(char* array)
{
PR_ASSERT(array != NULL);
@ -663,7 +663,7 @@ static int debugLevel = JSS_TRACE_ERROR;
* mesg
* The trace message. Must not be NULL.
*/
PR_IMPLEMENT( void )
void
JSS_trace(JNIEnv *env, jint level, char *mesg)
{
PR_ASSERT(env!=NULL && mesg!=NULL);
@ -683,7 +683,7 @@ JSS_trace(JNIEnv *env, jint level, char *mesg)
* PR_ASSERT that it is due to an OutOfMemory condition. It takes a JNIEnv*,
* which better not be NULL.
*/
PR_IMPLEMENT( void )
void
JSS_assertOutOfMem(JNIEnv *env)
{
jclass memErrClass;
@ -730,7 +730,7 @@ Java_org_mozilla_jss_util_Debug_setNativeLevel
* A Java byte array. NULL will be returned if an exception was
* thrown.
*/
PR_IMPLEMENT( jbyteArray )
jbyteArray
JSS_SECItemToByteArray(JNIEnv *env, SECItem *item)
{
jbyteArray array=NULL;
@ -771,7 +771,7 @@ finish:
* RETURNS
* A newly allocated SECItem, or NULL iff an exception was thrown.
*/
PR_IMPLEMENT( SECItem* )
SECItem*
JSS_ByteArrayToSECItem(JNIEnv *env, jbyteArray byteArray)
{
SECItem *item = NULL;

Просмотреть файл

@ -43,11 +43,11 @@ PR_BEGIN_EXTERN_C
/**** NSPR private thread functions ****/
/*
PR_EXTERN(PRThread*) PR_AttachThread(PRThreadType type,
PRThread* PR_AttachThread(PRThreadType type,
PRThreadPriority priority,
PRThreadStack *stack);
PR_EXTERN(void) PR_DetachThread(void);
void PR_DetachThread(void);
*/
#define PR_AttachThread(a, b, c) ((PRThread*)1)
#define PR_DetachThread()
@ -72,7 +72,7 @@ extern JavaVM *JSS_javaVM;
* "Bogus argument, you ninny");
* return -1;
*/
PR_EXTERN( void )
void
JSS_throwMsg(JNIEnv *env, char *throwableClassName, char *message);
#define JSS_nativeThrowMsg JSS_throwMsg
@ -91,7 +91,7 @@ JSS_throwMsg(JNIEnv *env, char *throwableClassName, char *message);
* JSS_nativeThrow(env, "java/lang/IllegalArgumentException");
* return -1;
*/
PR_EXTERN( void )
void
JSS_throw(JNIEnv *env, char *throwableClassName);
#define JSS_nativeThrow JSS_throw
@ -105,7 +105,7 @@ JSS_throw(JNIEnv *env, char *throwableClassName);
* PR_ASSERT that it is due to an OutOfMemory condition. It takes a JNIEnv*,
* which better not be NULL.
*/
PR_EXTERN( void )
void
JSS_assertOutOfMem(JNIEnv *env);
#ifdef DEBUG
@ -135,7 +135,7 @@ JSS_assertOutOfMem(JNIEnv *env);
** return; // exception was thrown!
** }
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr);
/***********************************************************************
@ -168,7 +168,7 @@ JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr);
** return; // exception was thrown!
** }
*/
PR_EXTERN( PRStatus )
PRStatus
JSS_getPtrFromProxyOwner(JNIEnv *env, jobject proxyOwner, char* proxyFieldName,
char *proxyFieldSig, void **ptr);
@ -179,7 +179,7 @@ JSS_getPtrFromProxyOwner(JNIEnv *env, jobject proxyOwner, char* proxyFieldName,
* Returns a byte array containing the pointer, or NULL if an exception
* was thrown.
*/
PR_EXTERN( jbyteArray )
jbyteArray
JSS_ptrToByteArray(JNIEnv *env, void *ptr);
/************************************************************************
@ -188,7 +188,7 @@ JSS_ptrToByteArray(JNIEnv *env, void *ptr);
*
* Given a string, set it to all zeroes. Don't pass in NULL.
*/
PR_EXTERN( void )
void
JSS_wipeCharArray(char* array);
/**********************************************************************
@ -203,7 +203,7 @@ JSS_wipeCharArray(char* array);
* mesg
* The trace message. Must not be NULL.
*/
PR_EXTERN( void )
void
JSS_trace(JNIEnv *env, jint level, char *mesg);
/* trace levels */
@ -222,7 +222,7 @@ JSS_trace(JNIEnv *env, jint level, char *mesg);
* A Java byte array. NULL will be returned if an exception was
* thrown.
*/
PR_EXTERN( jbyteArray )
jbyteArray
JSS_SECItemToByteArray(JNIEnv *env, SECItem *item);
/***********************************************************************
@ -235,7 +235,7 @@ JSS_SECItemToByteArray(JNIEnv *env, SECItem *item);
* RETURNS
* A newly allocated SECItem, or NULL iff an exception was thrown.
*/
PR_EXTERN( SECItem* )
SECItem*
JSS_ByteArrayToSECItem(JNIEnv *env, jbyteArray byteArray);
PR_END_EXTERN_C