Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
sslsock.c File Reference
#include "seccomon.h"
#include "cert.h"
#include "keyhi.h"
#include "ssl.h"
#include "sslimpl.h"
#include "sslproto.h"
#include "nspr.h"
#include "private/pprio.h"
#include "blapi.h"
#include "nss.h"

Go to the source code of this file.

Classes

struct  cipherPolicyStr

Defines

#define SET_ERROR_CODE   /* reminder */
#define LOCKSTATUS_OFFSET   10 /* offset of ENABLED */
#define fs   ss
#define PR_POLL_RW   (PR_POLL_WRITE | PR_POLL_READ)
#define K16   sizeof(buf)
#define KILL_VECTORS   while (vectors && !iov->iov_len) { ++iov; --vectors; }
#define GET_VECTOR   do { myIov = *iov++; --vectors; KILL_VECTORS } while (0)
#define HANDLE_ERR(rv, len)
#define SEND(bfr, len)

Typedefs

typedef struct cipherPolicyStr

Functions

static sslSocket * ssl_NewSocket (PRBool makeLocks)
static SECStatus ssl_MakeLocks (sslSocket *ss)
static PRStatus ssl_PushIOLayer (sslSocket *ns, PRFileDesc *stack, PRDescIdentity id)
static sslSocket * ssl_GetPrivate (PRFileDesc *fd)
sslSocket * ssl_FindSocket (PRFileDesc *fd)
sslSocket * ssl_DupSocket (sslSocket *os)
static void ssl_DestroyLocks (sslSocket *ss)
static void ssl_DestroySocketContents (sslSocket *ss)
void ssl_FreeSocket (sslSocket *ss)
SECStatus ssl_EnableNagleDelay (sslSocket *ss, PRBool enabled)
static void ssl_ChooseOps (sslSocket *ss)
static SECStatus PrepareSocket (sslSocket *ss)
SECStatus SSL_Enable (PRFileDesc *fd, int which, PRBool on)
static SECStatus SSL_BypassShutdown (void *appData, void *nssData)
static PRStatus SSL_BypassRegisterShutdown (void)
static PRStatus SSL_BypassSetup (void)
SECStatus SSL_OptionSet (PRFileDesc *fd, PRInt32 which, PRBool on)
SECStatus SSL_OptionGet (PRFileDesc *fd, PRInt32 which, PRBool *pOn)
SECStatus SSL_OptionGetDefault (PRInt32 which, PRBool *pOn)
SECStatus SSL_EnableDefault (int which, PRBool on)
SECStatus SSL_OptionSetDefault (PRInt32 which, PRBool on)
static PRBool ssl_IsRemovedCipherSuite (PRInt32 suite)
SECStatus SSL_SetPolicy (long which, int policy)
SECStatus SSL_CipherPolicySet (PRInt32 which, PRInt32 policy)
SECStatus SSL_CipherPolicyGet (PRInt32 which, PRInt32 *oPolicy)
SECStatus SSL_EnableCipher (long which, PRBool enabled)
SECStatus SSL_CipherPrefSetDefault (PRInt32 which, PRBool enabled)
SECStatus SSL_CipherPrefGetDefault (PRInt32 which, PRBool *enabled)
SECStatus SSL_CipherPrefSet (PRFileDesc *fd, PRInt32 which, PRBool enabled)
SECStatus SSL_CipherPrefGet (PRFileDesc *fd, PRInt32 which, PRBool *enabled)
SECStatus NSS_SetDomesticPolicy (void)
SECStatus NSS_SetExportPolicy (void)
SECStatus NSS_SetFrancePolicy (void)
PRFileDescSSL_ImportFD (PRFileDesc *model, PRFileDesc *fd)
static PRFileDesc *PR_CALLBACK ssl_Accept (PRFileDesc *fd, PRNetAddr *sockaddr, PRIntervalTime timeout)
static PRStatus PR_CALLBACK ssl_Connect (PRFileDesc *fd, const PRNetAddr *sockaddr, PRIntervalTime timeout)
static PRStatus PR_CALLBACK ssl_Bind (PRFileDesc *fd, const PRNetAddr *addr)
static PRStatus PR_CALLBACK ssl_Listen (PRFileDesc *fd, PRIntn backlog)
static PRStatus PR_CALLBACK ssl_Shutdown (PRFileDesc *fd, PRIntn how)
static PRStatus PR_CALLBACK ssl_Close (PRFileDesc *fd)
static int PR_CALLBACK ssl_Recv (PRFileDesc *fd, void *buf, PRInt32 len, PRIntn flags, PRIntervalTime timeout)
static int PR_CALLBACK ssl_Send (PRFileDesc *fd, const void *buf, PRInt32 len, PRIntn flags, PRIntervalTime timeout)
static int PR_CALLBACK ssl_Read (PRFileDesc *fd, void *buf, PRInt32 len)
static int PR_CALLBACK ssl_Write (PRFileDesc *fd, const void *buf, PRInt32 len)
static PRStatus PR_CALLBACK ssl_GetPeerName (PRFileDesc *fd, PRNetAddr *addr)
SECStatus ssl_GetPeerInfo (sslSocket *ss)
static PRStatus PR_CALLBACK ssl_GetSockName (PRFileDesc *fd, PRNetAddr *name)
SECStatus PR_CALLBACK SSL_SetSockPeerID (PRFileDesc *fd, char *peerID)
static PRInt16 PR_CALLBACK ssl_Poll (PRFileDesc *fd, PRInt16 how_flags, PRInt16 *p_out_flags)
static PRInt32 PR_CALLBACK ssl_TransmitFile (PRFileDesc *sd, PRFileDesc *fd, const void *headers, PRInt32 hlen, PRTransmitFileFlags flags, PRIntervalTime timeout)
PRBool ssl_FdIsBlocking (PRFileDesc *fd)
PRBool ssl_SocketIsBlocking (sslSocket *ss)
static PRInt32 PR_CALLBACK ssl_WriteV (PRFileDesc *fd, const PRIOVec *iov, PRInt32 vectors, PRIntervalTime timeout)
static PRInt32 PR_CALLBACK ssl_Available (PRFileDesc *fd)
static PRInt64 PR_CALLBACK ssl_Available64 (PRFileDesc *fd)
static PRStatus PR_CALLBACK ssl_FSync (PRFileDesc *fd)
static PRInt32 PR_CALLBACK ssl_Seek (PRFileDesc *fd, PRInt32 offset, PRSeekWhence how)
static PRInt64 PR_CALLBACK ssl_Seek64 (PRFileDesc *fd, PRInt64 offset, PRSeekWhence how)
static PRStatus PR_CALLBACK ssl_FileInfo (PRFileDesc *fd, PRFileInfo *info)
static PRStatus PR_CALLBACK ssl_FileInfo64 (PRFileDesc *fd, PRFileInfo64 *info)
static PRInt32 PR_CALLBACK ssl_RecvFrom (PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout)
static PRInt32 PR_CALLBACK ssl_SendTo (PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, const PRNetAddr *addr, PRIntervalTime timeout)
static void ssl_SetupIOMethods (void)
static PRStatus ssl_InitIOLayer (void)

Variables

static cipherPolicy ssl_ciphers []
static const sslSocketOps ssl_default_ops
static const sslSocketOps ssl_secure_ops
static sslOptions ssl_defaults
sslSessionIDLookupFunc ssl_sid_lookup
sslSessionIDCacheFunc ssl_sid_cache
sslSessionIDUncacheFunc ssl_sid_uncache
static PRBool ssl_inited = PR_FALSE
static PRDescIdentity ssl_layer_id
PRBool locksEverDisabled
PRBool ssl_force_locks
int ssl_lock_readers = 1
char ssl_debug
char ssl_trace
FILEssl_trace_iob
char lockStatus [] = "Locks are ENABLED. "
static const PRCallOnceType pristineCallOnce
static PRCallOnceType setupBypassOnce
PRInt32 sslFirstBufSize = 8 * 1024
PRInt32 sslCopyLimit = 1024
static const PRIOMethods ssl_methods
static PRIOMethods combined_methods
static PRCallOnceType initIoLayerOnce

Class Documentation

struct cipherPolicyStr

Definition at line 57 of file sslsock.c.

Collaboration diagram for cipherPolicyStr:
Class Members
int cipher
unsigned char export
unsigned char france

Define Documentation

Definition at line 1551 of file jsapi.h.

#define GET_VECTOR   do { myIov = *iov++; --vectors; KILL_VECTORS } while (0)
#define HANDLE_ERR (   rv,
  len 
)
Value:
if (rv != len) { \
       if (rv < 0) { \
           if (!blocking \
              && (PR_GetError() == PR_WOULD_BLOCK_ERROR) \
              && (sent > 0)) { \
              return sent; \
           } else { \
              return -1; \
           } \
       } \
       /* Only a nonblocking socket can have partial sends */ \
       PR_ASSERT(!blocking); \
       return sent + rv; \
    }
