optimize basic SSL layout

This commit is contained in:
toddouska 2015-03-07 10:32:35 -08:00
parent f48298cbd5
commit 742278a305

View File

@ -2017,30 +2017,42 @@ typedef struct MsgsReceived {
/* wolfSSL ssl type */ /* wolfSSL ssl type */
struct WOLFSSL { struct WOLFSSL {
WOLFSSL_CTX* ctx; WOLFSSL_CTX* ctx;
int error;
ProtocolVersion version; /* negotiated version */
ProtocolVersion chVersion; /* client hello version */
Suites* suites; /* only need during handshake */ Suites* suites; /* only need during handshake */
Arrays* arrays;
void* IOCB_ReadCtx;
void* IOCB_WriteCtx;
RNG* rng;
void* verifyCbCtx; /* cert verify callback user ctx*/
VerifyCallback verifyCallback; /* cert verification callback */
void* heap; /* for user overrides */
WOLFSSL_CIPHER cipher;
hmacfp hmac;
Ciphers encrypt; Ciphers encrypt;
Ciphers decrypt; Ciphers decrypt;
#ifdef HAVE_ONE_TIME_AUTH Buffers buffers;
OneTimeAuth auth; WOLFSSL_SESSION session;
#endif WOLFSSL_ALERT_HISTORY alert_history;
CipherSpecs specs; int error;
Keys keys;
MsgsReceived msgsReceived; /* peer messages received */
int rfd; /* read file descriptor */ int rfd; /* read file descriptor */
int wfd; /* write file descriptor */ int wfd; /* write file descriptor */
int rflags; /* user read flags */ int rflags; /* user read flags */
int wflags; /* user write flags */ int wflags; /* user write flags */
word32 timeout; /* session timeout */
word16 curSize;
RecordLayerHeader curRL;
MsgsReceived msgsReceived; /* peer messages received */
ProtocolVersion version; /* negotiated version */
ProtocolVersion chVersion; /* client hello version */
CipherSpecs specs;
Keys keys;
Hashes verifyHashes;
Hashes certHashes; /* for cert verify */
Options options;
#ifdef OPENSSL_EXTRA #ifdef OPENSSL_EXTRA
WOLFSSL_BIO* biord; /* socket bio read to free/close */ WOLFSSL_BIO* biord; /* socket bio read to free/close */
WOLFSSL_BIO* biowr; /* socket bio write to free/close */ WOLFSSL_BIO* biowr; /* socket bio write to free/close */
#endif #endif
void* IOCB_ReadCtx;
void* IOCB_WriteCtx;
RNG* rng;
#ifndef NO_OLD_TLS #ifndef NO_OLD_TLS
#ifndef NO_SHA #ifndef NO_SHA
Sha hashSha; /* sha hash of handshake msgs */ Sha hashSha; /* sha hash of handshake msgs */
@ -2048,21 +2060,13 @@ struct WOLFSSL {
#ifndef NO_MD5 #ifndef NO_MD5
Md5 hashMd5; /* md5 hash of handshake msgs */ Md5 hashMd5; /* md5 hash of handshake msgs */
#endif #endif
#endif #endif /* NO_OLD_TLS */
#ifndef NO_SHA256 #ifndef NO_SHA256
Sha256 hashSha256; /* sha256 hash of handshake msgs */ Sha256 hashSha256; /* sha256 hash of handshake msgs */
#endif #endif
#ifdef WOLFSSL_SHA384 #ifdef WOLFSSL_SHA384
Sha384 hashSha384; /* sha384 hash of handshake msgs */ Sha384 hashSha384; /* sha384 hash of handshake msgs */
#endif #endif
Hashes verifyHashes;
Hashes certHashes; /* for cert verify */
Buffers buffers;
Options options;
Arrays* arrays;
WOLFSSL_SESSION session;
VerifyCallback verifyCallback; /* cert verification callback */
void* verifyCbCtx; /* cert verify callback user ctx*/
#ifndef NO_RSA #ifndef NO_RSA
RsaKey* peerRsaKey; RsaKey* peerRsaKey;
byte peerRsaKeyPresent; byte peerRsaKeyPresent;
@ -2076,18 +2080,12 @@ struct WOLFSSL {
ecc_key* peerEccKey; /* peer's ECDHE key */ ecc_key* peerEccKey; /* peer's ECDHE key */
ecc_key* peerEccDsaKey; /* peer's ECDSA key */ ecc_key* peerEccDsaKey; /* peer's ECDSA key */
ecc_key* eccTempKey; /* private ECDHE key */ ecc_key* eccTempKey; /* private ECDHE key */
word16 eccTempKeySz; /* in octets 20 - 66 */
word32 pkCurveOID; /* curve Ecc_Sum */ word32 pkCurveOID; /* curve Ecc_Sum */
word16 eccTempKeySz; /* in octets 20 - 66 */
byte peerEccKeyPresent; byte peerEccKeyPresent;
byte peerEccDsaKeyPresent; byte peerEccDsaKeyPresent;
byte eccTempKeyPresent; byte eccTempKeyPresent;
#endif #endif
hmacfp hmac;
void* heap; /* for user overrides */
RecordLayerHeader curRL;
word16 curSize;
word32 timeout; /* session timeout */
WOLFSSL_CIPHER cipher;
#ifdef HAVE_LIBZ #ifdef HAVE_LIBZ
z_stream c_stream; /* compression stream */ z_stream c_stream; /* compression stream */
z_stream d_stream; /* decompression stream */ z_stream d_stream; /* decompression stream */
@ -2121,6 +2119,9 @@ struct WOLFSSL {
#ifdef HAVE_CAVIUM #ifdef HAVE_CAVIUM
int devId; /* cavium device id to use */ int devId; /* cavium device id to use */
#endif #endif
#ifdef HAVE_ONE_TIME_AUTH
OneTimeAuth auth;
#endif
#ifdef HAVE_TLS_EXTENSIONS #ifdef HAVE_TLS_EXTENSIONS
TLSX* extensions; /* RFC 6066 TLS Extensions data */ TLSX* extensions; /* RFC 6066 TLS Extensions data */
#ifdef HAVE_MAX_FRAGMENT #ifdef HAVE_MAX_FRAGMENT
@ -2144,7 +2145,6 @@ struct WOLFSSL {
#ifdef SESSION_INDEX #ifdef SESSION_INDEX
int sessionIndex; /* Session's location in the cache. */ int sessionIndex; /* Session's location in the cache. */
#endif #endif
WOLFSSL_ALERT_HISTORY alert_history;
#ifdef ATOMIC_USER #ifdef ATOMIC_USER
void* MacEncryptCtx; /* Atomic User Mac/Encrypt Callback Context */ void* MacEncryptCtx; /* Atomic User Mac/Encrypt Callback Context */
void* DecryptVerifyCtx; /* Atomic User Decrypt/Verify Callback Context */ void* DecryptVerifyCtx; /* Atomic User Decrypt/Verify Callback Context */