#define K16   sizeof(buf)
#define KILL_VECTORS   while (vectors && !iov->iov_len) { ++iov; --vectors; }
#define LOCKSTATUS_OFFSET   10 /* offset of ENABLED */

Definition at line 191 of file sslsock.c.

Definition at line 1543 of file sslsock.c.

#define SEND (   bfr,
  len 
)
Value:
do { \
       rv = ssl_Send(fd, bfr, len, 0, timeout); \
       HANDLE_ERR(rv, len) \
       sent += len; \
    } while (0)
#define SET_ERROR_CODE   /* reminder */

Definition at line 55 of file sslsock.c.


Typedef Documentation

typedef struct cipherPolicyStr

Definition at line 63 of file sslsock.c.


Function Documentation

Definition at line 1104 of file sslsock.c.

{
#ifndef EXPORT_VERSION
    SECStatus      status = SECSuccess;
    cipherPolicy * policy;

    for (policy = ssl_ciphers; policy->cipher != 0; ++policy) {
       status = SSL_SetPolicy(policy->cipher, SSL_ALLOWED);
       if (status != SECSuccess)
           break;
    }
    return status;
#else
    return NSS_SetExportPolicy();
#endif
}

Definition at line 1122 of file sslsock.c.

{
    SECStatus      status = SECSuccess;
    cipherPolicy * policy;

    for (policy = ssl_ciphers; policy->cipher != 0; ++policy) {
       status = SSL_SetPolicy(policy->cipher, policy->export);
       if (status != SECSuccess)
           break;
    }
    return status;
}

Definition at line 1136 of file sslsock.c.

{
    SECStatus      status = SECSuccess;
    cipherPolicy * policy;

    for (policy = ssl_ciphers; policy->cipher != 0; ++policy) {
       status = SSL_SetPolicy(policy->cipher, policy->france);
       if (status != SECSuccess)
           break;
    }
    return status;
}
static SECStatus PrepareSocket ( sslSocket *  ss) [static]

Definition at line 504 of file sslsock.c.

{
    SECStatus     rv = SECSuccess;

    ssl_ChooseOps(ss);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRFileDesc* PR_CALLBACK ssl_Accept ( PRFileDesc fd,
PRNetAddr sockaddr,
PRIntervalTime  timeout 
) [static]

Definition at line 1196 of file sslsock.c.

{
    sslSocket  *ss;
    sslSocket  *ns   = NULL;
    PRFileDesc *newfd       = NULL;
    PRFileDesc *osfd;
    PRStatus    status;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in accept", SSL_GETPID(), fd));
       return NULL;
    }

    /* IF this is a listen socket, there shouldn't be any I/O going on */
    SSL_LOCK_READER(ss);
    SSL_LOCK_WRITER(ss);
    ssl_Get1stHandshakeLock(ss);
    ssl_GetSSL3HandshakeLock(ss);

    ss->cTimeout = timeout;

    osfd = ss->fd->lower;

    /* First accept connection */
    newfd = osfd->methods->accept(osfd, sockaddr, timeout);
    if (newfd == NULL) {
       SSL_DBG(("%d: SSL[%d]: accept failed, errno=%d",
               SSL_GETPID(), ss->fd, PORT_GetError()));
    } else {
       /* Create ssl module */
       ns = ssl_DupSocket(ss);
    }

    ssl_ReleaseSSL3HandshakeLock(ss);
    ssl_Release1stHandshakeLock(ss);
    SSL_UNLOCK_WRITER(ss);
    SSL_UNLOCK_READER(ss);                /* ss isn't used below here. */

    if (ns == NULL)
       goto loser;

    /* push ssl module onto the new socket */
    status = ssl_PushIOLayer(ns, newfd, PR_TOP_IO_LAYER);
    if (status != PR_SUCCESS)
       goto loser;

    /* Now start server connection handshake with client.
    ** Don't need locks here because nobody else has a reference to ns yet.
    */
    if ( ns->opt.useSecurity ) {
       if ( ns->opt.handshakeAsClient ) {
           ns->handshake = ssl2_BeginClientHandshake;
           ss->handshaking = sslHandshakingAsClient;
       } else {
           ns->handshake = ssl2_BeginServerHandshake;
           ss->handshaking = sslHandshakingAsServer;
       }
    }
    ns->TCPconnected = 1;
    return newfd;

loser:
    if (ns != NULL)
       ssl_FreeSocket(ns);
    if (newfd != NULL)
       PR_Close(newfd);
    return NULL;
}

Here is the call graph for this function:

static PRInt32 PR_CALLBACK ssl_Available ( PRFileDesc fd) [static]

Definition at line 1806 of file sslsock.c.

{
    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return SECFailure;
}
static PRInt64 PR_CALLBACK ssl_Available64 ( PRFileDesc fd) [static]

Definition at line 1814 of file sslsock.c.

{
    PRInt64 res;

    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    LL_I2L(res, -1L);
    return res;
}
static PRStatus PR_CALLBACK ssl_Bind ( PRFileDesc fd,
const PRNetAddr addr 
) [static]

Definition at line 1295 of file sslsock.c.

{
    sslSocket * ss = ssl_GetPrivate(fd);
    PRStatus    rv;

    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in bind", SSL_GETPID(), fd));
       return PR_FAILURE;
    }
    SSL_LOCK_READER(ss);
    SSL_LOCK_WRITER(ss);

    rv = (PRStatus)(*ss->ops->bind)(ss, addr);

    SSL_UNLOCK_WRITER(ss);
    SSL_UNLOCK_READER(ss);
    return rv;
}

Here is the call graph for this function:

static PRStatus SSL_BypassRegisterShutdown ( void  ) [static]

Definition at line 529 of file sslsock.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static PRStatus SSL_BypassSetup ( void  ) [static]

Definition at line 536 of file sslsock.c.

{
    return PR_CallOnce(&setupBypassOnce, &SSL_BypassRegisterShutdown);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static SECStatus SSL_BypassShutdown ( void appData,
void nssData 
) [static]

Definition at line 521 of file sslsock.c.

{
    /* unload freeBL shared library from memory */
    BL_Unload();
    setupBypassOnce = pristineCallOnce;
    return SECSuccess;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ssl_ChooseOps ( sslSocket *  ss) [static]

Definition at line 497 of file sslsock.c.

{
    ss->ops = ss->opt.useSecurity ? &ssl_secure_ops : &ssl_default_ops;
}

Here is the caller graph for this function:

SECStatus SSL_CipherPolicyGet ( PRInt32  which,
PRInt32 oPolicy 
)

Definition at line 975 of file sslsock.c.

{
    SECStatus rv;

    if (!oPolicy) {
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       return SECFailure;
    }
    if (ssl_IsRemovedCipherSuite(which)) {
       *oPolicy = SSL_NOT_ALLOWED;
       rv = SECSuccess;
    } else if (SSL_IS_SSL2_CIPHER(which)) {
       rv = ssl2_GetPolicy(which, oPolicy);
    } else {
       rv = ssl3_GetPolicy((ssl3CipherSuite)which, oPolicy);
    }
    return rv;
}
SECStatus SSL_CipherPolicySet ( PRInt32  which,
PRInt32  policy 
)

Definition at line 960 of file sslsock.c.

{
    SECStatus rv;

    if (ssl_IsRemovedCipherSuite(which)) {
       rv = SECSuccess;
    } else if (SSL_IS_SSL2_CIPHER(which)) {
       rv = ssl2_SetPolicy(which, policy);
    } else {
       rv = ssl3_SetPolicy((ssl3CipherSuite)which, policy);
    }
    return rv;
}
SECStatus SSL_CipherPrefGet ( PRFileDesc fd,
PRInt32  which,
PRBool enabled 
)

Definition at line 1078 of file sslsock.c.

{
    SECStatus  rv;
    sslSocket *ss = ssl_FindSocket(fd);
    
    if (!enabled) {
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       return SECFailure;
    }
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in CipherPrefGet", SSL_GETPID(), fd));
       *enabled = PR_FALSE;
       return SECFailure;
    }
    if (ssl_IsRemovedCipherSuite(which)) {
       *enabled = PR_FALSE;
       rv = SECSuccess;
    } else if (SSL_IS_SSL2_CIPHER(which)) {
       rv = ssl2_CipherPrefGet(ss, which, enabled);
    } else {
       rv = ssl3_CipherPrefGet(ss, (ssl3CipherSuite)which, enabled);
    }
    return rv;
}
SECStatus SSL_CipherPrefGetDefault ( PRInt32  which,
PRBool enabled 
)

Definition at line 1034 of file sslsock.c.

{
    SECStatus  rv;
    
    if (!enabled) {
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       return SECFailure;
    }
    if (ssl_IsRemovedCipherSuite(which)) {
       *enabled = PR_FALSE;
       rv = SECSuccess;
    } else if (SSL_IS_SSL2_CIPHER(which)) {
       rv = ssl2_CipherPrefGetDefault(which, enabled);
    } else {
       rv = ssl3_CipherPrefGetDefault((ssl3CipherSuite)which, enabled);
    }
    return rv;
}
SECStatus SSL_CipherPrefSet ( PRFileDesc fd,
PRInt32  which,
PRBool  enabled 
)

Definition at line 1054 of file sslsock.c.

{
    SECStatus rv;
    sslSocket *ss = ssl_FindSocket(fd);
    
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in CipherPrefSet", SSL_GETPID(), fd));
       return SECFailure;
    }
    if (ssl_IsRemovedCipherSuite(which))
       return SECSuccess;
    if (enabled && ss->opt.noStepDown && SSL_IsExportCipherSuite(which)) {
       PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);
       return SECFailure;
    }
    if (SSL_IS_SSL2_CIPHER(which)) {
       rv = ssl2_CipherPrefSet(ss, which, enabled);
    } else {
       rv = ssl3_CipherPrefSet(ss, (ssl3CipherSuite)which, enabled);
    }
    return rv;
}
static PRStatus PR_CALLBACK ssl_Close ( PRFileDesc fd) [static]

Definition at line 1363 of file sslsock.c.

{
    sslSocket *ss;
    PRStatus   rv;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in close", SSL_GETPID(), fd));
       return PR_FAILURE;
    }

    /* There must not be any I/O going on */
    SSL_LOCK_READER(ss);
    SSL_LOCK_WRITER(ss);

    /* By the time this function returns, 
    ** ss is an invalid pointer, and the locks to which it points have 
    ** been unlocked and freed.  So, this is the ONE PLACE in all of SSL
    ** where the LOCK calls and the corresponding UNLOCK calls are not in
    ** the same function scope.  The unlock calls are in ssl_FreeSocket().
    */
    rv = (PRStatus)(*ss->ops->close)(ss);

    return rv;
}

Here is the call graph for this function:

static PRStatus PR_CALLBACK ssl_Connect ( PRFileDesc fd,
const PRNetAddr sockaddr,
PRIntervalTime  timeout 
) [static]

Definition at line 1267 of file sslsock.c.

{
    sslSocket *ss;
    PRStatus   rv;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in connect", SSL_GETPID(), fd));
       return PR_FAILURE;
    }

    /* IF this is a listen socket, there shouldn't be any I/O going on */
    SSL_LOCK_READER(ss);
    SSL_LOCK_WRITER(ss);

    ss->cTimeout = timeout;
    rv = (PRStatus)(*ss->ops->connect)(ss, sockaddr);
#ifdef _WIN32
    PR_Sleep(PR_INTERVAL_NO_WAIT);     /* workaround NT winsock connect bug. */
#endif

    SSL_UNLOCK_WRITER(ss);
    SSL_UNLOCK_READER(ss);

    return rv;
}

Here is the call graph for this function:

static void ssl_DestroyLocks ( sslSocket *  ss) [static]

Definition at line 346 of file sslsock.c.

{
    /* Destroy locks. */
    if (ss->firstHandshakeLock) {
       PZ_DestroyMonitor(ss->firstHandshakeLock);
       ss->firstHandshakeLock = NULL;
    }
    if (ss->ssl3HandshakeLock) {
       PZ_DestroyMonitor(ss->ssl3HandshakeLock);
       ss->ssl3HandshakeLock = NULL;
    }
    if (ss->specLock) {
       NSSRWLock_Destroy(ss->specLock);
       ss->specLock = NULL;
    }

    if (ss->recvLock) {
       PZ_DestroyLock(ss->recvLock);
       ss->recvLock = NULL;
    }
    if (ss->sendLock) {
       PZ_DestroyLock(ss->sendLock);
       ss->sendLock = NULL;
    }
    if (ss->xmitBufLock) {
       PZ_DestroyMonitor(ss->xmitBufLock);
       ss->xmitBufLock = NULL;
    }
    if (ss->recvBufLock) {
       PZ_DestroyMonitor(ss->recvBufLock);
       ss->recvBufLock = NULL;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ssl_DestroySocketContents ( sslSocket *  ss) [static]

Definition at line 382 of file sslsock.c.

{
    /* "i" should be of type SSLKEAType, but CC on IRIX complains during
     * the for loop.
     */
    int        i;

    /* Free up socket */
    ssl_DestroySecurityInfo(&ss->sec);

    ssl3_DestroySSL3Info(ss);

    PORT_Free(ss->saveBuf.buf);
    PORT_Free(ss->pendingBuf.buf);
    ssl_DestroyGather(&ss->gs);

    if (ss->peerID != NULL)
       PORT_Free(ss->peerID);
    if (ss->url != NULL)
       PORT_Free((void *)ss->url); /* CONST */
    if (ss->cipherSpecs) {
       PORT_Free(ss->cipherSpecs);
       ss->cipherSpecs     = NULL;
       ss->sizeCipherSpecs = 0;
    }

    /* Clean up server configuration */
    for (i=kt_null; i < kt_kea_size; i++) {
       sslServerCerts * sc = ss->serverCerts + i;
       if (sc->serverCert != NULL)
           CERT_DestroyCertificate(sc->serverCert);
       if (sc->serverCertChain != NULL)
           CERT_DestroyCertificateList(sc->serverCertChain);
       if (sc->serverKeyPair != NULL)
           ssl3_FreeKeyPair(sc->serverKeyPair);
    }
    if (ss->stepDownKeyPair) {
       ssl3_FreeKeyPair(ss->stepDownKeyPair);
       ss->stepDownKeyPair = NULL;
    }
    if (ss->ephemeralECDHKeyPair) {
       ssl3_FreeKeyPair(ss->ephemeralECDHKeyPair);
       ss->ephemeralECDHKeyPair = NULL;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

sslSocket* ssl_DupSocket ( sslSocket *  os)

Definition at line 252 of file sslsock.c.

{
    sslSocket *ss;
    SECStatus rv;

    ss = ssl_NewSocket((PRBool)(!os->opt.noLocks));
    if (ss) {
       ss->opt                = os->opt;
       ss->opt.useSocks       = PR_FALSE;

       ss->peerID             = !os->peerID ? NULL : PORT_Strdup(os->peerID);
       ss->url                = !os->url    ? NULL : PORT_Strdup(os->url);

       ss->ops      = os->ops;
       ss->rTimeout = os->rTimeout;
       ss->wTimeout = os->wTimeout;
       ss->cTimeout = os->cTimeout;
       ss->dbHandle = os->dbHandle;

       /* copy ssl2&3 policy & prefs, even if it's not selected (yet) */
       ss->allowedByPolicy  = os->allowedByPolicy;
       ss->maybeAllowedByPolicy= os->maybeAllowedByPolicy;
       ss->chosenPreference        = os->chosenPreference;
       PORT_Memcpy(ss->cipherSuites, os->cipherSuites, sizeof os->cipherSuites);

       if (os->cipherSpecs) {
           ss->cipherSpecs  = (unsigned char*)PORT_Alloc(os->sizeCipherSpecs);
           if (ss->cipherSpecs) 
              PORT_Memcpy(ss->cipherSpecs, os->cipherSpecs, 
                          os->sizeCipherSpecs);
           ss->sizeCipherSpecs    = os->sizeCipherSpecs;
           ss->preferredCipher    = os->preferredCipher;
       } else {
           ss->cipherSpecs        = NULL;  /* produced lazily */
           ss->sizeCipherSpecs    = 0;
           ss->preferredCipher    = NULL;
       }
       if (ss->opt.useSecurity) {
           /* This int should be SSLKEAType, but CC on Irix complains,
            * during the for loop.
            */
           int i;
           sslServerCerts * oc = os->serverCerts;
           sslServerCerts * sc = ss->serverCerts;

           for (i=kt_null; i < kt_kea_size; i++, oc++, sc++) {
              if (oc->serverCert && oc->serverCertChain) {
                  sc->serverCert      = CERT_DupCertificate(oc->serverCert);
                  sc->serverCertChain = CERT_DupCertList(oc->serverCertChain);
                  if (!sc->serverCertChain) 
                     goto loser;
              } else {
                  sc->serverCert      = NULL;
                  sc->serverCertChain = NULL;
              }
              sc->serverKeyPair = oc->serverKeyPair ?
                            ssl3_GetKeyPairRef(oc->serverKeyPair) : NULL;
              if (oc->serverKeyPair && !sc->serverKeyPair)
                  goto loser;
               sc->serverKeyBits = oc->serverKeyBits;
           }
           ss->stepDownKeyPair = !os->stepDownKeyPair ? NULL :
                                ssl3_GetKeyPairRef(os->stepDownKeyPair);
           ss->ephemeralECDHKeyPair = !os->ephemeralECDHKeyPair ? NULL :
                                ssl3_GetKeyPairRef(os->ephemeralECDHKeyPair);
/*
 * XXX the preceeding CERT_ and SECKEY_ functions can fail and return NULL.
 * XXX We should detect this, and not just march on with NULL pointers.
 */
           ss->authCertificate       = os->authCertificate;
           ss->authCertificateArg    = os->authCertificateArg;
           ss->getClientAuthData     = os->getClientAuthData;
           ss->getClientAuthDataArg  = os->getClientAuthDataArg;
           ss->handleBadCert         = os->handleBadCert;
           ss->badCertArg            = os->badCertArg;
           ss->handshakeCallback     = os->handshakeCallback;
           ss->handshakeCallbackData = os->handshakeCallbackData;
           ss->pkcs11PinArg          = os->pkcs11PinArg;
    
           /* Create security data */
           rv = ssl_CopySecurityInfo(ss, os);
           if (rv != SECSuccess) {
              goto loser;
           }
       }
    }
    return ss;

loser:
    ssl_FreeSocket(ss);
    return NULL;
}
SECStatus SSL_Enable ( PRFileDesc fd,
int  which,
PRBool  on 
)

Definition at line 513 of file sslsock.c.

{
    return SSL_OptionSet(fd, which, on);
}

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus SSL_EnableCipher ( long  which,
PRBool  enabled 
)

Definition at line 1000 of file sslsock.c.

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus SSL_EnableDefault ( int  which,
PRBool  on 
)

Definition at line 804 of file sslsock.c.

{
    return SSL_OptionSetDefault(which, on);
}

Here is the call graph for this function:

SECStatus ssl_EnableNagleDelay ( sslSocket *  ss,
PRBool  enabled 
)

Definition at line 478 of file sslsock.c.

{
    PRFileDesc *       osfd = ss->fd->lower;
    SECStatus         rv = SECFailure;
    PRSocketOptionData opt;

    opt.option         = PR_SockOpt_NoDelay;
    opt.value.no_delay = (PRBool)!enabled;

    if (osfd->methods->setsocketoption) {
        rv = (SECStatus) osfd->methods->setsocketoption(osfd, &opt);
    } else {
        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    }

    return rv;
}

Definition at line 1652 of file sslsock.c.

{
    PRSocketOptionData opt;
    PRStatus           status;

    opt.option             = PR_SockOpt_Nonblocking;
    opt.value.non_blocking = PR_FALSE;
    status = PR_GetSocketOption(fd, &opt);
    if (status != PR_SUCCESS)
       return PR_FALSE;
    return (PRBool)!opt.value.non_blocking;
}
static PRStatus PR_CALLBACK ssl_FileInfo ( PRFileDesc fd,
PRFileInfo info 
) [static]

Definition at line 1850 of file sslsock.c.

{
    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}
static PRStatus PR_CALLBACK ssl_FileInfo64 ( PRFileDesc fd,
PRFileInfo64 info 
) [static]

Definition at line 1858 of file sslsock.c.

{
    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}
sslSocket* ssl_FindSocket ( PRFileDesc fd)

Definition at line 232 of file sslsock.c.

{
    PRFileDesc *layer;
    sslSocket *ss;

    PORT_Assert(fd != NULL);
    PORT_Assert(ssl_layer_id != 0);

    layer = PR_GetIdentitiesLayer(fd, ssl_layer_id);
    if (layer == NULL) {
       PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
       return NULL;
    }

    ss = (sslSocket *)layer->secret;
    ss->fd = layer;
    return ss;
}
void ssl_FreeSocket ( sslSocket *  ss)

Definition at line 432 of file sslsock.c.

{
#ifdef DEBUG
    sslSocket *fs;
    sslSocket  lSock;
#endif

/* Get every lock you can imagine!
** Caller already holds these:
**  SSL_LOCK_READER(ss);
**  SSL_LOCK_WRITER(ss);
*/
    ssl_Get1stHandshakeLock(ss);
    ssl_GetRecvBufLock(ss);
    ssl_GetSSL3HandshakeLock(ss);
    ssl_GetXmitBufLock(ss);
    ssl_GetSpecWriteLock(ss);

#ifdef DEBUG
    fs = &lSock;
    *fs = *ss;                            /* Copy the old socket structure, */
    PORT_Memset(ss, 0x1f, sizeof *ss);  /* then blast the old struct ASAP. */
#else
#define fs ss
#endif

    ssl_DestroySocketContents(fs);

    /* Release all the locks acquired above.  */
    SSL_UNLOCK_READER(fs);
    SSL_UNLOCK_WRITER(fs);
    ssl_Release1stHandshakeLock(fs);
    ssl_ReleaseRecvBufLock(fs);
    ssl_ReleaseSSL3HandshakeLock(fs);
    ssl_ReleaseXmitBufLock(fs);
    ssl_ReleaseSpecWriteLock(fs);

    ssl_DestroyLocks(fs);

    PORT_Free(ss);   /* free the caller's copy, not ours. */
    return;
}

Here is the call graph for this function:

static PRStatus PR_CALLBACK ssl_FSync ( PRFileDesc fd) [static]

Definition at line 1825 of file sslsock.c.

{
    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return PR_FAILURE;
}
SECStatus ssl_GetPeerInfo ( sslSocket *  ss)

Definition at line 1487 of file sslsock.c.

{
    PRFileDesc *      osfd;
    int               rv;
    PRNetAddr         sin;

    osfd = ss->fd->lower;

    PORT_Memset(&sin, 0, sizeof(sin));
    rv = osfd->methods->getpeername(osfd, &sin);
    if (rv < 0) {
       return SECFailure;
    }
    ss->TCPconnected = 1;
    if (sin.inet.family == PR_AF_INET) {
        PR_ConvertIPv4AddrToIPv6(sin.inet.ip, &ss->sec.ci.peer);
       ss->sec.ci.port = sin.inet.port;
    } else if (sin.ipv6.family == PR_AF_INET6) {
       ss->sec.ci.peer = sin.ipv6.ip;
       ss->sec.ci.port = sin.ipv6.port;
    } else {
       PORT_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR);
       return SECFailure;
    }
    return SECSuccess;
}
static PRStatus PR_CALLBACK ssl_GetPeerName ( PRFileDesc fd,
PRNetAddr addr 
) [static]

Definition at line 1472 of file sslsock.c.

{
    sslSocket *ss;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in getpeername", SSL_GETPID(), fd));
       return PR_FAILURE;
    }
    return (PRStatus)(*ss->ops->getpeername)(ss, addr);
}

Here is the call graph for this function:

static sslSocket* ssl_GetPrivate ( PRFileDesc fd) [static]

Definition at line 207 of file sslsock.c.

{
    sslSocket *ss;

    PORT_Assert(fd != NULL);
    PORT_Assert(fd->methods->file_type == PR_DESC_LAYERED);
    PORT_Assert(fd->identity == ssl_layer_id);

    if (fd->methods->file_type != PR_DESC_LAYERED ||
        fd->identity != ssl_layer_id) {
       PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
       return NULL;
    }

    ss = (sslSocket *)fd->secret;
    ss->fd = fd;
    return ss;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRStatus PR_CALLBACK ssl_GetSockName ( PRFileDesc fd,
PRNetAddr name 
) [static]

Definition at line 1515 of file sslsock.c.

{
    sslSocket *ss;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in getsockname", SSL_GETPID(), fd));
       return PR_FAILURE;
    }
    return (PRStatus)(*ss->ops->getsockname)(ss, name);
}

Here is the call graph for this function:

PRFileDesc* SSL_ImportFD ( PRFileDesc model,
PRFileDesc fd 
)

Definition at line 1153 of file sslsock.c.

{
    sslSocket * ns = NULL;
    PRStatus    rv;
    PRNetAddr   addr;

    if (model == NULL) {
       /* Just create a default socket if we're given NULL for the model */
       ns = ssl_NewSocket((PRBool)(!ssl_defaults.noLocks));
    } else {
       sslSocket * ss = ssl_FindSocket(model);
       if (ss == NULL) {
           SSL_DBG(("%d: SSL[%d]: bad model socket in ssl_ImportFD", 
                    SSL_GETPID(), model));
           return NULL;
       }
       ns = ssl_DupSocket(ss);
    }
    if (ns == NULL)
       return NULL;

    rv = ssl_PushIOLayer(ns, fd, PR_TOP_IO_LAYER);
    if (rv != PR_SUCCESS) {
       ssl_FreeSocket(ns);
       SET_ERROR_CODE
       return NULL;
    }
#ifdef _WIN32
    PR_Sleep(PR_INTERVAL_NO_WAIT);     /* workaround NT winsock connect bug. */
#endif
    ns = ssl_FindSocket(fd);
    PORT_Assert(ns);
    if (ns)
       ns->TCPconnected = (PR_SUCCESS == ssl_DefGetpeername(ns, &addr));
    return fd;
}
static PRStatus ssl_InitIOLayer ( void  ) [static]

Definition at line 1969 of file sslsock.c.

{
    ssl_layer_id = PR_GetUniqueIdentity("SSL");
    ssl_SetupIOMethods();
    ssl_inited = PR_TRUE;
    return PR_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool ssl_IsRemovedCipherSuite ( PRInt32  suite) [static]

Definition at line 928 of file sslsock.c.

Here is the caller graph for this function:

static PRStatus PR_CALLBACK ssl_Listen ( PRFileDesc fd,
PRIntn  backlog 
) [static]

Definition at line 1315 of file sslsock.c.

{
    sslSocket * ss = ssl_GetPrivate(fd);
    PRStatus    rv;

    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in listen", SSL_GETPID(), fd));
       return PR_FAILURE;
    }
    SSL_LOCK_READER(ss);
    SSL_LOCK_WRITER(ss);

    rv = (PRStatus)(*ss->ops->listen)(ss, backlog);

    SSL_UNLOCK_WRITER(ss);
    SSL_UNLOCK_READER(ss);
    return rv;
}

Here is the call graph for this function:

static SECStatus ssl_MakeLocks ( sslSocket *  ss) [static]

Definition at line 2022 of file sslsock.c.

{
    ss->firstHandshakeLock = PZ_NewMonitor(nssILockSSL);
    if (!ss->firstHandshakeLock) 
       goto loser;
    ss->ssl3HandshakeLock  = PZ_NewMonitor(nssILockSSL);
    if (!ss->ssl3HandshakeLock) 
       goto loser;
    ss->specLock           = NSSRWLock_New(SSL_LOCK_RANK_SPEC, NULL);
    if (!ss->specLock) 
       goto loser;
    ss->recvBufLock        = PZ_NewMonitor(nssILockSSL);
    if (!ss->recvBufLock) 
       goto loser;
    ss->xmitBufLock        = PZ_NewMonitor(nssILockSSL);
    if (!ss->xmitBufLock) 
       goto loser;
    ss->writerThread       = NULL;
    if (ssl_lock_readers) {
       ss->recvLock       = PZ_NewLock(nssILockSSL);
       if (!ss->recvLock) 
           goto loser;
       ss->sendLock       = PZ_NewLock(nssILockSSL);
       if (!ss->sendLock) 
           goto loser;
    }
    return SECSuccess;
loser:
    ssl_DestroyLocks(ss);
    return SECFailure;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static sslSocket * ssl_NewSocket ( PRBool  makeLocks) [static]

Definition at line 2062 of file sslsock.c.

{
    sslSocket *ss;
#if defined( NSS_HAVE_GETENV )
    static int firsttime = 1;

    if (firsttime) {
       char * ev;
       firsttime = 0;
#ifdef DEBUG
       ev = getenv("SSLDEBUGFILE");
       if (ev && ev[0]) {
           ssl_trace_iob = fopen(ev, "w");
       }
       if (!ssl_trace_iob) {
           ssl_trace_iob = stderr;
       }
#ifdef TRACE
       ev = getenv("SSLTRACE");
       if (ev && ev[0]) {
           ssl_trace = atoi(ev);
           SSL_TRACE(("SSL: tracing set to %d", ssl_trace));
       }
#endif /* TRACE */
       ev = getenv("SSLDEBUG");
       if (ev && ev[0]) {
           ssl_debug = atoi(ev);
           SSL_TRACE(("SSL: debugging set to %d", ssl_debug));
       }
#endif /* DEBUG */
       ev = getenv("SSLBYPASS");
       if (ev && ev[0]) {
           ssl_defaults.bypassPKCS11 = (ev[0] == '1');
           SSL_TRACE(("SSL: bypass default set to %d", \
                    ssl_defaults.bypassPKCS11));
       }
       ev = getenv("SSLFORCELOCKS");
       if (ev && ev[0] == '1') {
           ssl_force_locks = PR_TRUE;
           ssl_defaults.noLocks = 0;
           strcpy(lockStatus + LOCKSTATUS_OFFSET, "FORCED.  ");
           SSL_TRACE(("SSL: force_locks set to %d", ssl_force_locks));
       }
    }
#endif /* NSS_HAVE_GETENV */
    if (ssl_force_locks)
       makeLocks = PR_TRUE;

    /* Make a new socket and get it ready */
    ss = (sslSocket*) PORT_ZAlloc(sizeof(sslSocket));
    if (ss) {
        /* This should be of type SSLKEAType, but CC on IRIX
        * complains during the for loop.
        */
       int i;
       SECStatus status;
 
       ss->opt                = ssl_defaults;
       ss->opt.useSocks       = PR_FALSE;
       ss->opt.noLocks        = !makeLocks;

       ss->peerID             = NULL;
       ss->rTimeout         = PR_INTERVAL_NO_TIMEOUT;
       ss->wTimeout         = PR_INTERVAL_NO_TIMEOUT;
       ss->cTimeout         = PR_INTERVAL_NO_TIMEOUT;
       ss->cipherSpecs        = NULL;
        ss->sizeCipherSpecs    = 0;  /* produced lazily */
        ss->preferredCipher    = NULL;
        ss->url                = NULL;

       for (i=kt_null; i < kt_kea_size; i++) {
           sslServerCerts * sc = ss->serverCerts + i;
           sc->serverCert      = NULL;
           sc->serverCertChain = NULL;
           sc->serverKeyPair   = NULL;
           sc->serverKeyBits   = 0;
       }
       ss->stepDownKeyPair    = NULL;
       ss->dbHandle           = CERT_GetDefaultCertDB();

       /* Provide default implementation of hooks */
       ss->authCertificate    = SSL_AuthCertificate;
       ss->authCertificateArg = (void *)ss->dbHandle;
       ss->getClientAuthData  = NULL;
       ss->handleBadCert      = NULL;
       ss->badCertArg         = NULL;
       ss->pkcs11PinArg       = NULL;

       ssl_ChooseOps(ss);
       ssl2_InitSocketPolicy(ss);
       ssl3_InitSocketPolicy(ss);

       if (makeLocks) {
           status = ssl_MakeLocks(ss);
           if (status != SECSuccess)
              goto loser;
       }
       status = ssl_CreateSecurityInfo(ss);
       if (status != SECSuccess) 
           goto loser;
       status = ssl_InitGather(&ss->gs);
       if (status != SECSuccess) {
loser:
           ssl_DestroySocketContents(ss);
           ssl_DestroyLocks(ss);
           PORT_Free(ss);
           ss = NULL;
       }
    }
    return ss;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus SSL_OptionGet ( PRFileDesc fd,
PRInt32  which,
PRBool pOn 
)

Definition at line 715 of file sslsock.c.

{
    sslSocket *ss = ssl_FindSocket(fd);
    SECStatus  rv = SECSuccess;
    PRBool     on = PR_FALSE;

    if (!pOn) {
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       return SECFailure;
    }
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in Enable", SSL_GETPID(), fd));
       *pOn = PR_FALSE;
       return SECFailure;
    }

    ssl_Get1stHandshakeLock(ss);
    ssl_GetSSL3HandshakeLock(ss);

    switch (which) {
    case SSL_SOCKS:               on = PR_FALSE;               break;
    case SSL_SECURITY:            on = ss->opt.useSecurity;        break;
    case SSL_REQUEST_CERTIFICATE: on = ss->opt.requestCertificate; break;
    case SSL_REQUIRE_CERTIFICATE: on = ss->opt.requireCertificate; break;
    case SSL_HANDSHAKE_AS_CLIENT: on = ss->opt.handshakeAsClient;  break;
    case SSL_HANDSHAKE_AS_SERVER: on = ss->opt.handshakeAsServer;  break;
    case SSL_ENABLE_TLS:          on = ss->opt.enableTLS;          break;
    case SSL_ENABLE_SSL3:         on = ss->opt.enableSSL3;         break;
    case SSL_ENABLE_SSL2:         on = ss->opt.enableSSL2;         break;
    case SSL_NO_CACHE:            on = ss->opt.noCache;            break;
    case SSL_ENABLE_FDX:          on = ss->opt.fdx;                break;
    case SSL_V2_COMPATIBLE_HELLO: on = ss->opt.v2CompatibleHello;  break;
    case SSL_ROLLBACK_DETECTION:  on = ss->opt.detectRollBack;     break;
    case SSL_NO_STEP_DOWN:        on = ss->opt.noStepDown;         break;
    case SSL_BYPASS_PKCS11:       on = ss->opt.bypassPKCS11;       break;
    case SSL_NO_LOCKS:            on = ss->opt.noLocks;            break;

    default:
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       rv = SECFailure;
    }

    ssl_ReleaseSSL3HandshakeLock(ss);
    ssl_Release1stHandshakeLock(ss);

    *pOn = on;
    return rv;
}
SECStatus SSL_OptionGetDefault ( PRInt32  which,
PRBool pOn 
)
SECStatus SSL_OptionSet ( PRFileDesc fd,
PRInt32  which,
PRBool  on 
)

Definition at line 542 of file sslsock.c.

{
    sslSocket *ss = ssl_FindSocket(fd);
    SECStatus  rv = SECSuccess;
    PRBool     holdingLocks;

    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in Enable", SSL_GETPID(), fd));
       return SECFailure;
    }

    holdingLocks = (!ss->opt.noLocks);
    ssl_Get1stHandshakeLock(ss);
    ssl_GetSSL3HandshakeLock(ss);

    switch (which) {
      case SSL_SOCKS:
       ss->opt.useSocks = PR_FALSE;
       rv = PrepareSocket(ss);
       if (on) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           rv = SECFailure;
       }
       break;

      case SSL_SECURITY:
       ss->opt.useSecurity = on;
       rv = PrepareSocket(ss);
       break;

      case SSL_REQUEST_CERTIFICATE:
       ss->opt.requestCertificate = on;
       break;

      case SSL_REQUIRE_CERTIFICATE:
       ss->opt.requireCertificate = on;
       break;

      case SSL_HANDSHAKE_AS_CLIENT:
       if ( ss->opt.handshakeAsServer && on ) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           rv = SECFailure;
           break;
       }
       ss->opt.handshakeAsClient = on;
       break;

      case SSL_HANDSHAKE_AS_SERVER:
       if ( ss->opt.handshakeAsClient && on ) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           rv = SECFailure;
           break;
       }
       ss->opt.handshakeAsServer = on;
       break;

      case SSL_ENABLE_TLS:
       ss->opt.enableTLS       = on;
       ss->preferredCipher     = NULL;
       if (ss->cipherSpecs) {
           PORT_Free(ss->cipherSpecs);
           ss->cipherSpecs     = NULL;
           ss->sizeCipherSpecs = 0;
       }
       break;

      case SSL_ENABLE_SSL3:
       ss->opt.enableSSL3      = on;
       ss->preferredCipher     = NULL;
       if (ss->cipherSpecs) {
           PORT_Free(ss->cipherSpecs);
           ss->cipherSpecs     = NULL;
           ss->sizeCipherSpecs = 0;
       }
       break;

      case SSL_ENABLE_SSL2:
       ss->opt.enableSSL2       = on;
       if (on) {
           ss->opt.v2CompatibleHello = on;
       }
       ss->preferredCipher     = NULL;
       if (ss->cipherSpecs) {
           PORT_Free(ss->cipherSpecs);
           ss->cipherSpecs     = NULL;
           ss->sizeCipherSpecs = 0;
       }
       break;

      case SSL_NO_CACHE:
       ss->opt.noCache = on;
       break;

      case SSL_ENABLE_FDX:
       if (on && ss->opt.noLocks) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           rv = SECFailure;
       }
       ss->opt.fdx = on;
       break;

      case SSL_V2_COMPATIBLE_HELLO:
       ss->opt.v2CompatibleHello = on;
       if (!on) {
           ss->opt.enableSSL2    = on;
       }
       break;

      case SSL_ROLLBACK_DETECTION:  
       ss->opt.detectRollBack = on;
        break;

      case SSL_NO_STEP_DOWN:        
       ss->opt.noStepDown     = on;         
       if (on) 
           SSL_DisableExportCipherSuites(fd);
       break;

      case SSL_BYPASS_PKCS11:
       if (ss->handshakeBegun) {
           PORT_SetError(PR_INVALID_STATE_ERROR);
           rv = SECFailure;
       } else {
            if (PR_FALSE != on) {
                if (PR_SUCCESS == SSL_BypassSetup() ) {
                    ss->opt.bypassPKCS11   = on;
                } else {
                    rv = SECFailure;
                }
            } else {
                ss->opt.bypassPKCS11   = PR_FALSE;
            }
       }
       break;

      case SSL_NO_LOCKS:
       if (on && ss->opt.fdx) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           rv = SECFailure;
       }
       if (on && ssl_force_locks) 
           on = PR_FALSE;   /* silent override */
       ss->opt.noLocks   = on;
       if (on) {
           locksEverDisabled = PR_TRUE;
           strcpy(lockStatus + LOCKSTATUS_OFFSET, "DISABLED.");
       } else if (!holdingLocks) {
           rv = ssl_MakeLocks(ss);
           if (rv != SECSuccess) {
              ss->opt.noLocks   = PR_TRUE;
           }
       }
       break;

      default:
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       rv = SECFailure;
    }

    /* We can't use the macros for releasing the locks here,
     * because ss->opt.noLocks might have changed just above.
     * We must release these locks (monitors) here, if we aquired them above,
     * regardless of the current value of ss->opt.noLocks.
     */
    if (holdingLocks) {
       PZ_ExitMonitor((ss)->ssl3HandshakeLock);
       PZ_ExitMonitor((ss)->firstHandshakeLock);
    }

    return rv;
}

Definition at line 810 of file sslsock.c.

{
    switch (which) {
      case SSL_SOCKS:
       ssl_defaults.useSocks = PR_FALSE;
       if (on) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           return SECFailure;
       }
       break;

      case SSL_SECURITY:
       ssl_defaults.useSecurity = on;
       break;

      case SSL_REQUEST_CERTIFICATE:
       ssl_defaults.requestCertificate = on;
       break;

      case SSL_REQUIRE_CERTIFICATE:
       ssl_defaults.requireCertificate = on;
       break;

      case SSL_HANDSHAKE_AS_CLIENT:
       if ( ssl_defaults.handshakeAsServer && on ) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           return SECFailure;
       }
       ssl_defaults.handshakeAsClient = on;
       break;

      case SSL_HANDSHAKE_AS_SERVER:
       if ( ssl_defaults.handshakeAsClient && on ) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           return SECFailure;
       }
       ssl_defaults.handshakeAsServer = on;
       break;

      case SSL_ENABLE_TLS:
       ssl_defaults.enableTLS = on;
       break;

      case SSL_ENABLE_SSL3:
       ssl_defaults.enableSSL3 = on;
       break;

      case SSL_ENABLE_SSL2:
       ssl_defaults.enableSSL2 = on;
       if (on) {
           ssl_defaults.v2CompatibleHello = on;
       }
       break;

      case SSL_NO_CACHE:
       ssl_defaults.noCache = on;
       break;

      case SSL_ENABLE_FDX:
       if (on && ssl_defaults.noLocks) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           return SECFailure;
       }
       ssl_defaults.fdx = on;
       break;

      case SSL_V2_COMPATIBLE_HELLO:
       ssl_defaults.v2CompatibleHello = on;
       if (!on) {
           ssl_defaults.enableSSL2    = on;
       }
       break;

      case SSL_ROLLBACK_DETECTION:  
       ssl_defaults.detectRollBack = on;
       break;

      case SSL_NO_STEP_DOWN:        
       ssl_defaults.noStepDown     = on;         
       if (on)
           SSL_DisableDefaultExportCipherSuites();
       break;

      case SSL_BYPASS_PKCS11:
        if (PR_FALSE != on) {
            if (PR_SUCCESS == SSL_BypassSetup()) {
                ssl_defaults.bypassPKCS11   = on;
            } else {
                return SECFailure;
            }
        } else {
            ssl_defaults.bypassPKCS11   = PR_FALSE;
        }
       break;

      case SSL_NO_LOCKS:
       if (on && ssl_defaults.fdx) {
           PORT_SetError(SEC_ERROR_INVALID_ARGS);
           return SECFailure;
       }
       if (on && ssl_force_locks) 
           on = PR_FALSE;          /* silent override */
       ssl_defaults.noLocks        = on;
       if (on) {
           locksEverDisabled = PR_TRUE;
           strcpy(lockStatus + LOCKSTATUS_OFFSET, "DISABLED.");
       }
       break;

      default:
       PORT_SetError(SEC_ERROR_INVALID_ARGS);
       return SECFailure;
    }
    return SECSuccess;
}
static PRInt16 PR_CALLBACK ssl_Poll ( PRFileDesc fd,
PRInt16  how_flags,
PRInt16 p_out_flags 
) [static]

Definition at line 1546 of file sslsock.c.

{
    sslSocket *ss;
    PRInt16    new_flags = how_flags;     /* should select on these flags. */
    PRNetAddr  addr;

    *p_out_flags = 0;
    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in SSL_Poll",
               SSL_GETPID(), fd));
       return 0;     /* don't poll on this socket */
    }

    if (ss->opt.useSecurity && 
       ss->handshaking != sslHandshakingUndetermined &&
        !ss->firstHsDone &&
       (how_flags & PR_POLL_RW)) {
       if (!ss->TCPconnected) {
           ss->TCPconnected = (PR_SUCCESS == ssl_DefGetpeername(ss, &addr));
       }
       /* If it's not connected, then presumably the application is polling
       ** on read or write appropriately, so don't change it. 
       */
       if (ss->TCPconnected) {
           if (!ss->handshakeBegun) {
              /* If the handshake has not begun, poll on read or write 
              ** based on the local application's role in the handshake,
              ** not based on what the application requested.
              */
              new_flags &= ~PR_POLL_RW;
              if (ss->handshaking == sslHandshakingAsClient) {
                  new_flags |= PR_POLL_WRITE;
              } else { /* handshaking as server */
                  new_flags |= PR_POLL_READ;
              }
           } else 
           /* First handshake is in progress */
           if (ss->lastWriteBlocked) {
              if (new_flags & PR_POLL_READ) {
                  /* The caller is waiting for data to be received, 
                  ** but the initial handshake is blocked on write, or the 
                  ** client's first handshake record has not been written.
                  ** The code should select on write, not read.
                  */
                  new_flags ^=  PR_POLL_READ;       /* don't select on read. */
                  new_flags |=  PR_POLL_WRITE;   /* do    select on write. */
              }
           } else if (new_flags & PR_POLL_WRITE) {
                  /* The caller is trying to write, but the handshake is 
                  ** blocked waiting for data to read, and the first 
                  ** handshake has been sent.  so do NOT to poll on write.
                  */
                  new_flags ^=  PR_POLL_WRITE;   /* don't select on write. */
                  new_flags |=  PR_POLL_READ;       /* do    select on read. */
           }
       }
    } else if ((new_flags & PR_POLL_READ) && (SSL_DataPending(fd) > 0)) {
       *p_out_flags = PR_POLL_READ;       /* it's ready already. */
       return new_flags;
    } else if ((ss->lastWriteBlocked) && (how_flags & PR_POLL_READ) &&
              (ss->pendingBuf.len != 0)) { /* write data waiting to be sent */
       new_flags |=  PR_POLL_WRITE;   /* also select on write. */
    } 
    if (new_flags && (fd->lower->methods->poll != NULL)) {
       PRInt16    lower_out_flags = 0;
       PRInt16    lower_new_flags;
        lower_new_flags = fd->lower->methods->poll(fd->lower, new_flags, 
                                              &lower_out_flags);
       if ((lower_new_flags & lower_out_flags) && (how_flags != new_flags)) {
           PRInt16 out_flags = lower_out_flags & ~PR_POLL_RW;
           if (lower_out_flags & PR_POLL_READ) 
              out_flags |= PR_POLL_WRITE;
           if (lower_out_flags & PR_POLL_WRITE) 
              out_flags |= PR_POLL_READ;
           *p_out_flags = out_flags;
           new_flags = how_flags;
       } else {
           *p_out_flags = lower_out_flags;
           new_flags    = lower_new_flags;
       }
    }

    return new_flags;
}

Here is the call graph for this function:

static PRStatus ssl_PushIOLayer ( sslSocket *  ns,
PRFileDesc stack,
PRDescIdentity  id 
) [static]

Definition at line 1978 of file sslsock.c.

{
    PRFileDesc *layer       = NULL;
    PRStatus    status;

    if (!ssl_inited) {
       PR_CallOnce(&initIoLayerOnce, &ssl_InitIOLayer);
    }

    if (ns == NULL)
       goto loser;

    layer = PR_CreateIOLayerStub(ssl_layer_id, &combined_methods);
    if (layer == NULL)
       goto loser;
    layer->secret = (PRFilePrivate *)ns;

    /* Here, "stack" points to the PRFileDesc on the top of the stack.
    ** "layer" points to a new FD that is to be inserted into the stack.
    ** If layer is being pushed onto the top of the stack, then 
    ** PR_PushIOLayer switches the contents of stack and layer, and then
    ** puts stack on top of layer, so that after it is done, the top of 
    ** stack is the same "stack" as it was before, and layer is now the 
    ** FD for the former top of stack.
    ** After this call, stack always points to the top PRFD on the stack.
    ** If this function fails, the contents of stack and layer are as 
    ** they were before the call.
    */
    status = PR_PushIOLayer(stack, id, layer);
    if (status != PR_SUCCESS)
       goto loser;

    ns->fd = (id == PR_TOP_IO_LAYER) ? stack : layer;
    return PR_SUCCESS;

loser:
    if (layer) {
       layer->dtor(layer); /* free layer */
    }
    return PR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PR_CALLBACK ssl_Read ( PRFileDesc fd,
void buf,
PRInt32  len 
) [static]

Definition at line 1432 of file sslsock.c.

{
    sslSocket *ss;
    int        rv;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in read", SSL_GETPID(), fd));
       return SECFailure;
    }
    SSL_LOCK_READER(ss);
    ss->rTimeout = PR_INTERVAL_NO_TIMEOUT;
    if (!ss->opt.fdx)
       ss->wTimeout = PR_INTERVAL_NO_TIMEOUT;
    rv = (*ss->ops->read)(ss, (unsigned char*)buf, len);
    SSL_UNLOCK_READER(ss);
    return rv;
}

Here is the call graph for this function:

static int PR_CALLBACK ssl_Recv ( PRFileDesc fd,
void buf,
PRInt32  len,
PRIntn  flags,
PRIntervalTime  timeout 
) [static]

Definition at line 1390 of file sslsock.c.

{
    sslSocket *ss;
    int        rv;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in recv", SSL_GETPID(), fd));
       return SECFailure;
    }
    SSL_LOCK_READER(ss);
    ss->rTimeout = timeout;
    if (!ss->opt.fdx)
       ss->wTimeout = timeout;
    rv = (*ss->ops->recv)(ss, (unsigned char*)buf, len, flags);
    SSL_UNLOCK_READER(ss);
    return rv;
}

Here is the call graph for this function:

static PRInt32 PR_CALLBACK ssl_RecvFrom ( PRFileDesc fd,
void buf,
PRInt32  amount,
PRIntn  flags,
PRNetAddr addr,
PRIntervalTime  timeout 
) [static]

Definition at line 1866 of file sslsock.c.

{
    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return SECFailure;
}
static PRInt32 PR_CALLBACK ssl_Seek ( PRFileDesc fd,
PRInt32  offset,
PRSeekWhence  how 
) [static]

Definition at line 1833 of file sslsock.c.

                                                           {
    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return SECFailure;
}
static PRInt64 PR_CALLBACK ssl_Seek64 ( PRFileDesc fd,
PRInt64  offset,
PRSeekWhence  how 
) [static]

Definition at line 1840 of file sslsock.c.

                                                             {
    PRInt64 res;

    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    LL_I2L(res, -1L);
    return res;
}
static int PR_CALLBACK ssl_Send ( PRFileDesc fd,
const void buf,
PRInt32  len,
PRIntn  flags,
PRIntervalTime  timeout 
) [static]

Definition at line 1411 of file sslsock.c.

{
    sslSocket *ss;
    int        rv;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in send", SSL_GETPID(), fd));
       return SECFailure;
    }
    SSL_LOCK_WRITER(ss);
    ss->wTimeout = timeout;
    if (!ss->opt.fdx)
       ss->rTimeout = timeout;
    rv = (*ss->ops->send)(ss, (const unsigned char*)buf, len, flags);
    SSL_UNLOCK_WRITER(ss);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRInt32 PR_CALLBACK ssl_SendTo ( PRFileDesc fd,
const void buf,
PRInt32  amount,
PRIntn  flags,
const PRNetAddr addr,
PRIntervalTime  timeout 
) [static]

Definition at line 1875 of file sslsock.c.

{
    PORT_Assert(0);
    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    return SECFailure;
}
SECStatus SSL_SetPolicy ( long  which,
int  policy 
)

Definition at line 945 of file sslsock.c.

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus PR_CALLBACK SSL_SetSockPeerID ( PRFileDesc fd,
char *  peerID 
)

Definition at line 1528 of file sslsock.c.

{
    sslSocket *ss;

    ss = ssl_FindSocket(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in SSL_SetCacheIndex",
               SSL_GETPID(), fd));
       return SECFailure;
    }

    ss->peerID = PORT_Strdup(peerID);
    return SECSuccess;
}
static void ssl_SetupIOMethods ( void  ) [static]

Definition at line 1926 of file sslsock.c.

{
          PRIOMethods *new_methods  = &combined_methods;
    const PRIOMethods *nspr_methods = PR_GetDefaultIOMethods();
    const PRIOMethods *my_methods   = &ssl_methods;

    *new_methods = *nspr_methods;

    new_methods->file_type         = my_methods->file_type;
    new_methods->close             = my_methods->close;
    new_methods->read              = my_methods->read;
    new_methods->write             = my_methods->write;
    new_methods->available         = my_methods->available;
    new_methods->available64       = my_methods->available64;
    new_methods->fsync             = my_methods->fsync;
    new_methods->seek              = my_methods->seek;
    new_methods->seek64            = my_methods->seek64;
    new_methods->fileInfo          = my_methods->fileInfo;
    new_methods->fileInfo64        = my_methods->fileInfo64;
    new_methods->writev            = my_methods->writev;
    new_methods->connect           = my_methods->connect;
    new_methods->accept            = my_methods->accept;
    new_methods->bind              = my_methods->bind;
    new_methods->listen            = my_methods->listen;
    new_methods->shutdown          = my_methods->shutdown;
    new_methods->recv              = my_methods->recv;
    new_methods->send              = my_methods->send;
    new_methods->recvfrom          = my_methods->recvfrom;
    new_methods->sendto            = my_methods->sendto;
    new_methods->poll              = my_methods->poll;
    new_methods->acceptread        = my_methods->acceptread;
    new_methods->transmitfile      = my_methods->transmitfile;
    new_methods->getsockname       = my_methods->getsockname;
    new_methods->getpeername       = my_methods->getpeername;
/*  new_methods->getsocketoption   = my_methods->getsocketoption;     */
/*  new_methods->setsocketoption   = my_methods->setsocketoption;     */
    new_methods->sendfile          = my_methods->sendfile;

}

Here is the caller graph for this function:

static PRStatus PR_CALLBACK ssl_Shutdown ( PRFileDesc fd,
PRIntn  how 
) [static]

Definition at line 1335 of file sslsock.c.

{
    sslSocket * ss = ssl_GetPrivate(fd);
    PRStatus    rv;

    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in shutdown", SSL_GETPID(), fd));
       return PR_FAILURE;
    }
    if (how == PR_SHUTDOWN_RCV || how == PR_SHUTDOWN_BOTH) {
       SSL_LOCK_READER(ss);
    }
    if (how == PR_SHUTDOWN_SEND || how == PR_SHUTDOWN_BOTH) {
       SSL_LOCK_WRITER(ss);
    }

    rv = (PRStatus)(*ss->ops->shutdown)(ss, how);

    if (how == PR_SHUTDOWN_SEND || how == PR_SHUTDOWN_BOTH) {
       SSL_UNLOCK_WRITER(ss);
    }
    if (how == PR_SHUTDOWN_RCV || how == PR_SHUTDOWN_BOTH) {
       SSL_UNLOCK_READER(ss);
    }
    return rv;
}

Here is the call graph for this function:

PRBool ssl_SocketIsBlocking ( sslSocket *  ss)

Definition at line 1666 of file sslsock.c.

{
    return ssl_FdIsBlocking(ss->fd);
}
static PRInt32 PR_CALLBACK ssl_TransmitFile ( PRFileDesc sd,
PRFileDesc fd,
const void headers,
PRInt32  hlen,
PRTransmitFileFlags  flags,
PRIntervalTime  timeout 
) [static]

Definition at line 1633 of file sslsock.c.

{
    PRSendFileData sfd;

    sfd.fd = fd;
    sfd.file_offset = 0;
    sfd.file_nbytes = 0;
    sfd.header = headers;
    sfd.hlen = hlen;
    sfd.trailer = NULL;
    sfd.tlen = 0;

    return sd->methods->sendfile(sd, &sfd, flags, timeout);
}
static int PR_CALLBACK ssl_Write ( PRFileDesc fd,
const void buf,
PRInt32  len 
) [static]

Definition at line 1452 of file sslsock.c.

{
    sslSocket *ss;
    int        rv;

    ss = ssl_GetPrivate(fd);
    if (!ss) {
       SSL_DBG(("%d: SSL[%d]: bad socket in write", SSL_GETPID(), fd));
       return SECFailure;
    }
    SSL_LOCK_WRITER(ss);
    ss->wTimeout = PR_INTERVAL_NO_TIMEOUT;
    if (!ss->opt.fdx)
       ss->rTimeout = PR_INTERVAL_NO_TIMEOUT;
    rv = (*ss->ops->write)(ss, (const unsigned char*)buf, len);
    SSL_UNLOCK_WRITER(ss);
    return rv;
}

Here is the call graph for this function:

static PRInt32 PR_CALLBACK ssl_WriteV ( PRFileDesc fd,
const PRIOVec iov,
PRInt32  vectors,
PRIntervalTime  timeout 
) [static]

Definition at line 1675 of file sslsock.c.

{
    PRInt32            bufLen;
    PRInt32            left;
    PRInt32            rv;
    PRInt32            sent      =  0;
    const PRInt32      first_len = sslFirstBufSize;
    const PRInt32      limit     = sslCopyLimit;
    PRBool             blocking;
    PRIOVec            myIov        = { 0, 0 };
    char               buf[MAX_FRAGMENT_LENGTH];

    if (vectors > PR_MAX_IOVECTOR_SIZE) {
       PORT_SetError(PR_BUFFER_OVERFLOW_ERROR);
       return -1;
    }
    blocking = ssl_FdIsBlocking(fd);

#define K16 sizeof(buf)
#define KILL_VECTORS while (vectors && !iov->iov_len) { ++iov; --vectors; }
#define GET_VECTOR   do { myIov = *iov++; --vectors; KILL_VECTORS } while (0)
#define HANDLE_ERR(rv, len) \
    if (rv != len) { \
       if (rv < 0) { \
           if (!blocking \
              && (PR_GetError() == PR_WOULD_BLOCK_ERROR) \
              && (sent > 0)) { \
              return sent; \
           } else { \
              return -1; \
           } \
       } \
       /* Only a nonblocking socket can have partial sends */ \
       PR_ASSERT(!blocking); \
       return sent + rv; \
    } 
#define SEND(bfr, len) \
    do { \
       rv = ssl_Send(fd, bfr, len, 0, timeout); \
       HANDLE_ERR(rv, len) \
       sent += len; \
    } while (0)

    /* Make sure the first write is at least 8 KB, if possible. */
    KILL_VECTORS
    if (!vectors)
       return ssl_Send(fd, 0, 0, 0, timeout);
    GET_VECTOR;
    if (!vectors) {
       return ssl_Send(fd, myIov.iov_base, myIov.iov_len, 0, timeout);
    }
    if (myIov.iov_len < first_len) {
       PORT_Memcpy(buf, myIov.iov_base, myIov.iov_len);
       bufLen = myIov.iov_len;
       left = first_len - bufLen;
       while (vectors && left) {
           int toCopy;
           GET_VECTOR;
           toCopy = PR_MIN(left, myIov.iov_len);
           PORT_Memcpy(buf + bufLen, myIov.iov_base, toCopy);
           bufLen         += toCopy;
           left           -= toCopy;
           myIov.iov_base += toCopy;
           myIov.iov_len  -= toCopy;
       }
       SEND( buf, bufLen );
    }

    while (vectors || myIov.iov_len) {
       PRInt32   addLen;
       if (!myIov.iov_len) {
           GET_VECTOR;
       }
       while (myIov.iov_len >= K16) {
           SEND(myIov.iov_base, K16);
           myIov.iov_base += K16;
           myIov.iov_len  -= K16;
       }
       if (!myIov.iov_len)
           continue;

       if (!vectors || myIov.iov_len > limit) {
           addLen = 0;
       } else if ((addLen = iov->iov_len % K16) + myIov.iov_len <= limit) {
           /* Addlen is already computed. */;
       } else if (vectors > 1 && 
            iov[1].iov_len % K16 + addLen + myIov.iov_len <= 2 * limit) {
            addLen = limit - myIov.iov_len;
       } else 
           addLen = 0;

       if (!addLen) {
           SEND( myIov.iov_base, myIov.iov_len );
           myIov.iov_len = 0;
           continue;
       }
       PORT_Memcpy(buf, myIov.iov_base, myIov.iov_len);
       bufLen = myIov.iov_len;
       do {
           GET_VECTOR;
           PORT_Memcpy(buf + bufLen, myIov.iov_base, addLen);
           myIov.iov_base += addLen;
           myIov.iov_len  -= addLen;
           bufLen         += addLen;

           left = PR_MIN( limit, K16 - bufLen);
           if (!vectors            /* no more left */
           ||  myIov.iov_len > 0   /* we didn't use that one all up */
           ||  bufLen >= K16              /* it's full. */
           ) {
              addLen = 0;
           } else if ((addLen = iov->iov_len % K16) <= left) {
              /* Addlen is already computed. */;
           } else if (vectors > 1 && 
               iov[1].iov_len % K16 + addLen <= left + limit) {
               addLen = left;
           } else 
              addLen = 0;

       } while (addLen);
       SEND( buf, bufLen );
    } 
    return sent;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 1923 of file sslsock.c.

Definition at line 1966 of file sslsock.c.

Definition at line 184 of file sslsock.c.

char lockStatus[] = "Locks are ENABLED. "

Definition at line 190 of file sslsock.c.

Definition at line 518 of file sslsock.c.

Definition at line 519 of file sslsock.c.

cipherPolicy ssl_ciphers[] [static]

Definition at line 70 of file sslsock.c.

char ssl_debug

Definition at line 187 of file sslsock.c.

const sslSocketOps ssl_default_ops [static]

Definition at line 185 of file sslsock.c.

Definition at line 181 of file sslsock.c.

Definition at line 182 of file sslsock.c.

Definition at line 186 of file sslsock.c.

Definition at line 1883 of file sslsock.c.

const sslSocketOps ssl_secure_ops [static]

Definition at line 178 of file sslsock.c.

Definition at line 177 of file sslsock.c.

Definition at line 179 of file sslsock.c.

char ssl_trace

Definition at line 188 of file sslsock.c.

Definition at line 189 of file sslsock.c.

Definition at line 1672 of file sslsock.c.

Definition at line 1671 of file sslsock.c.